当用户的密码在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));
}
就可以了