Yii2 without email confirmation user can't login
<p>When user sign up, system send a confirmation email to user its work good but without any email confirmation system automatic login or user can login. How can i solve this, that user should confirm email before login and if user not confirmed an email user can't be login?</p>

<p>i am using <a href="https://github.com/DezMonT765/yii2-advanced-template-rbac" rel="nofollow">this project: 
Yii 2 Advanced Template With Rbac User Managment </a></p>

<p>my LoginForm model code</p>

<pre><code>namespace common\models;
use Yii;
use yii\base\Model;

/**
 * Login form
 */

class LoginForm extends Model
{
public $email;
public $password;
public $rememberMe = true;

protected  $_user = false;


/**
 * @inheritdoc
 */
public function rules()
{
    return [
        // username and password are both required
        ['email', 'filter', 'filter' =&gt; 'trim'],
        [['email','password'], 'required'],
        ['email', 'email'],
        // rememberMe must be a boolean value
        ['rememberMe', 'boolean'],
        // password is validated by validatePassword()
        ['password', 'validatePassword','skipOnEmpty'=&gt;false],
    ];
}

/**
 * Validates the password.
 * This method serves as the inline validation for password.
 *
 * @param string $attribute the attribute currently being validated
 * @param array $params the additional name-value pairs given in the rule
 */
public function validatePassword($attribute, $params)
{
    if (!$this-&gt;hasErrors()) {
        $user = $this-&gt;getUser();
        if (!$user || !$user-&gt;validatePassword($this-&gt;$attribute)) {
            $this-&gt;addError('email', Yii::t('messages','Incorrect password or email.'));
            $this-&gt;addError('password', Yii::t('messages','Incorrect password or email.'));
        }
    }
}

/**
 * Logs in a user using the provided username and password.
 *
 * @return boolean whether the user is logged in successfully
 */
public function login()
{
    if ($this-&gt;validate()) {
        return Yii::$app-&gt;user-&gt;login($this-&gt;getUser(), $this-&gt;rememberMe ? 3600 * 24 * 30 : 0);
    } else {
        return false;
    }
}

/**
 * Finds user by [[username]]
 *
 * @return User|null
 */
public function getUser()
{
    if ($this-&gt;_user === false) {
        $this-&gt;_user = User::findByEmail($this-&gt;email);
    }

    return $this-&gt;_user;
}

public function attributeLabels()
{
    return [
        'email' =&gt; Yii::t('app','Email'),
        'password' =&gt; Yii::t('app','Password')
    ];
}
}
</code></pre>