getUserName(); $additionalAttrs = array(); $rdnAttr = extractRDNAttribute($userDn); $userName = null; if (($rdnAttr === 'uid') || ($rdnAttr === 'uid')) { $userName = extractRDNValue($userDn); } $pwdPolicyResult = checkPasswordStrength($password1, $userName, $additionalAttrs); if ($pwdPolicyResult !== true) { $message = new htmlStatusMessage('ERROR', $pwdPolicyResult); printContent($message); exit(); } // set new password $modifyResult = @ldap_exop_passwd($_SESSION['ldap']->server(), $userDn, $_SESSION['ldap']->getPassword(), $password1); if ($modifyResult === true) { $_SESSION['ldap']->encrypt_login($userDn, $password1); $message = new htmlStatusMessage('INFO', _('Password changed.')); printContent($message, false); exit(); } else { $message = new htmlStatusMessage('ERROR', _('Unable to set password'), getExtendedLDAPErrorMessage($_SESSION['ldap']->server())); printContent($message); exit(); } } printContent($message); /** * Displays the content area * * @param htmlStatusMessage $message status message * @param bool $showPasswordInputs show password input fields */ function printContent($message = null, $showPasswordInputs = true) { include __DIR__ . '/../lib/adminHeader.inc'; echo '