25 array(
'username, password',
'required'),
27 array(
'rememberMe',
'boolean'),
29 array(
'password',
'authenticate'),
39 'rememberMe' =>
'Remember me next time',
49 if (!$this->hasErrors()) {
50 $this->_identity =
new UserIdentity($this->username, $this->password);
51 if (!$this->_identity->authenticate())
52 $this->addError(
'password',
'Incorrect username or password.');
62 if ($this->_identity === null) {
63 $this->_identity =
new UserIdentity($this->username, $this->password);
64 $this->_identity->authenticate();
66 if ($this->_identity->errorCode === UserIdentity::ERROR_NONE) {
67 $duration = $this->rememberMe ? 3600 * 24 * 30 : 0;
68 Yii::app()->user->login($this->_identity, $duration);