Update Page\Auth

Prohibit send an email to password recovery for banned users.
Added validation by username here, since the form is validated only by email.
This commit is contained in:
Visman 2021-02-16 19:16:41 +07:00
parent 0fbeb59eea
commit 88dd3b1a9a

View file

@ -246,7 +246,10 @@ class Auth extends Page
'email.email' => $tmpUser, // сюда идет возрат данных по найденному пользователю
]);
if ($v->validation($_POST)) {
if (
$v->validation($_POST)
&& 0 === $this->c->bans->banFromName($tmpUser->username)
) {
$key = $this->c->Secury->randomPass(32);
$hash = $this->c->Secury->hash($tmpUser->id . $key);
$link = $this->c->Router->link(