SOGoUserManager: get domain after authentication

For multidomain source which has no domain defined, we get
the domain from the username which must have @domain as suffix
This commit is contained in:
Jesús García Sáez
2015-09-23 15:49:53 +02:00
committed by Carlos Pérez-Aradros Herce
parent 30a94161af
commit 08f57f6ad5
+18 -1
View File
@@ -477,7 +477,24 @@ static Class NSNullK;
}
if (checkOK && *domain == nil)
*domain = [sogoSource domain];
{
SOGoSystemDefaults *sd = [SOGoSystemDefaults sharedSystemDefaults];
BOOL multidomainSource = [sd enableDomainBasedUID] &&
[sogoSource domain] == nil;
if (multidomainSource)
{
NSArray *parts = [login componentsSeparatedByString: @"@"];
if ([parts count] != 2)
{
[self errorWithFormat: @"Authenticated with multidomain source "
@"but login is not an email (%@).", login];
return NO;
}
*domain = [parts objectAtIndex: 1];
}
else
*domain = [sogoSource domain];
}
return checkOK;
}