mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-06 15:33:19 +00:00
Monotone-Parent: 3e6948059832484bb80a8445b88f9673d85ac1ba
Monotone-Revision: dbf0e1c560253d898374155e0aa7bd9b90bc6555 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-11-20T20:25:13 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -55,55 +55,11 @@
|
||||
return auth;
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
NSUserDefaults *ud;
|
||||
|
||||
if ((self = [super init]))
|
||||
{
|
||||
ud = [NSUserDefaults standardUserDefaults];
|
||||
authMethod = [ud stringForKey: @"SOGoAuthenticationMethod"];
|
||||
if (!authMethod)
|
||||
authMethod = [ud stringForKey: @"SOGoAuthentificationMethod"];
|
||||
if (!authMethod)
|
||||
{
|
||||
authMethod = @"LDAP";
|
||||
[self warnWithFormat:
|
||||
@"authentication method automatically set to '%@'",
|
||||
authMethod];
|
||||
}
|
||||
[authMethod retain];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void) dealloc
|
||||
{
|
||||
[authMethod release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (BOOL) checkLogin: (NSString *) _login
|
||||
password: (NSString *) _pwd
|
||||
{
|
||||
BOOL accept;
|
||||
SOGoUserManager *um;
|
||||
|
||||
if ([authMethod isEqualToString: @"LDAP"])
|
||||
{
|
||||
um = [SOGoUserManager sharedUserManager];
|
||||
accept = [um checkLogin: _login andPassword: _pwd];
|
||||
}
|
||||
else
|
||||
accept = NO;
|
||||
// else
|
||||
// accept = ([authMethod isEqualToString: @"bypass"]
|
||||
// && [_login length] > 0);
|
||||
|
||||
return accept;
|
||||
// || ([_login isEqualToString: @"freebusy"]
|
||||
// && [_pwd isEqualToString: @"freebusy"]));
|
||||
return [[SOGoUserManager sharedUserManager] checkLogin: _login
|
||||
andPassword: _pwd];
|
||||
}
|
||||
|
||||
- (SOGoUser *) userInContext: (WOContext *)_ctx
|
||||
|
||||
Reference in New Issue
Block a user