class UserIdentity extends CUserIdentity { private $_id; public function authenticate() { $username = strtolower($this->username); $user = User::model()->find('LOWER(username)=?', array($username)); if($user===null) $this->errorCode=self::ERROR_USERNAME_INVALID; else if(!$user->validatePassword($this->password)) $this->errorCode = self::ERROR_PASSWORD_INVALID; else { $this->_id = $user->id; $this->username = $user->username; $this->errorCode = self::ERROR_NONE; } return $this->errorCode == self::ERROR_NONE; } public function getId() { return $this->_id; } }The above code works retrieved from the user table and match the username and password have been inputted by the user. Surely that would be matched password is the password that has been encrypted. If the username and password that matches the user inputted username and password exist in the database, the user is logged in successfully.
Okay, we have finished making the menu register, login, and logout. Logout menu is available directly from Yii and do not need to be modified again. Please try these actions!
Sands Casino Resort Atlantic City | $400 Welcome Bonus
ReplyDeleteSign up at Sands Casino septcasino Resort, play your 제왕카지노 favorite online slots, and hit jackpots in our newly remodeled 온카지노 resort. Book your room today.