phpcms开启ucenter后的各种bug

来源:互联网 发布:c语言培训班多少钱 编辑:程序博客网 时间:2024/05/21 10:18

当用户的密码在ucenter中更改后,phpcms用新密码无法登陆,用旧密码可以登陆的bug


找到phpsso_server/phpcms/modules/phpsso/index.php


里的login 函数


找到下面这一段

if($uid == -1) {//uc不存在该用户,调用注册接口注册用户
$uid = uc_user_register($this->username , $this->password, $userinfo['email'], $userinfo['random']);
if($uid >0) {
$this->db->update(array('ucuserid'=>$uid), array('username'=>$this->username));
}
}


增加几个判断

if($uid == -1) {//uc不存在该用户,调用注册接口注册用户
$uid = uc_user_register($this->username , $this->password, $userinfo['email'], $userinfo['random']);
if($uid >0) {
$this->db->update(array('ucuserid'=>$uid), array('username'=>$this->username));
}
}elseif($uid==-2){//uc返回密码错误
exit('-2');
}elseif($uid==-3){
exit('-3');
}else{
exit(serialize($userinfo));
}


就可以了