From 0271b1d4fc9f8a2058e188adbf5e8c3cfdc1a1cb Mon Sep 17 00:00:00 2001 From: "Igor Barkov (iwork)" Date: Thu, 27 Aug 2020 15:53:01 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D0=B1=D1=80=D0=BE=D1=81=20=D0=BE?= =?UTF-8?q?=D1=88=D0=B8=D0=B1=D0=BE=D0=BA.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- enter.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/enter.php b/enter.php index 7f3b9d2..829f0ed 100644 --- a/enter.php +++ b/enter.php @@ -1,7 +1,10 @@ $val) { //Проверка всех значений массива POST одним махом. $_POST[$key] = iconv(mb_detect_encoding($_POST[$key], 'auto'), 'utf-8', $val); } @@ -15,9 +18,9 @@ if ($username && $password) { $user_query = db::c()->query('SELECT `id`, `login` ,`pass`, `room`, `block` FROM `users` WHERE `login` = "?s"', $username)->fetch_assoc(); if (!$user_query['id']) { - $error = 'Ой! Такого пользователя нет!'; + $error = ERROR_NO_SUCH_USER; } elseif ($user_query['block'] == 1) { - $error = 'Ой! Вы заблокированы!'; + $error = ERROR_USER_IS_BLOCKED; } elseif (password_verify($password, $user_query['pass'])) { if (!$error) { @@ -43,10 +46,10 @@ if ($username && $password) { header("Location: fight.php"); } } else { - throw new Exception('Неверный пароль!'); + $error = ERROR_WRONG_PASSWORD; } } else { - throw new Exception('Вы не ввели логин или пароль!'); + $error = ERROR_EMPTY_CREDENTIALS; } ?> @@ -60,7 +63,7 @@ if ($username && $password) { ← на главную -

+

\ No newline at end of file