Monotone-Parent: a5bfd93a503f6042740a0ab88ca339c566d81c1f

Monotone-Revision: e5e3e8aeac9b5235e537766deabadd79882c8c99

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-06-01T18:48:14
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-06-01 18:48:14 +00:00
parent d544e677e5
commit 786d7a1558
2 changed files with 29 additions and 3 deletions
+4
View File
@@ -1,5 +1,9 @@
2010-06-01 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoUserManager.m
(-contactInfosForUserWithUIDorEmail:): return a fixed dictionary
of information for uid = "anonymous".
* Tests/Integration/test-*.py: take the API changes in
webdavlib.py into accounts with regards to XPath queries.
+25 -3
View File
@@ -593,17 +593,39 @@
forLogin: key];
}
- (NSMutableDictionary *) _contactInfosForAnonymous
{
static NSMutableDictionary *user = nil;
if (!user)
{
user = [[NSMutableDictionary alloc] initWithCapacity: 7];
[user setObject: [NSArray arrayWithObject: @"anonymous"]
forKey: @"emails"];
[user setObject: @"Public User" forKey: @"cn"];
[user setObject: @"anonymous" forKey: @"c_uid"];
[user setObject: @"" forKey: @"c_domain"];
[user setObject: [NSNumber numberWithBool: YES]
forKey: @"CalendarAccess"];
[user setObject: [NSNumber numberWithBool: NO]
forKey: @"MailAccess"];
}
return user;
}
- (NSDictionary *) contactInfosForUserWithUIDorEmail: (NSString *) uid
{
NSMutableDictionary *currentUser, *contactInfos;
NSMutableDictionary *currentUser;
NSString *aUID, *jsonUser;
BOOL newUser;
if ([uid length] > 0)
if ([uid isEqualToString: @"anonymous"])
currentUser = [self _contactInfosForAnonymous];
else if ([uid length] > 0)
{
// Remove the "@" prefix used to identified groups in the ACL tables.
aUID = [uid hasPrefix: @"@"] ? [uid substringFromIndex: 1] : uid;
contactInfos = [NSMutableDictionary dictionary];
jsonUser = [[SOGoCache sharedCache] userAttributesForLogin: aUID];
currentUser = [NSMutableDictionary dictionaryWithJSONString: jsonUser];
if (!([currentUser objectForKey: @"emails"]