Мигрирована логика блокировки аккаунтов

This commit is contained in:
ErickSkrauch
2016-08-22 00:09:14 +03:00
parent b57b015f66
commit 72a7f743be
5 changed files with 22 additions and 7 deletions

View File

@ -55,7 +55,11 @@ class LoginForm extends ApiForm {
// TODO: проверить, не заблокирован ли аккаунт
if (!$this->hasErrors()) {
$account = $this->getAccount();
if ($account->status !== Account::STATUS_ACTIVE) {
if ($account->status === Account::STATUS_BANNED) {
$this->addError($attribute, E::ACCOUNT_BANNED);
}
if ($account->status === Account::STATUS_REGISTERED) {
$this->addError($attribute, E::ACCOUNT_NOT_ACTIVATED);
}
}