Добавлена возможность перехешировать пароль по запросу.
This commit is contained in:
parent
c1bafc1f77
commit
e5cfec57b4
@ -65,10 +65,12 @@ $password_upd = filter_input(INPUT_POST, 'password_upd');
|
||||
if ($username_upd && $password_upd) {
|
||||
$data = db::c()->query('SELECT `id`, `login` ,`pass`, `room`, `block` FROM `users` WHERE `login` = "?s" AND `pass` = "?s"', $username_upd, md5($password_upd))->fetch_assoc();
|
||||
if ($data['id']) {
|
||||
db::c()->query('UPDATE `users` SET `pass` = "?s" WHERE `login` = "?s"', $username_upd, password_hash($password_upd, PASSWORD_DEFAULT));
|
||||
echo '<span class="greenalert">Пароль обновлён!</span>';
|
||||
db::c()->query('UPDATE `users` SET `pass` = "?s" WHERE `login` = "?s"', password_hash($password_upd, PASSWORD_DEFAULT), $username_upd);
|
||||
echo "Успешно!";
|
||||
header("Location: index.php");
|
||||
} else {
|
||||
echo '<span class="redalert">Ошибка!</span>';
|
||||
header("Location: index.php");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user