java网站整合discuz的若干问题及解决办法(一)

java整合discuz中,同步修改密码的问题时候,discuz端发过来的密码为空的问题:

现象:修改密码时,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);

猜你喜欢

转载自kongcodecenter.iteye.com/blog/1187785