Use Yii::$app->user->login result in LoginForm

This commit is contained in:
Alexander Makarov 2013-11-16 22:16:10 +04:00
parent 302b25026c
commit abb1a10b89

View File

@ -50,8 +50,7 @@ class LoginForm extends Model
{ {
if ($this->validate()) { if ($this->validate()) {
$user = $this->getUserByUsername($this->username); $user = $this->getUserByUsername($this->username);
Yii::$app->user->login($user, $this->rememberMe ? 3600*24*30 : 0); return Yii::$app->user->login($user, $this->rememberMe ? 3600*24*30 : 0);
return true;
} else { } else {
return false; return false;
} }