热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

php修改密码为空就是原密码,UCenter修改密码时通知其它应用的密码为空的处理方法YangJunwei...

现象:修改密码时,UCenter通知其它应用的密码为空。解释:UCenter原始程序在修改密码时,其实并没有对密码进行同步传

现象:修改密码时,UCenter通知其它应用的密码为空。

解释:UCenter原始程序在修改密码时,其实并没有对密码进行同步传递,看uc_client源码发现,Discuz! 接收的同步密码也只是随机生成的字符串。可能是为了安全或某种原因!

解决:对UCenter的服务器端(uc_server)程序进行修改,添加密码的同步通知!具体操作如下:

1、UCenter后台更改密码后的通知程序:uc_server\control\admin\user.php,将其中的以下代码:

$_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password=');

修改为:

$_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password='.$orgpassword);

2、UC通知程序:uc_server\control\user.php,将其中的以下代码:

$_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password=');

修改为:

$_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password='.$newpw);

另外,如果是在应用里修改密码,而应用程序使用独立用户数据库,则需要修改ucenter客户端(uc_client)的相应代码:

打开 uc_client\control\user.php 查找

$_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password=');

修改为:

$_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password='.$newpw);



推荐阅读
author-avatar
白羊蓝色雨线
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有