Skip to content

Commit

Permalink
fix(web): allow to change expired password from login page
Browse files Browse the repository at this point in the history
  • Loading branch information
cgx committed May 6, 2021
1 parent 8a10ae1 commit bdd8e35
Showing 1 changed file with 23 additions and 10 deletions.
33 changes: 23 additions & 10 deletions SoObjects/SOGo/LDAPSource.m
Expand Up @@ -718,10 +718,15 @@ - (BOOL) changePasswordForLogin: (NSString *) login
}
else if (_passwordPolicy)
{
didChange = [bindConnection changePasswordAtDn: userDN
oldPassword: oldPassword
newPassword: newPassword
perr: (void *)perr];
if ([bindConnection bindWithMethod: @"simple"
binddn: _sourceBindDN
credentials: _sourceBindPassword])
{
didChange = [bindConnection changePasswordAtDn: userDN
oldPassword: oldPassword
newPassword: newPassword
perr: (void *)perr];
}
}
else
{
Expand All @@ -740,12 +745,20 @@ - (BOOL) changePasswordForLogin: (NSString *) login

if (encryptedPass != nil)
{
*perr = PolicyNoError;
didChange = [self _ldapModifyAttribute: @"userPassword"
withValue: encryptedPass
userDN: userDN
password: oldPassword
connection: bindConnection];
if ([bindConnection bindWithMethod: @"simple"
binddn: userDN
credentials: oldPassword])
{
didChange = [self _ldapModifyAttribute: @"userPassword"
withValue: encryptedPass
userDN: userDN
password: oldPassword
connection: bindConnection];
if (didChange)
{
*perr = PolicyNoError;
}
}
}
}

Expand Down

0 comments on commit bdd8e35

Please sign in to comment.