DiscuzX2.5修改密码的页面,根据官方的UCenter修改用户的返回值,是这样子定义的:
1:更新成功
0:没有做任何修改
-1:旧密码不正确
-4:Email 格式有误
-5:Email 不允许注册
-6:该 Email 已经被注册
-7:没有做任何修改
-8:该用户受保护无权限更改
但是到修改密码的窗口,却只是对-1 -4 -5 -6做了判断:
$ucresult = uc_user_edit(addslashes($_G['username']), $_GET['oldpassword'], $_GET['newpassword'], $emailnew != $_G['member']['email'] ? $emailnew : '', $ignorepassword, $_GET['questionidnew'], $_GET['answernew']);
if($ucresult == -1) {
showmessage('profile_passwd_wrong', '', array(), array('return' => true));
} elseif($ucresult == -4) {
showmessage('profile_email_illegal', '', array(), array('return' => true));
} elseif($ucresult == -5) {
showmessage('profile_email_domain_illegal', '', array(), array('return' => true));
} elseif($ucresult == -6) {
showmessage('profile_email_duplicate', '', array(), array('return' => true));
}
也就是其它的返回值就是提示密码修改成功。虽然ignorepassword为假,作为标准是不会出现-8的返回值的。
这个提交的BUG是当UCenter出现故障,例如数据库出现问题查询失败的时候,提示的也是修改成功。这个接口应该在以后的版本里面完善一下,例如对于UCenter的异常均定义为-99。当出现错误的时候,及时的将错误信息反馈给客户端,不然我们这些站长连调试,都没有办法做!
|