diff --git a/src/includes/class/class.LSldap.php b/src/includes/class/class.LSldap.php index 31c84627..6dbd8216 100644 --- a/src/includes/class/class.LSldap.php +++ b/src/includes/class/class.LSldap.php @@ -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