diff --git a/classes/User.php b/classes/User.php index 2088b62..b82e2ec 100644 --- a/classes/User.php +++ b/classes/User.php @@ -4,6 +4,7 @@ class User { public $id = 0; public $login = 'Некто'; + public $pass; public $email = 'неизвестно'; public $realname; public $borndate; diff --git a/user_anketa.php b/user_anketa.php index c9852fc..bbcd427 100644 --- a/user_anketa.php +++ b/user_anketa.php @@ -46,13 +46,13 @@ if ($name || $color || $hobbie) { err('Максимальная длинна поля Хобби: ' . INFO_CHAR_LIMIT . ' символов!'); } else { $values = ['realname' => $name, 'color' => $color, 'info' => $hobbie]; - $db->query('UPDATE users SET ?As WHERE id = ?i', $values, $user['id']); + $db->query('UPDATE users SET ?As WHERE id = ?i', $values, $user->id); } } if ($oldpsw && $newpsw) { - if (password_verify($oldpsw, $user['pass'])) { - db::c()->query('UPDATE `users` SET `pass` = "?s" WHERE `id` = ?i', password_hash($newpsw, PASSWORD_DEFAULT), $user['id']); + if (password_verify($oldpsw, $user->pass)) { + db::c()->query('UPDATE `users` SET `pass` = "?s" WHERE `id` = ?i', password_hash($newpsw, PASSWORD_DEFAULT), $user->id); } else { err('Неверный текущий пароль!'); } @@ -67,15 +67,15 @@ if ($oldpsw && $newpsw) {
← на главную -