安哥网络 发表于 2013-2-22 10:13:57

第三方应用整合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);本文摘自:http://www.nuodou.com/a/595.html




页: [1]
查看完整版本: 第三方应用整合UCenter会员密码同步