mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-14 16:07:15 +00:00
Set domain before fetching auth sources
In multidomain environment right now we are trying to authenticate against all sources defined in sogo.conf because the domain is not set at this point. In sogo.conf we have to specify the domain a source is useful for, so with this patch instead of 'n' tries of authentication we will perform only 1 (in a scenario where we have 1 source per domain, and we have 'n' domains).
This commit is contained in:
1 parent
ca500df0af
commit
7160d94e91
1 file changed
+12
-2
@@ -425,9 +425,19 @@ static Class NSNullK;
|
||||
NSEnumerator *authIDs;
|
||||
NSString *currentID;
|
||||
BOOL checkOK;
|
||||
|
||||
SOGoSystemDefaults *sd;
|
||||
NSRange r;
|
||||
|
||||
checkOK = NO;
|
||||
|
||||
|
||||
if (*domain == nil)
|
||||
{
|
||||
sd = [SOGoSystemDefaults sharedSystemDefaults];
|
||||
r = [login rangeOfString: @"@" options: NSBackwardsSearch];
|
||||
if ([sd enableDomainBasedUID] && r.location != NSNotFound)
|
||||
*domain = [login substringFromIndex: (r.location + r.length)];
|
||||
}
|
||||
|
||||
authIDs = [[self authenticationSourceIDsInDomain: *domain] objectEnumerator];
|
||||
while (!checkOK && (currentID = [authIDs nextObject]))
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user