+2007-10-19 Francis Lachapelle <flachapelle@inverse.ca>
+
+ * SoObjects/SOGo/SOGoUser.m
+ ([SOGoUser -rolesForObject:objectinContext:context]): allow
+ multiple super usernames to be defined. The user default
+ SOGoSuperUsername is renamed SOGoSuperUsernames and must be
+ an array.
+
2007-10-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoWebAuthenticator.m ([SOGoWebAuthenticator
static NSTimeZone *serverTimeZone = nil;
static NSString *fallbackIMAP4Server = nil;
static NSString *defaultLanguage = nil;
-static NSString *superUsername = nil;
+static NSArray *superUsernames = nil;
static NSURL *AgenorProfileURL = nil;
static BOOL acceptAnyUser = NO;
+ (void) initialize
{
- NSString *tzName, *nsUsername;
+ NSString *tzName;
NSUserDefaults *ud;
NSString *profileURL;
if (!defaultLanguage)
ASSIGN (defaultLanguage, @"English");
}
- if (!superUsername)
+ if (!superUsernames)
{
- nsUsername = [ud stringForKey: @"SOGoSuperUsername"];
- if ([nsUsername length] > 0)
- ASSIGN (superUsername, nsUsername);
+ superUsernames = [ud arrayForKey: @"SOGoSuperUsernames"];
}
acceptAnyUser = ([[ud stringForKey: @"SOGoAuthentificationMethod"]
if (sogoRoles)
[rolesForObject addObjectsFromArray: sogoRoles];
- if ((superUsername && [login isEqualToString: superUsername])
+ if ((superUsernames && [superUsernames containsObject: login])
|| [[object ownerInContext: context] isEqualToString: login])
[rolesForObject addObject: SoRole_Owner];
if ([object isKindOfClass: [SOGoObject class]])