From c404a10153dcf62ca8035ddf06f661d8fb398687 Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Mon, 25 Jul 2011 14:28:15 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: 32b84d9dc2715067c885c49bfc26087eac4dcd2b Monotone-Revision: fb2d19f2d09037cb11414b10bc8c3bb8beb37bd9 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2011-07-25T14:28:15 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 10 ++++++++++ SoObjects/SOGo/SOGoUser.m | 5 +++-- UI/MainUI/SOGoRootPage.m | 26 ++++++++++++++++++-------- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50fa4ea60..6cc28bd71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2011-07-25 Francis Lachapelle + + * UI/MainUI/SOGoRootPage.m (-connectAction): don't add the domain + if domain-based UIDs are not enabled. + (-changePasswordAction): idem. + + * SoObjects/SOGo/SOGoUser.m (-initWithLogin:roles:trust:): added + test for the ivar "realUID" since it can be undefined if the + corresponding source is down. + 2011-07-22 Wolfgang Sourdeau * OpenChange/MAPIStoreSOGo.m (sogo_table_get_row_count): added new diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index 4e5fe936a..6363aad2d 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -1,5 +1,5 @@ /* - Copyright (C) 2006-2009 Inverse inc. + Copyright (C) 2006-2011 Inverse inc. Copyright (C) 2005 SKYRIX Software AG This file is part of OpenGroupware.org. @@ -147,6 +147,7 @@ _settings = nil; uid = nil; + realUID = nil; domain = nil; if ([newLogin isEqualToString: @"anonymous"] @@ -184,7 +185,7 @@ domain = [contactInfos objectForKey: @"c_domain"]; } - if (domain) + if ([realUID length] && [domain length]) { // When the user is associated to a domain, the [SOGoUser login] // method returns the combination login@domain while diff --git a/UI/MainUI/SOGoRootPage.m b/UI/MainUI/SOGoRootPage.m index 765efe587..a960572ff 100644 --- a/UI/MainUI/SOGoRootPage.m +++ b/UI/MainUI/SOGoRootPage.m @@ -148,6 +148,7 @@ SOGoWebAuthenticator *auth; SOGoAppointmentFolders *calendars; SOGoUserDefaults *ud; + SOGoSystemDefaults *sd; SOGoUser *loggedInUser; NSString *username, *password, *language, *domain; NSArray *supportedLanguages; @@ -186,7 +187,11 @@ andJSONRepresentation: json]; if ([domain isNotNull]) - username = [NSString stringWithFormat: @"%@@%@", username, domain]; + { + sd = [SOGoSystemDefaults sharedSystemDefaults]; + if ([sd enableDomainBasedUID]) + username = [NSString stringWithFormat: @"%@@%@", username, domain]; + } authCookie = [self _cookieWithUsername: username andPassword: password @@ -428,14 +433,15 @@ - (WOResponse *) changePasswordAction { NSString *username, *domain, *password, *newPassword, *value; - SOGoUserManager *um; - SOGoPasswordPolicyError error; - WOResponse *response; - WORequest *request; NSDictionary *message; - SOGoWebAuthenticator *auth; WOCookie *authCookie; NSArray *creds; + SOGoUserManager *um; + SOGoPasswordPolicyError error; + SOGoSystemDefaults *sd; + SOGoWebAuthenticator *auth; + WOResponse *response; + WORequest *request; request = [context request]; message = [[request contentAsString] objectFromJSONString]; @@ -467,8 +473,12 @@ [SOGoSession deleteValueForSessionKey: [creds objectAtIndex: 1]]; if ([domain isNotNull]) - username = [NSString stringWithFormat: @"%@@%@", username, domain]; - + { + sd = [SOGoSystemDefaults sharedSystemDefaults]; + if ([sd enableDomainBasedUID]) + username = [NSString stringWithFormat: @"%@@%@", username, domain]; + } + response = [self responseWith204]; authCookie = [self _cookieWithUsername: username andPassword: newPassword