Browse Source

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.
Visman 4 years ago
parent
commit
88dd3b1a9a
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app/Models/Pages/Auth.php

+ 4 - 1
app/Models/Pages/Auth.php

@@ -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(