Monotone-Parent: be540f76fdae4a96eb16cea471d65d8da30b9428

Monotone-Revision: 3c3b185ac78cbde20c55f90c27b4f32909f9fdbf

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-06-02T16:37:43
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-06-02 16:37:43 +00:00
parent 1b793d65a3
commit 044a29c178
2 changed files with 21 additions and 10 deletions

View File

@@ -1,5 +1,9 @@
2010-06-02 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Contacts/SOGoContactFolders.m (-appendSystemSources):
we now add public sources to the list of folders if and only if
the active user is the owner of the current parent folder.
* SoObjects/SOGo/SOGoWebAuthenticator.m (-userInContext): if the
returned user has the login "anonymous", we return a corresponding
instance of SOGoUser to make sure methods are never invoked on

View File

@@ -58,18 +58,25 @@
NSEnumerator *sourceIDs;
NSString *currentSourceID, *srcDisplayName, *domain;
SOGoContactSourceFolder *currentFolder;
SOGoUser *currentUser;
domain = [[context activeUser] domain];
um = [SOGoUserManager sharedUserManager];
sourceIDs = [[um addressBookSourceIDsInDomain: domain] objectEnumerator];
while ((currentSourceID = [sourceIDs nextObject]))
currentUser = [context activeUser];
if (activeUserIsOwner
|| [[currentUser login]
isEqualToString: [self ownerInContext: context]])
{
srcDisplayName = [um displayNameForSourceWithID: currentSourceID];
currentFolder = [SOGoContactSourceFolder folderWithName: currentSourceID
andDisplayName: srcDisplayName
inContainer: self];
[currentFolder setSource: [um sourceWithID: currentSourceID]];
[subFolders setObject: currentFolder forKey: currentSourceID];
domain = [currentUser domain];
um = [SOGoUserManager sharedUserManager];
sourceIDs = [[um addressBookSourceIDsInDomain: domain] objectEnumerator];
while ((currentSourceID = [sourceIDs nextObject]))
{
srcDisplayName = [um displayNameForSourceWithID: currentSourceID];
currentFolder = [SOGoContactSourceFolder folderWithName: currentSourceID
andDisplayName: srcDisplayName
inContainer: self];
[currentFolder setSource: [um sourceWithID: currentSourceID]];
[subFolders setObject: currentFolder forKey: currentSourceID];
}
}
return nil;