Skip to content

Commit

Permalink
fix(core): properly validate domain using "domains" keys
Browse files Browse the repository at this point in the history
Instead of checking if the domain match a source ID, we now check if the
domain match a key of the "domains" configuration parameter.
  • Loading branch information
cgx committed Aug 17, 2021
1 parent 7e63452 commit a370aa7
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions SoObjects/SOGo/SOGoUserManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,8 @@ - (BOOL) isDomainDefined: (NSString *) domain

if (!domain) return NO;

ids = [_sources allKeys];
ids = [[SOGoSystemDefaults sharedSystemDefaults] domainIds];
if ([ids containsObject: domain])
// FIXME check SOGoMailDomain?
// Now source id is being considered as the domain
return YES;

sd = [SOGoSystemDefaults sharedSystemDefaults];
Expand Down Expand Up @@ -547,7 +545,7 @@ - (BOOL) checkLogin: (NSString *) _login

username = _login;

if (*_domain)
if (*_domain && ![*_domain isKindOfClass: NSNullK])
{
if ([_login rangeOfString: @"@"].location == NSNotFound)
username = [NSString stringWithFormat: @"%@@%@", _login, *_domain];
Expand All @@ -560,6 +558,7 @@ - (BOOL) checkLogin: (NSString *) _login
// sources if SOGoLoginDomains isn't specified. This is also true if the user is
// using DAV or EAS.
r = [username rangeOfString: @"@"];
*_domain = nil;

if (r.location != NSNotFound)
{
Expand Down

0 comments on commit a370aa7

Please sign in to comment.