六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 923|回复: 0

第三方应用整合UCenter会员密码同步

[复制链接]
 楼主| 发表于 2013-2-22 10:13:57 | 显示全部楼层 |阅读模式
现象:修改密码时,UCenter通知其它应用的密码为空。
解释:UCenter原始程序在修改密码时,其实并没有对密码进行同步传递,看uc_client源码发现,Discuz! 接收的同步密码也只是随机生成的字符串。可能是为了安全或某种原因!
解决:对UCenter的服务器端(uc_server)程序进行修改,添加密码的同步通知!具体操作如下:
1、UCenter后台更改密码后的通知程序:uc_server\control\admin\user.php,将其中的以下代码:
  1.     $_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password=');

  2.     修改为:

  3.     $_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password='.$orgpassword);
复制代码
2、UC通知程序:uc_server\control\user.php,将其中的以下代码:
  1.     $_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password=');

  2.     修改为:

  3.     $_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password='.$newpw);
复制代码
另外,如果是在应用里修改密码,而应用程序使用独立用户数据库,则需要修改ucenter客户端(uc_client)的相应代码:打开 uc_client\control\user.php 查找
  1.     $_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password=');

  2.     修改为:

  3.     $_ENV['note']->add('updatepw', 'username='.urlencode($username).'&password='.$newpw);
复制代码
本文摘自:http://www.nuodou.com/a/595.html




该会员没有填写今日想说内容.
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

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