only update hash if password matches, fixes #1479
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -60,19 +60,20 @@ function validatePasswordLogin($userinfo = null, $password = null, $table = 'pan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for update of hash
|
if ($pwd_hash == $pwd_check) {
|
||||||
if ($update_hash) {
|
|
||||||
$upd_stmt = Database::prepare("
|
// check for update of hash
|
||||||
UPDATE " . $table . " SET `password` = :newpasswd WHERE `" . $uid . "` = :uid
|
if ($update_hash) {
|
||||||
");
|
$upd_stmt = Database::prepare("
|
||||||
$params = array (
|
UPDATE " . $table . " SET `password` = :newpasswd WHERE `" . $uid . "` = :uid
|
||||||
|
");
|
||||||
|
$params = array (
|
||||||
'newpasswd' => makeCryptPassword($password),
|
'newpasswd' => makeCryptPassword($password),
|
||||||
'uid' => $userinfo[$uid]
|
'uid' => $userinfo[$uid]
|
||||||
);
|
);
|
||||||
Database::pexecute($upd_stmt, $params);
|
Database::pexecute($upd_stmt, $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($pwd_hash == $pwd_check) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user