From 3dd8bddc0e0e5f8cab3507e36e37f643ea70bea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20Garc=C3=ADa?= Date: Tue, 2 Jun 2015 12:24:32 +0200 Subject: [PATCH] Revert "(fix) more fixes and clarifications on the mutli-domain settings" This reverts commit d07df554f3d43078dedd74cefe7a63049992c67f. --- Documentation/SOGoInstallationGuide.asciidoc | 12 ++++-------- SoObjects/SOGo/SOGoUser.m | 5 ++--- SoObjects/SOGo/SOGoUserManager.m | 14 +++++++++++++- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Documentation/SOGoInstallationGuide.asciidoc b/Documentation/SOGoInstallationGuide.asciidoc index 46980463b..5ecd53450 100644 --- a/Documentation/SOGoInstallationGuide.asciidoc +++ b/Documentation/SOGoInstallationGuide.asciidoc @@ -2136,8 +2136,7 @@ Multi-domains Configuration ~~~~~~~~~~~~~~~~~~~~~~~~~~~ If you want your installation to isolate two groups of users, you must -define a distinct authentication source for each _domain_. Your domain keys -must have the same value as your email domain you want to add. Following is +define a distinct authentication source for each _domain_. Following is the same configuration that now includes two domains (acme.com and coyote.com): @@ -2145,7 +2144,7 @@ coyote.com): { ... domains = { - acme.com = { + acme = { SOGoMailDomain = acme.com; SOGoDraftsFolderName = Drafts; SOGoUserSources = ( @@ -2166,7 +2165,7 @@ coyote.com): } ); }; - coyote.com = { + coyote = { SOGoMailDomain = coyote.com; SOGoIMAPServer = imap.coyote.com; SOGoUserSources = ( @@ -2197,7 +2196,7 @@ domains. [cols="3,47,50a"] |======================================================================= |S |SOGoEnableDomainBasedUID -|Parameter used to enable user identification by domain. Users will be +|Parameter used to activate user identification by domain. Users will be able (without being required) to login using the form `username@domain`, meaning that values of _UIDFieldName_ no longer have to be unique among all domains but only within the same domain. Internally, users will @@ -2719,9 +2718,6 @@ h|2.3.0 This will grow the "participant states" field of calendar quick tables to a larger size and add the the "c_description" column to calendar quick tables. -Moreover, if you are using a multi-domain configuration, make sure the keys for -your domains match the email domains you have defined. - h|2.2.8 |The configuration configuration parameters were renamed: diff --git a/SoObjects/SOGo/SOGoUser.m b/SoObjects/SOGo/SOGoUser.m index fa6459f59..12d028fd3 100644 --- a/SoObjects/SOGo/SOGoUser.m +++ b/SoObjects/SOGo/SOGoUser.m @@ -165,9 +165,8 @@ // The domain is probably appended to the username; // make sure it is defined as a domain in the configuration. domain = [newLogin substringFromIndex: (r.location + r.length)]; - if ([[sd domainIds] containsObject: domain] && - ![sd enableDomainBasedUID]) - newLogin = [newLogin substringToIndex: r.location]; + if (![[sd domainIds] containsObject: domain]) + domain = nil; if (domain != nil && ![sd enableDomainBasedUID]) // Login domains are enabled (SOGoLoginDomains) but not diff --git a/SoObjects/SOGo/SOGoUserManager.m b/SoObjects/SOGo/SOGoUserManager.m index 21cebce2d..6ee3b4d76 100644 --- a/SoObjects/SOGo/SOGoUserManager.m +++ b/SoObjects/SOGo/SOGoUserManager.m @@ -514,9 +514,21 @@ static Class NSNullK; if (r.location != NSNotFound) { + NSArray *allDomains; + int i; + *_domain = [username substringFromIndex: r.location+1]; - if (![[[SOGoSystemDefaults sharedSystemDefaults] domainIds] containsObject: *_domain]) + allDomains = [[dd dictionaryForKey: @"domains"] allValues]; + + for (i = 0; i < [allDomains count]; i++) + { + if ([*_domain isEqualToString: [[allDomains objectAtIndex: i] objectForKey: @"SOGoMailDomain"]]) + break; + } + + // We haven't found one + if (i == [allDomains count]) *_domain = nil; } }