From 98b2014f6b2192365655ad06b6bf87f2aabf4fd7 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 9 May 2007 19:21:01 +0000 Subject: [PATCH] Monotone-Parent: 866444d29ef56047291b49a17e79ceacf8d03e2b Monotone-Revision: 05c004606ea7630c74dd1bb97957bc57215c5e55 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-09T19:21:01 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ SoObjects/SOGo/SOGoAuthenticator.m | 31 +++++++++++++++--------------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8467a01d8..17ef60fcf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2007-05-09 Wolfgang Sourdeau + * SoObjects/SOGo/SOGoAuthenticator.m ([SOGoAuthenticator + -LDAPCheckLogin:_loginpassword:_pwd]): use the user manager to + check login information. + * SoObjects/Contacts/SOGoContactLDAPFolder.m ([SOGoContactLDAPFolder +contactFolderWithName:aNameandDisplayName:aDisplayNameinContainer:aContainer]): diff --git a/SoObjects/SOGo/SOGoAuthenticator.m b/SoObjects/SOGo/SOGoAuthenticator.m index be10f0c8c..134dba023 100644 --- a/SoObjects/SOGo/SOGoAuthenticator.m +++ b/SoObjects/SOGo/SOGoAuthenticator.m @@ -22,9 +22,11 @@ #import #import "SOGoPermissions.h" -#include "SOGoAuthenticator.h" -#include "SOGoUser.h" -#include "common.h" +#import "LDAPUserManager.h" + +#import "SOGoAuthenticator.h" +#import "SOGoUser.h" +#import "common.h" @implementation SOGoAuthenticator @@ -50,9 +52,9 @@ static SOGoAuthenticator *auth = nil; authMethod = [[ud stringForKey:@"AuthentificationMethod"] retain]; if ([authMethod isEqualToString: @"LDAP"]) { - LDAPBaseDN = [[ud stringForKey:@"LDAPRootDN"] retain]; - LDAPHost = [[ud stringForKey:@"LDAPHost"] retain]; - LDAPPort = [ud integerForKey:@"LDAPPort"]; +// LDAPBaseDN = [[ud stringForKey:@"LDAPRootDN"] retain]; +// LDAPHost = [[ud stringForKey:@"LDAPHost"] retain]; +// LDAPPort = [ud integerForKey:@"LDAPPort"]; } } @@ -87,11 +89,11 @@ static SOGoAuthenticator *auth = nil; - (BOOL) LDAPCheckLogin: (NSString *) _login password: (NSString *) _pwd { - return [NGLdapConnection checkPassword: _pwd - ofLogin: _login - atBaseDN: LDAPBaseDN - onHost: LDAPHost - port: LDAPPort]; + LDAPUserManager *um; + + um = [LDAPUserManager sharedUserManager]; + + return [um checkLogin: _login andPassword: _pwd]; } /* create SOGoUser */ @@ -105,7 +107,7 @@ static SOGoAuthenticator *auth = nil; if (!anonymous) anonymous - = [[SOGoUser alloc] initWithLogin:@"anonymous" + = [[SOGoUser alloc] initWithLogin: @"anonymous" roles: [NSArray arrayWithObject: SoRole_Anonymous]]; if (!freebusy) freebusy @@ -124,9 +126,8 @@ static SOGoAuthenticator *auth = nil; user = anonymous; } else - user = [[[SOGoUser alloc] initWithLogin: login - roles: [self rolesForLogin: login]] - autorelease]; + user = [SOGoUser userWithLogin: login + roles: [self rolesForLogin: login]]; } else user = nil;