From 01168264044925da4a2787d748644823eb647812 Mon Sep 17 00:00:00 2001 From: wolfgang Date: Fri, 19 Oct 2007 19:43:15 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1191 d1b88da0-ebda-0310-925b-ed51d893ca5b --- ChangeLog | 8 ++++++++ SoObjects/SOGo/SOGoUser.m | 12 +++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82b63675..33493d6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-10-19 Francis Lachapelle + + * 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 * SoObjects/SOGo/SOGoWebAuthenticator.m ([SOGoWebAuthenticator diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 9cd0c562..7f43654f 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -42,7 +42,7 @@ 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; @@ -82,7 +82,7 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; + (void) initialize { - NSString *tzName, *nsUsername; + NSString *tzName; NSUserDefaults *ud; NSString *profileURL; @@ -109,11 +109,9 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; 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"] @@ -569,7 +567,7 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek"; 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]]) -- 2.39.5