mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-30 23:55:34 +00:00
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:
committed by
Carlos Pérez-Aradros Herce
parent
30a94161af
commit
08f57f6ad5
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user