diff --git a/application/common/library/Auth.php b/application/common/library/Auth.php index f8a92a1c..f3ed90f6 100644 --- a/application/common/library/Auth.php +++ b/application/common/library/Auth.php @@ -221,7 +221,13 @@ class Auth $this->setError('Account is locked'); return false; } + + if ($user->loginfailure >= 10 && time() - $user->loginfailuretime < 86400) { + $this->setError('Please try again after 1 day'); + } + if ($user->password != $this->getEncryptPassword($password, $user->salt)) { + $user->save(['loginfailure' => $user->loginfailure + 1, 'loginfailuretime' => time()]); $this->setError('Password is incorrect'); return false; }