Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

用户修改密码判断不严谨

[复制链接]
smallqiang 发表于 2012-8-27 17:20:41 | 显示全部楼层 |阅读模式
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。当出现错误的时候,及时的将错误信息反馈给客户端,不然我们这些站长连调试,都没有办法做!
mark35 发表于 2012-8-27 19:12:17 | 显示全部楼层
应该是ucenter1.6版本未升级的缘故吧。X2.5是后出来的
回复

使用道具 举报

m.king 发表于 2012-8-28 15:40:17 | 显示全部楼层
感谢您的反馈,该问题我们再研究下。
回复

使用道具 举报

m.king 发表于 2012-8-28 16:28:59 | 显示全部楼层
这个是会员自己修改密码, 后台修改密码和那个有差别的,提示的信息全.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2025-2-27 17:30 , Processed in 0.027634 second(s), 3 queries , Gzip On, Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表