diff --git a/ChangeLog b/ChangeLog index ded5bc81b..2edbf9b59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2010-06-07 Wolfgang Sourdeau + * UI/WebServerResources/UIxAclEditor.js (onAclLoadHandler): add + tooltips to the special user entries. + + * UI/Common/UIxAclEditor.m (_displayNameForUID:): + (-ownerName, hasOwner): removed useless methods. + (-currentUserDisplayName): make use of the method below from the um. + + * SoObjects/SOGo/SOGoUserManager.m (-getFullEmailForUID:): + enhanced to return a proper string for users with an empty "cn" or + an empty "c_email". + * SoObjects/Appointments/SOGoAppointmentFolders.m (-toOneRelationShipKeys): with a request from iCal, we return nothing to avoid confusing iCal 3 with non-collection resources. diff --git a/SoObjects/SOGo/SOGoUserManager.m b/SoObjects/SOGo/SOGoUserManager.m index 7414d4e03..2ce189cbf 100644 --- a/SoObjects/SOGo/SOGoUserManager.m +++ b/SoObjects/SOGo/SOGoUserManager.m @@ -308,12 +308,23 @@ - (NSString *) getFullEmailForUID: (NSString *) uid { NSDictionary *contactInfos; + NSString *cn, *email, *fullEmail; contactInfos = [self contactInfosForUserWithUIDorEmail: uid]; + email = [contactInfos objectForKey: @"c_email"]; + cn = [contactInfos objectForKey: @"cn"]; + if ([cn length] > 0) + { + if ([email length] > 0) + fullEmail = [NSString stringWithFormat: @"%@ <%@>", + cn, email]; + else + fullEmail = cn; + } + else + fullEmail = email; - return [NSString stringWithFormat: @"%@ <%@>", - [contactInfos objectForKey: @"cn"], - [contactInfos objectForKey: @"c_email"]]; + return fullEmail; } - (NSString *) getImapLoginForUID: (NSString *) uid diff --git a/UI/Common/BrazilianPortuguese.lproj/Localizable.strings b/UI/Common/BrazilianPortuguese.lproj/Localizable.strings index 49d32f463..805c824be 100644 --- a/UI/Common/BrazilianPortuguese.lproj/Localizable.strings +++ b/UI/Common/BrazilianPortuguese.lproj/Localizable.strings @@ -32,6 +32,8 @@ "Any Authenticated User" = "Any Authenticated User"; "Public Access" = "Public Access"; +"Any user not listed above" = "Any user not listed above"; +"Anybody accessing this resource from the public area" = "Anybody accessing this resource from the public area"; "Sorry, the user rights can not be configured for that object." = "Desculpe, os direitos de usuário não podem ser modificados para este objeto."; diff --git a/UI/Common/Czech.lproj/Localizable.strings b/UI/Common/Czech.lproj/Localizable.strings index 51bad0891..41271a498 100644 --- a/UI/Common/Czech.lproj/Localizable.strings +++ b/UI/Common/Czech.lproj/Localizable.strings @@ -32,6 +32,8 @@ "Any Authenticated User" = "Any Authenticated User"; "Public Access" = "Public Access"; +"Any user not listed above" = "Any user not listed above"; +"Anybody accessing this resource from the public area" = "Anybody accessing this resource from the public area"; "Sorry, the user rights can not be configured for that object." = "Omlouváme se, ale uživatelská práva pro tento objekt nemohou být nastavena."; diff --git a/UI/Common/Dutch.lproj/Localizable.strings b/UI/Common/Dutch.lproj/Localizable.strings index b03008b42..90502093d 100644 --- a/UI/Common/Dutch.lproj/Localizable.strings +++ b/UI/Common/Dutch.lproj/Localizable.strings @@ -32,6 +32,8 @@ "Any Authenticated User" = "Any Authenticated User"; "Public Access" = "Public Access"; +"Any user not listed above" = "Any user not listed above"; +"Anybody accessing this resource from the public area" = "Anybody accessing this resource from the public area"; "Sorry, the user rights can not be configured for that object." = "De machtigingen kunnen niet worden ingesteld voor dit object."; diff --git a/UI/Common/English.lproj/Localizable.strings b/UI/Common/English.lproj/Localizable.strings index f6fd28472..6e0729988 100644 --- a/UI/Common/English.lproj/Localizable.strings +++ b/UI/Common/English.lproj/Localizable.strings @@ -32,6 +32,8 @@ "Any Authenticated User" = "Any Authenticated User"; "Public Access" = "Public Access"; +"Any user not listed above" = "Any user not listed above"; +"Anybody accessing this resource from the public area" = "Anybody accessing this resource from the public area"; "Sorry, the user rights can not be configured for that object." = "Sorry, the user rights can not be configured for that object."; diff --git a/UI/Common/French.lproj/Localizable.strings b/UI/Common/French.lproj/Localizable.strings index 9553aebbd..9c147e10c 100644 --- a/UI/Common/French.lproj/Localizable.strings +++ b/UI/Common/French.lproj/Localizable.strings @@ -32,6 +32,8 @@ "Any Authenticated User" = "Tout utilisateur identifié"; "Public Access" = "Accès public"; +"Any user not listed above" = "Tout utilisateur du système non-listé ci-haut"; +"Anybody accessing this resource from the public area" = "Quiconque accède à cette ressource via l'espace public"; "Sorry, the user rights can not be configured for that object." = "Sorry, the user rights can not be configured for that object."; diff --git a/UI/Common/German.lproj/Localizable.strings b/UI/Common/German.lproj/Localizable.strings index aaf8f80ca..bc5dc18ca 100644 --- a/UI/Common/German.lproj/Localizable.strings +++ b/UI/Common/German.lproj/Localizable.strings @@ -32,6 +32,8 @@ "Any Authenticated User" = "Any Authenticated User"; "Public Access" = "Public Access"; +"Any user not listed above" = "Any user not listed above"; +"Anybody accessing this resource from the public area" = "Anybody accessing this resource from the public area"; "Sorry, the user rights can not be configured for that object." = "Leider können die Benutzerrechte für dieses Objekt nicht konfiguriert werden."; diff --git a/UI/Common/Hungarian.lproj/Localizable.strings b/UI/Common/Hungarian.lproj/Localizable.strings index 1f7432d12..3eca675d2 100644 --- a/UI/Common/Hungarian.lproj/Localizable.strings +++ b/UI/Common/Hungarian.lproj/Localizable.strings @@ -32,6 +32,8 @@ "Any Authenticated User" = "Any Authenticated User"; "Public Access" = "Public Access"; +"Any user not listed above" = "Any user not listed above"; +"Anybody accessing this resource from the public area" = "Anybody accessing this resource from the public area"; "Sorry, the user rights can not be configured for that object." = "Sajnálom, erre az objektumra nem állíthatók be felhasználói jogosultságok."; diff --git a/UI/Common/Italian.lproj/Localizable.strings b/UI/Common/Italian.lproj/Localizable.strings index e41c6f7e2..beddbcf8e 100644 --- a/UI/Common/Italian.lproj/Localizable.strings +++ b/UI/Common/Italian.lproj/Localizable.strings @@ -32,6 +32,8 @@ "Any Authenticated User" = "Any Authenticated User"; "Public Access" = "Public Access"; +"Any user not listed above" = "Any user not listed above"; +"Anybody accessing this resource from the public area" = "Anybody accessing this resource from the public area"; "Sorry, the user rights can not be configured for that object." = "Non è possibile configurare i permessi per questo oggetto."; diff --git a/UI/Common/Russian.lproj/Localizable.strings b/UI/Common/Russian.lproj/Localizable.strings index 0d64329ee..80c157ff9 100644 --- a/UI/Common/Russian.lproj/Localizable.strings +++ b/UI/Common/Russian.lproj/Localizable.strings @@ -32,6 +32,8 @@ "Any Authenticated User" = "Any Authenticated User"; "Public Access" = "Public Access"; +"Any user not listed above" = "Any user not listed above"; +"Anybody accessing this resource from the public area" = "Anybody accessing this resource from the public area"; "Sorry, the user rights can not be configured for that object." = "Извините, для данного объекта невозможно настроить права доступа."; diff --git a/UI/Common/Spanish.lproj/Localizable.strings b/UI/Common/Spanish.lproj/Localizable.strings index 5aafb7b33..158e6ebb9 100644 --- a/UI/Common/Spanish.lproj/Localizable.strings +++ b/UI/Common/Spanish.lproj/Localizable.strings @@ -32,6 +32,8 @@ "Any Authenticated User" = "Any Authenticated User"; "Public Access" = "Public Access"; +"Any user not listed above" = "Any user not listed above"; +"Anybody accessing this resource from the public area" = "Anybody accessing this resource from the public area"; "Sorry, the user rights can not be configured for that object." = "Sorry, the user rights can not be configured for that object."; diff --git a/UI/Common/Swedish.lproj/Localizable.strings b/UI/Common/Swedish.lproj/Localizable.strings index 44f48dbbd..12f3eb57c 100644 --- a/UI/Common/Swedish.lproj/Localizable.strings +++ b/UI/Common/Swedish.lproj/Localizable.strings @@ -32,6 +32,8 @@ "Any Authenticated User" = "Any Authenticated User"; "Public Access" = "Public Access"; +"Any user not listed above" = "Any user not listed above"; +"Anybody accessing this resource from the public area" = "Anybody accessing this resource from the public area"; "Sorry, the user rights can not be configured for that object." = "Tyvärr, användarrättigheterna kan inte konfigureras för objektet."; diff --git a/UI/Common/UIxAclEditor.m b/UI/Common/UIxAclEditor.m index 55344e119..0eadb9f02 100644 --- a/UI/Common/UIxAclEditor.m +++ b/UI/Common/UIxAclEditor.m @@ -74,36 +74,6 @@ return aclUsers; } -- (NSString *) _displayNameForUID: (NSString *) uid -{ - SOGoUserManager *um; - NSString *s; - - um = [SOGoUserManager sharedUserManager]; - s = [uid hasPrefix: @"@"] ? [uid substringFromIndex: 1] : uid; - - return [NSString stringWithFormat: @"%@ <%@>", - [um getCNForUID: s], [um getEmailForUID: s]]; -} - -- (NSString *) ownerName -{ - NSString *ownerLogin; - - ownerLogin = [[self clientObject] ownerInContext: context]; - - return [self _displayNameForUID: ownerLogin]; -} - -- (BOOL) hasOwner -{ - NSString *ownerLogin; - - ownerLogin = [[self clientObject] ownerInContext: context]; - - return (![ownerLogin isEqualToString: @"nobody"]); -} - - (NSString *) defaultUserID { if (!defaultUserID) @@ -112,34 +82,30 @@ return defaultUserID; } -- (void) _prepareUsers +- (NSArray *) usersForObject { NSEnumerator *aclsEnum; NSString *currentUID, *ownerLogin; - ownerLogin = [[self clientObject] ownerInContext: context]; - if (!defaultUserID) - ASSIGN (defaultUserID, [[self clientObject] defaultUserID]); - - aclsEnum = [[self aclsForObject] objectEnumerator]; - while ((currentUID = [aclsEnum nextObject])) - { - if ([currentUID hasPrefix: @"@"]) - // NOTE: don't remove the prefix if we want to identify the lists visually - currentUID = [currentUID substringFromIndex: 1]; - if (!([currentUID isEqualToString: ownerLogin] - || [currentUID isEqualToString: defaultUserID] - || [currentUID isEqualToString: @"anonymous"])) - [users addObjectUniquely: currentUID]; - } - - prepared = YES; -} - -- (NSArray *) usersForObject -{ if (!prepared) - [self _prepareUsers]; + { + ownerLogin = [[self clientObject] ownerInContext: context]; + if (!defaultUserID) + ASSIGN (defaultUserID, [[self clientObject] defaultUserID]); + + aclsEnum = [[self aclsForObject] objectEnumerator]; + while ((currentUID = [aclsEnum nextObject])) + { + if ([currentUID hasPrefix: @"@"]) + // NOTE: don't remove the prefix if we want to identify the lists visually + currentUID = [currentUID substringFromIndex: 1]; + if (!([currentUID isEqualToString: ownerLogin] + || [currentUID isEqualToString: defaultUserID] + || [currentUID isEqualToString: @"anonymous"])) + [users addObjectUniquely: currentUID]; + } + prepared = YES; + } return users; } @@ -156,7 +122,15 @@ - (NSString *) currentUserDisplayName { - return [self _displayNameForUID: currentUser]; + SOGoUserManager *um; + NSString *s; + + um = [SOGoUserManager sharedUserManager]; + s = ([currentUser hasPrefix: @"@"] + ? [currentUser substringFromIndex: 1] + : currentUser); + + return [um getFullEmailForUID: s]; } - (BOOL) canSubscribeUsers @@ -206,30 +180,15 @@ clientObject = [self clientObject]; ownerLogin = [clientObject ownerInContext: context]; aclsEnum = [[self aclsForObject] objectEnumerator]; - currentUID = [[aclsEnum nextObject] objectForKey: @"c_uid"]; - while (currentUID) - { - if ([currentUID isEqualToString: ownerLogin] - || [savedUIDs containsObject: currentUID]) - [users removeObject: currentUID]; - currentUID = [[aclsEnum nextObject] objectForKey: @"c_uid"]; - } + while ((currentUID = [[aclsEnum nextObject] objectForKey: @"c_uid"])) + if ([currentUID isEqualToString: ownerLogin] + || [savedUIDs containsObject: currentUID]) + [users removeObject: currentUID]; [clientObject removeAclsForUsers: users]; return [self jsCloseWithRefreshMethod: nil]; } -- (BOOL) canModifyAcls -{ - SoSecurityManager *mgr; - - mgr = [SoSecurityManager sharedSecurityManager]; - - return (![mgr validatePermission: SoPerm_ChangePermissions - onObject: [self clientObject] - inContext: context]); -} - - (BOOL) isPublicAccessEnabled { return [[SOGoSystemDefaults sharedSystemDefaults] diff --git a/UI/Common/Ukrainian.lproj/Localizable.strings b/UI/Common/Ukrainian.lproj/Localizable.strings index 7ac70dacb..663cb14b1 100644 --- a/UI/Common/Ukrainian.lproj/Localizable.strings +++ b/UI/Common/Ukrainian.lproj/Localizable.strings @@ -28,9 +28,13 @@ "Add..." = "Додати..."; "Remove" = "Вилучити"; -"Default Roles" = "Контроль доступу для всіх"; "Subscribe User" = "Підписати користувача"; +"Any Authenticated User" = "Any Authenticated User"; +"Public Access" = "Public Access"; +"Any user not listed above" = "Any user not listed above"; +"Anybody accessing this resource from the public area" = "Anybody accessing this resource from the public area"; + "Sorry, the user rights can not be configured for that object." = "Вибачте, для цього об’єкту неможливо налаштувати права доступу."; /* generic.js */ diff --git a/UI/Common/Welsh.lproj/Localizable.strings b/UI/Common/Welsh.lproj/Localizable.strings index 9b4706480..f1cc84433 100644 --- a/UI/Common/Welsh.lproj/Localizable.strings +++ b/UI/Common/Welsh.lproj/Localizable.strings @@ -32,6 +32,8 @@ "Any Authenticated User" = "Any Authenticated User"; "Public Access" = "Public Access"; +"Any user not listed above" = "Any user not listed above"; +"Anybody accessing this resource from the public area" = "Anybody accessing this resource from the public area"; "Sorry, the user rights can not be configured for that object." = "Sori, ni all hawliau'r defnyddiwr cael ei newid ar gyfer y gwrthrych hwn."; diff --git a/UI/Templates/UIxAclEditor.wox b/UI/Templates/UIxAclEditor.wox index 0cb2ec0e2..b9ed8f443 100644 --- a/UI/Templates/UIxAclEditor.wox +++ b/UI/Templates/UIxAclEditor.wox @@ -28,21 +28,15 @@ var:value="defaultUserID"/> - - -
- -
- + - -
    +
+
  • -1 && !nextLi) { - log("current li: " + lis[count].id); if (lis[count].hasClassName("normal-user")) { nextLi = lis[count+1]; } @@ -187,10 +186,14 @@ function onAclLoadHandler() { var userNode = nodeForUser(_("Any Authenticated User"), defaultUserID); userNode.addClassName("any-user"); + userNode.setAttribute("title", + _("Any user not listed above")); ul.appendChild(userNode); if (isPublicAccessEnabled && CurrentModule() != "Mail") { userNode = nodeForUser(_("Public Access"), "anonymous"); userNode.addClassName("anonymous-user"); + userNode.setAttribute("title", + _("Anybody accessing this resource from the public area")); ul.appendChild(userNode); }