webyjh
- webyjh 发布了话题YII框架内的这些文件能否删除
还是自己写循环:P
- webyjh 发布了话题关于asset里的CSS
- webyjh 回复了话题 yii怎么修改密码?登陆后台可以自己修改密码
YII的用户验证一般是通过UserIdentity这个类来实现的
<?php class UserIdentity extends CUserIdentity { private $_id; public function authenticate() { $_identity='guest'; $username=strtolower($this->username);//$this->username为用户输入的用户名 $user=Users::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; if ($user->identity==='admin') { $this->setState('identity', 'admin');//设置用户身份,管理员 }else { $this->setState('identity', 'user');//设置用户身份,普通用户 } $this->errorCode=self::ERROR_NONE; } return $this->errorCode===self::ERROR_NONE; } public function getId() { return $this->_id; } }
3Q,查了下API是修改gridview的template属性
- webyjh 回复了话题 联表查询,看看错误?
还没学到这一块,帮兄弟顶一下