mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-18 00:09:06 +01:00
LSldap::updateUserPassword(): fix handling non-ppolicy errors
This commit is contained in:
parent
0e705852af
commit
4057300ba0
1 changed files with 10 additions and 8 deletions
|
@ -849,20 +849,22 @@ class LSldap extends LSlog_staticLoggerClass {
|
|||
$ctrlRequest = array(array('oid' => LDAP_CONTROL_PASSWORDPOLICYREQUEST));
|
||||
$r = ldap_mod_replace_ext($ldap, $dn, $changes, $ctrlRequest);
|
||||
if ($r && ldap_parse_result($ldap, $r, $errcode, $matcheddn, $errmsg, $ref, $ctrlResponse)) {
|
||||
if ($errcode !== 0 && isset($ctrlResponse[LDAP_CONTROL_PASSWORDPOLICYRESPONSE])) {
|
||||
if ($errcode !== 0) {
|
||||
$error = (
|
||||
isset($ctrlResponse[LDAP_CONTROL_PASSWORDPOLICYRESPONSE])?
|
||||
$ppolicyErrorMsg[
|
||||
$ctrlResponse[LDAP_CONTROL_PASSWORDPOLICYRESPONSE]['value']['error']
|
||||
]:
|
||||
_("Unknown error")
|
||||
);
|
||||
self :: fireEvent(
|
||||
'user_password_update_failure',
|
||||
array(
|
||||
'object_type' => $object_type, 'dn' => $dn,
|
||||
'error' => $ppolicyErrorMsg[
|
||||
$ctrlResponse[LDAP_CONTROL_PASSWORDPOLICYRESPONSE]['value']['error']
|
||||
]
|
||||
'error' => $error,
|
||||
)
|
||||
);
|
||||
LSerror :: addErrorCode(
|
||||
'LSldap_10',
|
||||
$ppolicyErrorMsg[$ctrlResponse[LDAP_CONTROL_PASSWORDPOLICYRESPONSE]['value']['error']]
|
||||
);
|
||||
LSerror :: addErrorCode('LSldap_10', $error);
|
||||
return false;
|
||||
}
|
||||
// Password updated
|
||||
|
|
Loading…
Reference in a new issue