Merge pull request #14540 from army1349/master
LDAP Password Modify Extended Operation support
This commit is contained in:
commit
c00d6f4eac
2 changed files with 14 additions and 1 deletions
|
@ -366,7 +366,9 @@ class Access extends LDAPUtility {
|
|||
return false;
|
||||
}
|
||||
try {
|
||||
return @$this->invokeLDAPMethod('modReplace', $cr, $userDN, $password);
|
||||
// try PASSWD extended operation first
|
||||
return @$this->invokeLDAPMethod('exopPasswd', $cr, $userDN, '', $password) ||
|
||||
@$this->invokeLDAPMethod('modReplace', $cr, $userDN, $password);
|
||||
} catch(ConstraintViolationException $e) {
|
||||
throw new HintException('Password change rejected.', \OC::$server->getL10N('user_ldap')->t('Password change rejected. Hint: ').$e->getMessage(), $e->getCode());
|
||||
}
|
||||
|
|
|
@ -219,6 +219,17 @@ class LDAP implements ILDAPWrapper {
|
|||
return $this->invokeLDAPMethod('mod_replace', $link, $userDN, array('userPassword' => $password));
|
||||
}
|
||||
|
||||
/**
|
||||
* @param LDAP $link
|
||||
* @param string $userDN
|
||||
* @param string $oldPassword
|
||||
* @param string $password
|
||||
* @return bool
|
||||
*/
|
||||
public function exopPasswd($link, $userDN, $oldPassword, $password) {
|
||||
return $this->invokeLDAPMethod('exop_passwd', $link, $userDN, $oldPassword, $password);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param LDAP $link
|
||||
* @param string $option
|
||||
|
|
Loading…
Reference in a new issue