mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-05-18 18:05:36 +00:00
fix(users): when using multi-domains configuration, only request the apopriate usersources.
This commit is contained in:
@@ -1434,6 +1434,16 @@ groupObjectClasses: (NSArray *) newGroupObjectClasses
|
||||
|
||||
contacts = [NSMutableArray array];
|
||||
|
||||
if(theDomain)
|
||||
{
|
||||
if ([_baseDN rangeOfString: @"%d"].location != NSNotFound)
|
||||
{
|
||||
s = [NSMutableString stringWithString: _baseDN];
|
||||
[s replaceOccurrencesOfString: @"%d" withString: theDomain options: 0 range: NSMakeRange(0, [s length])];
|
||||
ASSIGN(_baseDN, s);
|
||||
}
|
||||
}
|
||||
|
||||
if ([match length] > 0 || !_listRequiresDot)
|
||||
{
|
||||
ldapConnection = [self _ldapConnection];
|
||||
|
||||
@@ -1118,10 +1118,12 @@ static const NSString *kObfuscatedSecondaryEmailKey = @"obfuscatedSecondaryEmail
|
||||
}
|
||||
|
||||
if (infos == nil)
|
||||
{
|
||||
// If the user was not found using the domain or if no domain was detected,
|
||||
// search using the original uid.
|
||||
infos = [self contactInfosForUserWithUIDorEmail: uid
|
||||
inDomain: nil];
|
||||
}
|
||||
|
||||
return infos;
|
||||
}
|
||||
@@ -1150,8 +1152,7 @@ static const NSString *kObfuscatedSecondaryEmailKey = @"obfuscatedSecondaryEmail
|
||||
|
||||
if ([currentUser isKindOfClass: NSNullK])
|
||||
currentUser = nil;
|
||||
else if (!([currentUser objectForKey: @"emails"]
|
||||
&& [currentUser objectForKey: @"cn"]))
|
||||
else if (!([currentUser objectForKey: @"emails"] && [currentUser objectForKey: @"cn"]))
|
||||
{
|
||||
// We make sure that we either have no occurence of a cache entry or
|
||||
// that we have an occurence with only a cached password. In the
|
||||
@@ -1168,6 +1169,19 @@ static const NSString *kObfuscatedSecondaryEmailKey = @"obfuscatedSecondaryEmail
|
||||
}
|
||||
else
|
||||
newUser = NO;
|
||||
|
||||
if(!domain)
|
||||
{
|
||||
//No domain provided is there one?
|
||||
NSRange r;
|
||||
r = [uid rangeOfString: @"@" options: NSBackwardsSearch];
|
||||
if (r.location != NSNotFound)
|
||||
{
|
||||
domain = [uid substringFromIndex: (r.location + r.length)];
|
||||
if (![self isDomainDefined: domain])
|
||||
domain = nil;
|
||||
}
|
||||
}
|
||||
[self _fillContactInfosForUser: currentUser
|
||||
withUIDorEmail: aUID
|
||||
inDomain: domain];
|
||||
|
||||
Reference in New Issue
Block a user