mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-23 04:15:26 +00:00
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:
@@ -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.
|
||||
|
||||
|
||||
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user