Добавлена возможность перехешировать пароль по запросу.
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) {
|
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();
|
$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']) {
|
if ($data['id']) {
|
||||||
db::c()->query('UPDATE `users` SET `pass` = "?s" WHERE `login` = "?s"', $username_upd, password_hash($password_upd, PASSWORD_DEFAULT));
|
db::c()->query('UPDATE `users` SET `pass` = "?s" WHERE `login` = "?s"', password_hash($password_upd, PASSWORD_DEFAULT), $username_upd);
|
||||||
echo '<span class="greenalert">Пароль обновлён!</span>';
|
echo "Успешно!";
|
||||||
|
header("Location: index.php");
|
||||||
} else {
|
} else {
|
||||||
echo '<span class="redalert">Ошибка!</span>';
|
echo '<span class="redalert">Ошибка!</span>';
|
||||||
|
header("Location: index.php");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user