Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function login()
- {
- if($this->_identity===null)
- {
- $this->_identity=new UserIdentity($this->username,$this->password);
- $this->_identity->authenticate();
- }
- if($this->_identity->errorCode===UserIdentity::ERROR_NONE)
- {
- $duration=$this->rememberMe ? 3600*24*30 : 0; // 30 days
- Yii::app()->user->login($this->_identity,$duration);
- $userRecord = new Userrecord; // replace with proper name
- $userRecord->username = $this->username;
- $userRecord->save();
- return true;
- }
- else
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement