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));
|
$ctrlRequest = array(array('oid' => LDAP_CONTROL_PASSWORDPOLICYREQUEST));
|
||||||
$r = ldap_mod_replace_ext($ldap, $dn, $changes, $ctrlRequest);
|
$r = ldap_mod_replace_ext($ldap, $dn, $changes, $ctrlRequest);
|
||||||
if ($r && ldap_parse_result($ldap, $r, $errcode, $matcheddn, $errmsg, $ref, $ctrlResponse)) {
|
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(
|
self :: fireEvent(
|
||||||
'user_password_update_failure',
|
'user_password_update_failure',
|
||||||
array(
|
array(
|
||||||
'object_type' => $object_type, 'dn' => $dn,
|
'object_type' => $object_type, 'dn' => $dn,
|
||||||
'error' => $ppolicyErrorMsg[
|
'error' => $error,
|
||||||
$ctrlResponse[LDAP_CONTROL_PASSWORDPOLICYRESPONSE]['value']['error']
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
LSerror :: addErrorCode(
|
LSerror :: addErrorCode('LSldap_10', $error);
|
||||||
'LSldap_10',
|
|
||||||
$ppolicyErrorMsg[$ctrlResponse[LDAP_CONTROL_PASSWORDPOLICYRESPONSE]['value']['error']]
|
|
||||||
);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Password updated
|
// Password updated
|
||||||
|
|
Loading…
Reference in a new issue