From 416711ea43af4fe1c7095111ef6beef5fb577432 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 19 May 2015 13:48:59 -0400 Subject: [PATCH] (fix) avoid appending the domain unconditionally when SOGoEnableDomainBasedUID is set to YES --- NEWS | 1 + SoObjects/SOGo/SOGoUserFolder.m | 3 ++- SoObjects/SOGo/SOGoUserManager.m | 3 ++- UI/MainUI/SOGoRootPage.m | 6 ++++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index f5acf941a..0ebb8076d 100644 --- a/NEWS +++ b/NEWS @@ -54,6 +54,7 @@ Bug fixes - now correctly handle multiple email addresses in the GAL over EAS (#3102) - now handle very large amount of participants correctly (#3175) - fix message bodies not shown on some EAS devices (#3173) + - avoid appending the domain unconditionally when SOGoEnableDomainBasedUID is set to YES 2.2.17a (2015-03-15) -------------------- diff --git a/SoObjects/SOGo/SOGoUserFolder.m b/SoObjects/SOGo/SOGoUserFolder.m index ba8414b81..2a44128e8 100644 --- a/SoObjects/SOGo/SOGoUserFolder.m +++ b/SoObjects/SOGo/SOGoUserFolder.m @@ -427,7 +427,8 @@ { currentUser = [users objectAtIndex: i]; field = [currentUser objectForKey: @"c_uid"]; - if (enableDomainBasedUID) + if (enableDomainBasedUID && + [field rangeOfString: @"@"].location == NSNotFound) field = [NSString stringWithFormat: @"%@@%@", field, domain]; if (![field isEqualToString: login]) { diff --git a/SoObjects/SOGo/SOGoUserManager.m b/SoObjects/SOGo/SOGoUserManager.m index ae4d8612d..6354a0cf4 100644 --- a/SoObjects/SOGo/SOGoUserManager.m +++ b/SoObjects/SOGo/SOGoUserManager.m @@ -652,7 +652,8 @@ static Class NSNullK; // internal cache. [currentUser setObject: [newPassword asSHA1String] forKey: @"password"]; sd = [SOGoSystemDefaults sharedSystemDefaults]; - if ([sd enableDomainBasedUID]) + if ([sd enableDomainBasedUID] && + [login rangeOfString: @"@"].location == NSNotFound) userLogin = [NSString stringWithFormat: @"%@@%@", login, domain]; else userLogin = login; diff --git a/UI/MainUI/SOGoRootPage.m b/UI/MainUI/SOGoRootPage.m index df3e944b1..dc9712e88 100644 --- a/UI/MainUI/SOGoRootPage.m +++ b/UI/MainUI/SOGoRootPage.m @@ -228,7 +228,8 @@ if ([domain isNotNull]) { sd = [SOGoSystemDefaults sharedSystemDefaults]; - if ([sd enableDomainBasedUID]) + if ([sd enableDomainBasedUID] && + [username rangeOfString: @"@"].location == NSNotFound) username = [NSString stringWithFormat: @"%@@%@", username, domain]; } @@ -587,7 +588,8 @@ if ([domain isNotNull]) { sd = [SOGoSystemDefaults sharedSystemDefaults]; - if ([sd enableDomainBasedUID]) + if ([sd enableDomainBasedUID] && + [username rangeOfString: @"@"].location == NSNotFound) username = [NSString stringWithFormat: @"%@@%@", username, domain]; }