浏览代码

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 年之前
父节点
当前提交
88dd3b1a9a
共有 1 个文件被更改,包括 4 次插入1 次删除
  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, // сюда идет возрат данных по найденному пользователю
                         'email.email' => $tmpUser, // сюда идет возрат данных по найденному пользователю
                     ]);
                     ]);
 
 
-                if ($v->validation($_POST)) {
+                if (
+                    $v->validation($_POST)
+                    && 0 === $this->c->bans->banFromName($tmpUser->username)
+                ) {
                     $key  = $this->c->Secury->randomPass(32);
                     $key  = $this->c->Secury->randomPass(32);
                     $hash = $this->c->Secury->hash($tmpUser->id . $key);
                     $hash = $this->c->Secury->hash($tmpUser->id . $key);
                     $link = $this->c->Router->link(
                     $link = $this->c->Router->link(