From 8a17179ab1419095418c5ae2dee7bf56c5ce63d7 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Thu, 24 Jul 2008 18:00:21 +0000 Subject: [PATCH] Monotone-Parent: 05ac214876f464bdf1a7fd94fc6ee88c41f8f7a6 Monotone-Revision: ab81a2b3344ce13069fdc2f4762e128a13136bb3 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-07-24T18:00:21 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 12 ++++++++++++ NEWS | 1 + SoObjects/SOGo/SOGoDAVAuthenticator.m | 22 +++++++++++++++++----- SoObjects/SOGo/SOGoUser.m | 11 ++++++----- SoObjects/SOGo/SOGoWebAuthenticator.m | 22 ++++++++++++++++++---- 5 files changed, 54 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 052fa7ed3..b2e1313c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-07-24 Wolfgang Sourdeau + + * SoObjects/SOGo/SOGoWebAuthenticator.m ([SOGoWebAuthenticator -checkLogin:_loginpassword:_pwd]), + SoObjects/SOGo/SOGoDAVAuthenticator.m ([SOGoDAVAuthenticator -checkLogin:_loginpassword:_pwd]): + disable "bypass" authentification method, since it doesn't work anyway. + + * SoObjects/SOGo/SOGoWebAuthenticator.m ([SOGoWebAuthenticator -init]), + SoObjects/SOGo/SOGoDAVAuthenticator.m ([SOGoDAVAuthenticator + -init]): use "SOGoAuthenticationMethod" first, since + "SOGoAuthentificationMethod" was a typo. If none are specified, + fallback on "LDAP". + 2008-07-23 Wolfgang Sourdeau * SoObjects/Appointments/SOGoCalendarComponent.m diff --git a/NEWS b/NEWS index 6518eb468..35b3294c8 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ address book in the Address Book module - the events are now computed in the server code again, in order to speedup the drawing of events as well as to fix the bug where events would be shifted back or forth of one day, depending on how their start time would be compared to UTC time - implemented the handling of exceptional occurences of recurrent events - all the calendar preferences are now taken into account +- the user defaults variable "SOGoAuthentificationMethod" has been renamed to "SOGoAuthenticationMethod" 0.9.0-20080520 (1.0 rc6) ------------------------ diff --git a/SoObjects/SOGo/SOGoDAVAuthenticator.m b/SoObjects/SOGo/SOGoDAVAuthenticator.m index d52f57406..299b906a9 100644 --- a/SoObjects/SOGo/SOGoDAVAuthenticator.m +++ b/SoObjects/SOGo/SOGoDAVAuthenticator.m @@ -25,6 +25,7 @@ #import #import +#import #import #import "LDAPUserManager.h" @@ -47,11 +48,21 @@ - (id) init { + NSUserDefaults *ud; + if ((self = [super init])) { - authMethod = [[NSUserDefaults standardUserDefaults] - stringForKey: @"SOGoAuthentificationMethod"]; - [authMethod retain]; + 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]; + } } return self; @@ -75,8 +86,9 @@ accept = [um checkLogin: _login andPassword: _pwd]; } else - accept = ([authMethod isEqualToString: @"bypass"] - && [_login length] > 0); + accept = NO; +// accept = ([authMethod isEqualToString: @"bypass"] +// && [_login length] > 0); return accept; // || ([_login isEqualToString: @"freebusy"] diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 5376e1562..4445cbff7 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -51,7 +51,7 @@ static BOOL fallbackIsConfigured = NO; static NSString *defaultLanguage = nil; static NSArray *superUsernames = nil; static NSURL *AgenorProfileURL = nil; -static BOOL acceptAnyUser = NO; +// static BOOL acceptAnyUser = NO; static int sogoFirstDayOfWeek = -1; static int defaultDayStartTime = -1; static int defaultDayEndTime = -1; @@ -148,8 +148,8 @@ _timeValue (NSString *key) if (!superUsernames) ASSIGN (superUsernames, [ud arrayForKey: @"SOGoSuperUsernames"]); - acceptAnyUser = ([[ud stringForKey: @"SOGoAuthentificationMethod"] - isEqualToString: @"bypass"]); +// acceptAnyUser = ([[ud stringForKey: @"SOGoAuthentificationMethod"] +// isEqualToString: @"bypass"]); } + (NSString *) language @@ -218,8 +218,9 @@ _timeValue (NSString *key) LDAPUserManager *um; NSString *realUID; - if (acceptAnyUser - || [newLogin isEqualToString: @"anonymous"] + if (// acceptAnyUser +// || + [newLogin isEqualToString: @"anonymous"] || [newLogin isEqualToString: @"freebusy"]) realUID = newLogin; else diff --git a/SoObjects/SOGo/SOGoWebAuthenticator.m b/SoObjects/SOGo/SOGoWebAuthenticator.m index 68c802592..d2ca60627 100644 --- a/SoObjects/SOGo/SOGoWebAuthenticator.m +++ b/SoObjects/SOGo/SOGoWebAuthenticator.m @@ -32,6 +32,7 @@ #import #import #import +#import #import #import @@ -56,10 +57,21 @@ - (id) init { + NSUserDefaults *ud; + if ((self = [super init])) { - authMethod = [[NSUserDefaults standardUserDefaults] - stringForKey: @"SOGoAuthentificationMethod"]; + 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]; } @@ -84,8 +96,10 @@ accept = [um checkLogin: _login andPassword: _pwd]; } else - accept = ([authMethod isEqualToString: @"bypass"] - && [_login length] > 0); + accept = NO; +// else +// accept = ([authMethod isEqualToString: @"bypass"] +// && [_login length] > 0); return accept; // || ([_login isEqualToString: @"freebusy"]