]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1168 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 5 Sep 2007 15:33:53 +0000 (15:33 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 5 Sep 2007 15:33:53 +0000 (15:33 +0000)
ChangeLog
NEWS
UI/Scheduler/UIxCalendarSelector.m
UI/WebServerResources/JavascriptAPIExtensions.js
UI/WebServerResources/SchedulerUI.js

index c36be425ec6d80b6d9b2d4f88bdcc52169137ef9..1a506694e8d14d0e1e95760d4285554535d361d9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 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.
diff --git a/NEWS b/NEWS
index 8e8a4f282cdd49182fadc35739b78f1b6bfcd4f4..9c7872c5bcee659f629b455e1e5afdfad01980b2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,6 @@
 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;
 
index 7205bfec7fc58133807f284d3e11d46bfdaa194b..1beef4b43ed55104a1e563818047c676479cf08f 100644 (file)
@@ -152,13 +152,19 @@ colorForNumber (unsigned int number)
 - (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
index 2e39fe69a8b675b71f8e87ae37708204e6911bf0..69aa6bd5e8e4f77662fc414127c1ddfe5fea0a6a 100644 (file)
@@ -343,3 +343,11 @@ String.prototype._base64_utf8_decode = function() {
  
   return string;
 };
+
+String.prototype.cssSafeString = function() {
+  var newString = this.replace("#", "_", "g");
+  newString = newString.replace(".", "_", "g");
+  newString = newString.replace("@", "_", "g");
+
+  return newString;
+}
index 0fb99c34fba74fcb3e83427bd1656a2277f77120..fc864847b3e9d38b656473f6c3834b224b2f7c45 100644 (file)
@@ -374,7 +374,7 @@ function tasksListCallback(http) {
       $(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");
@@ -723,7 +723,7 @@ function newEventDIV(cname, owner, starts, lasts,
    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);
@@ -1390,16 +1390,16 @@ function appendCalendar(folderName, folder) {
    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; }');
    }
 }