From 030514e4e18d367b19039f45ca4094b151e83fe1 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 15 Jun 2010 14:39:11 +0000 Subject: [PATCH] Monotone-Parent: 1aac0a8e6c7ea5d24479bcc2272829762708cb56 Monotone-Revision: 2a59bba0a73aaeebae8c13b21e4099f844924b1b Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-06-15T14:39:11 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 +++++ SoObjects/SOGo/SOGoDAVAuthenticator.m | 37 ++++++++++++--------------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index de615496a..3be5ad04b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-06-15 Wolfgang Sourdeau + + * SoObjects/SOGo/SOGoDAVAuthenticator.m (-checkLogin:password:): + perform authentication in LDAP inconditionnally and fallback on + CAS if enabled for DAV. + 2010-06-14 Francis Lachapelle * UI/WebServerResources/UIxPreferences.js: Fixed a bug when saving diff --git a/SoObjects/SOGo/SOGoDAVAuthenticator.m b/SoObjects/SOGo/SOGoDAVAuthenticator.m index f769b9632..264011e27 100644 --- a/SoObjects/SOGo/SOGoDAVAuthenticator.m +++ b/SoObjects/SOGo/SOGoDAVAuthenticator.m @@ -57,27 +57,24 @@ int expire, grace; BOOL rc; - sd = [SOGoSystemDefaults sharedSystemDefaults]; - if ([[sd davAuthenticationType] isEqualToString: @"cas"]) + perr = PolicyNoError; + rc = ([[SOGoUserManager sharedUserManager] checkLogin: _login + password: _pwd + perr: &perr + expire: &expire + grace: &grace] + && perr == PolicyNoError); + if (!rc) { - /* CAS authentication for DAV requires using a proxy */ - session = [SOGoCASSession CASSessionWithIdentifier: _pwd - fromProxy: YES]; - if (session) - rc = [[session login] isEqualToString: _login]; - else - rc = NO; - } - else - { - perr = PolicyNoError; - - rc = ([[SOGoUserManager sharedUserManager] checkLogin: _login - password: _pwd - perr: &perr - expire: &expire - grace: &grace] - && perr == PolicyNoError); + sd = [SOGoSystemDefaults sharedSystemDefaults]; + if ([[sd davAuthenticationType] isEqualToString: @"cas"]) + { + /* CAS authentication for DAV requires using a proxy */ + session = [SOGoCASSession CASSessionWithIdentifier: _pwd + fromProxy: YES]; + if (session) + rc = [[session login] isEqualToString: _login]; + } } return rc;