2007-09-05 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ * UI/Scheduler/UIxCalendarSelector.m ([UIxCalendarSelector
+ -currentCalendarLogin]): replace css-unsafe characters with _.
+
* UI/SOGoUI/UIxComponent.m ([UIxComponent
-shortUserNameForDisplay]): simplified method.
([-user]): removed method since [context activeUser] is as useful.
0.9.0-200709XX
--------------
+- implemented cookie-based identification in the web interface;
- fixed a bug where a false positive happening whenever a wrong user login was
given during an indirect bind;
- (NSString *) currentCalendarLogin
{
NSArray *parts;
+ NSMutableString *login;
+ login = [NSMutableString string];
parts = [[currentCalendarFolder objectForKey: @"folder"]
componentsSeparatedByString: @":"];
-
- return (([parts count] > 1)
- ? [parts objectAtIndex: 0]
- : [[context activeUser] login]);
+ [login appendString: (([parts count] > 1)
+ ? [parts objectAtIndex: 0]
+ : [[context activeUser] login])];
+ [login replaceString: @"." withString: @"_"];
+ [login replaceString: @"#" withString: @"_"];
+ [login replaceString: @"@" withString: @"_"];
+
+ return login;
}
- (NSString *) currentCalendarStyle
return string;
};
+
+String.prototype.cssSafeString = function() {
+ var newString = this.replace("#", "_", "g");
+ newString = newString.replace(".", "_", "g");
+ newString = newString.replace("@", "_", "g");
+
+ return newString;
+}
$(listItem).addClassName(data[i][5]);
var owner = data[i][1];
listItem.owner = owner;
- $(listItem).addClassName("ownerIs" + owner);
+ $(listItem).addClassName("ownerIs" + owner.cssSafeString());
listItem.cname = escape(data[i][0]);
var input = document.createElement("input");
input.setAttribute("type", "checkbox");
var innerDiv = document.createElement("div");
eventDiv.appendChild(innerDiv);
$(innerDiv).addClassName("eventInside");
- $(innerDiv).addClassName("ownerIs" + owner);
+ $(innerDiv).addClassName("ownerIs" + owner.cssSafeString());
var gradientDiv = document.createElement("div");
innerDiv.appendChild(gradientDiv);
var theRules = new Array();
var lastSheet = document.styleSheets[document.styleSheets.length - 1];
if (lastSheet.insertRule) { // Mozilla
- lastSheet.insertRule('.ownerIs' + contactId + ' {'
+ lastSheet.insertRule('.ownerIs' + contactId.cssSafeString() + ' {'
+ ' background-color: '
+ color
+ ' !important; }', 0);
}
else { // IE
- lastSheet.addRule('.ownerIs' + contactId,
- ' background-color: '
- + color
- + ' !important; }');
+ lastSheet.addRule('.ownerIs' + contactId.cssSafeString(),
+ ' background-color: '
+ + color
+ + ' !important; }');
}
}