mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-15 05:14:53 +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:
@@ -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