Authentication and Authorization check if a user is logged in or not via CWebUser::isGuest check if the user can perform specific operations by calling CWebUser::checkAccess The main work in defining an identity class is the implementation of the IUserIdentity::authenticate method class UserIdentity extends CUserIdentity { private $_id; public function authenticate() { $record=User::model()->findByAttributes(array('username'=>$this->username)); if($record===null) $this->errorCode=self::ERROR_USERNAME_INVALID; else if($record->password!==crypt($this->password,$record->password)) $this->errorCode=self::ERROR_PASSWORD_INVALID; else { ...
OOP,PHP,Web Development,MYSQL,Yii,Bootstrap...Blog.