Skip to content

Commit

Permalink
Use ltb-common function to modify password
Browse files Browse the repository at this point in the history
  • Loading branch information
coudot committed Jul 24, 2024
1 parent f072663 commit f692e3b
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions htdocs/resetpassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@
}
}

$entry["userPassword"] = $password;
if ( $pwdreset === "true" ) {
$entry["pwdReset"] = "TRUE";
}

if ( isset($prehook) ) {

if ( !isset($prehook_login_value) ) {
Expand All @@ -77,12 +72,11 @@
if ( $prehook_return > 0 and !$ignore_prehook_return) {
$result = "passwordrefused";
} else {
$modification = ldap_mod_replace($ldap, $dn, $entry);
$errno = ldap_errno($ldap);
if ( $errno ) {
$result = "passwordrefused";
} else {
$reset = ($pwdreset === "true") ? true : false;
if ($directory->modifyPassword($ldap, $dn, $password, $reset)) {
$result = "passwordchanged";
} else {
$result = "passwordrefused";
}
}

Expand Down

0 comments on commit f692e3b

Please sign in to comment.