(fix) During login, we now extract the domain from the user to accelerate authentication requests on sources
This commit is contained in:
parent
a37f438663
commit
fbb779a71d
1
NEWS
1
NEWS
|
@ -15,6 +15,7 @@ Enhancements
|
||||||
- Missing contact fields are now saved and available when sharing it (Office, Profession, Manager's name, Assistant's name, Spouse/Partner, Anniversary) (Zentyal)
|
- Missing contact fields are now saved and available when sharing it (Office, Profession, Manager's name, Assistant's name, Spouse/Partner, Anniversary) (Zentyal)
|
||||||
- Appointment color and importance work now between Outlooks (Zentyal)
|
- Appointment color and importance work now between Outlooks (Zentyal)
|
||||||
- Synchronize events, contacts and tasks in reverse chronological order (Zentyal)
|
- Synchronize events, contacts and tasks in reverse chronological order (Zentyal)
|
||||||
|
- During login, we now extract the domain from the user to accelerate authentication requests on sources
|
||||||
|
|
||||||
Bug fixes
|
Bug fixes
|
||||||
- now keep the BodyPreference for future EAS use and default to MIME if none set (#3146)
|
- now keep the BodyPreference for future EAS use and default to MIME if none set (#3146)
|
||||||
|
|
|
@ -480,16 +480,46 @@ static Class NSNullK;
|
||||||
SOGoSystemDefaults *dd;
|
SOGoSystemDefaults *dd;
|
||||||
BOOL checkOK;
|
BOOL checkOK;
|
||||||
|
|
||||||
|
dd = [SOGoSystemDefaults sharedSystemDefaults];
|
||||||
|
|
||||||
// We check for cached passwords. If the entry is cached, we
|
// We check for cached passwords. If the entry is cached, we
|
||||||
// check this immediately. If not, we'll go directly at the
|
// check this immediately. If not, we'll go directly at the
|
||||||
// authentication source and try to validate there, then cache it.
|
// authentication source and try to validate there, then cache it.
|
||||||
if (*_domain != nil)
|
if (*_domain != nil)
|
||||||
username = [NSString stringWithFormat: @"%@@%@", _login, *_domain];
|
username = [NSString stringWithFormat: @"%@@%@", _login, *_domain];
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
NSRange r;
|
||||||
|
|
||||||
username = _login;
|
username = _login;
|
||||||
|
|
||||||
|
// We try to extract the domain in use in order to avoid pounding all the authentication
|
||||||
|
// sources if SOGoLoginDomains isn't specified. This is also true if the user is
|
||||||
|
// using DAV or EAS.
|
||||||
|
r = [username rangeOfString: @"@"];
|
||||||
|
|
||||||
|
if (r.location != NSNotFound)
|
||||||
|
{
|
||||||
|
NSArray *allDomains;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
*_domain = [username substringFromIndex: r.location+1];
|
||||||
|
|
||||||
|
allDomains = [[dd dictionaryForKey: @"domains"] allValues];
|
||||||
|
|
||||||
|
for (i = 0; i < [allDomains count]; i++)
|
||||||
|
{
|
||||||
|
if ([*_domain isEqualToString: [[allDomains objectAtIndex: i] objectForKey: @"SOGoMailDomain"]])
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// We haven't found one
|
||||||
|
if (i == [allDomains count])
|
||||||
|
*_domain = nil;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
failedCount = [[SOGoCache sharedCache] failedCountForLogin: username];
|
failedCount = [[SOGoCache sharedCache] failedCountForLogin: username];
|
||||||
dd = [SOGoSystemDefaults sharedSystemDefaults];
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// We check the fail count per user in memcache (per server). If the
|
// We check the fail count per user in memcache (per server). If the
|
||||||
|
|
Loading…
Reference in a new issue