Fix password change code

This commit is contained in:
Thomas Hooge 2023-02-23 12:30:11 +01:00
parent cb7f8ef649
commit 7d6450706f
1 changed files with 3 additions and 2 deletions

View File

@ -953,12 +953,13 @@ if (isset($_POST['edit'])) {
$user = $db->db_select($query);
if(!strcmp(md5($user_currentpass), $user[0]['user_pass'])) {
if (password_verify($user_currentpass, $user[0]['user_pass'])) {
if(!strcmp($user_newpass1, $user_newpass2)) {
$newhash = password_hash($user_newpass1, PASSWORD_BCRYPT);
$query = "UPDATE
user
SET
user_pass='" . md5($user_newpass1) . "'
user_pass='" . $newhash . "'
WHERE
user_id=" . $user_id;