Warning: Use of undefined constant hot - assumed 'hot' (this will throw an Error in a future version of PHP) in /data/wwwroot/lxy.me/wp-content/themes/Ality/inc/sticky-cat.php on line 5


Yii实现无密码自动登录

Yii实现无密码自动登录
在UserIdentity中添加如下方法 [php] public static function createAuthenticatedIdentity($user) { $identity=new self($user->id,''); $identity->_name = $user->username; $identity->_id = $user->id; $identity->setState('userInfo', $user); $identity->errorCode=self::ERROR_NONE; return $identity; } [/php] 用法: [php] Yii::app()->user->login(UserIdentity::cre...