Merge pull request #139 from Zentyal/jgarcia/get-sources-from-your-domain

Try to authenticate only against sources of the given domain
This commit is contained in:
Enrique J. Hernández 2015-05-22 20:43:41 +02:00
commit 0a37652dd6

View file

@ -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]))
{