public function actionIndex() { $model = new LoginForm(); if (isset($_POST['LoginForm'])) { $model->attributes = $_POST['LoginForm']; $valid = $model->validate(); if ($valid && $model->authenticate()) { $this->inCabinet(); } $this->redirection('/main?error=login', array()); } $this->redirection('/main', array()); }
/** * Authenticates the password. * This is the 'authenticate' validator as declared in rules(). */ public function authenticate($attribute, $params) { parent::authenticate($attribute, $params); }