Monotone-Parent: c991261163c8c9a35643794546cb61c14e85af33

Monotone-Revision: 1915e9dbb25e68de74dac3bf1f7971c87ce2bf5c

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-06-22T19:58:31
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-06-22 19:58:31 +00:00
parent 2b61575049
commit 5c27e60602
2 changed files with 21 additions and 5 deletions
+8
View File
@@ -1,3 +1,11 @@
2007-06-22 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/SOGoUser.m ([SOGoUser +initialize]): new module
bool var "acceptAnyUser" that is set when the AuthenticationMethod
user default is nil.
([SOGoUser -initWithLogin:newLoginroles:newRoles]):
unconditionnally returns an instance whenever acceptAnyUser is set.
2007-06-21 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* Main/sogod.m (main): prevent SOGo from running as root.
+13 -5
View File
@@ -40,6 +40,7 @@ static NSTimeZone *serverTimeZone = nil;
static NSString *fallbackIMAP4Server = nil;
static NSString *defaultLanguage = nil;
static NSURL *AgenorProfileURL = nil;
static BOOL acceptAnyUser = NO;
NSString *SOGoWeekStartHideWeekNumbers = @"HideWeekNumbers";
NSString *SOGoWeekStartJanuary1 = @"January1";
@@ -83,6 +84,8 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
if (!defaultLanguage)
ASSIGN (defaultLanguage, @"English");
}
acceptAnyUser = (![ud stringForKey: @"AuthentificationMethod"]);
}
+ (SOGoUser *) userWithLogin: (NSString *) newLogin
@@ -115,17 +118,22 @@ NSString *SOGoWeekStartFirstFullWeek = @"FirstFullWeek";
roles: (NSArray *) newRoles
{
LDAPUserManager *um;
NSDictionary *user;
NSString *realUID;
if ([newLogin isEqualToString: @"anonymous"]
|| [newLogin isEqualToString: @"freebusy"])
self = [super initWithLogin: newLogin roles: newRoles];
else
{
um = [LDAPUserManager sharedUserManager];
user = [um contactInfosForUserWithUIDorEmail: newLogin];
self = [super initWithLogin: [user objectForKey: @"c_uid"]
roles: newRoles];
if (acceptAnyUser)
realUID = newLogin;
else
{
um = [LDAPUserManager sharedUserManager];
realUID = [[um contactInfosForUserWithUIDorEmail: newLogin]
objectForKey: @"c_uid"];
}
self = [super initWithLogin: realUID roles: newRoles];
}
return self;