Skip to content

Commit

Permalink
fix(core): change password in user's matching source only
Browse files Browse the repository at this point in the history
  • Loading branch information
cgx committed May 5, 2021
1 parent e0b6e22 commit da36608
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions SoObjects/SOGo/SOGoUserManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -433,15 +433,18 @@ - (BOOL) _sourceChangePasswordForLogin: (NSString *) login
perr: (SOGoPasswordPolicyError *) perr
{
NSObject <SOGoSource> *sogoSource;
NSEnumerator *authIDs;
NSString *currentID;
BOOL didChange;

*perr = -1;
didChange = NO;

authIDs = [[self authenticationSourceIDsInDomain: domain] objectEnumerator];
while (!didChange && (currentID = [authIDs nextObject]))
NSDictionary *info = [self contactInfosForUserWithUIDorEmail: login
inDomain: domain];

if (info)
{
currentID = [info objectForKey: @"SOGoSource"];
sogoSource = [_sources objectForKey: currentID];
didChange = [sogoSource changePasswordForLogin: login
oldPassword: oldPassword
Expand Down Expand Up @@ -1031,7 +1034,7 @@ - (NSDictionary *) contactInfosForUserWithUIDorEmail: (NSString *) uid
if ([currentUser isKindOfClass: NSNullK])
currentUser = nil;
else if (!([currentUser objectForKey: @"emails"]
&& [currentUser objectForKey: @"cn"]))
&& [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
Expand Down

0 comments on commit da36608

Please sign in to comment.