fix(web): allow to change expired password from login page

This commit is contained in:
Francis Lachapelle
2021-05-06 16:35:42 -04:00
parent 8a10ae140d
commit bdd8e3500a
+23 -10
View File
@@ -718,10 +718,15 @@ groupObjectClasses: (NSArray *) newGroupObjectClasses
}
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
{
@@ -740,12 +745,20 @@ groupObjectClasses: (NSArray *) newGroupObjectClasses
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;
}
}
}
}