解决方法DEDE通过UCenter通信后,找回密码的功能失败了
DEDE通过UCenter通信后,找回密码的功能失败了,dede与ucenter通信后如何找回密码呢,下面的方法能够完美解决 DEDE 找回密码同步修改UC,5.5、5.6、5.7都有该问题。
解决办法:
增加UC同步代码
#api{{
if(defined('UC_API') && @include_once DEDEROOT.'/uc_client/client.php')
{
$row1 = $db->GetOne("Select * From dede_member where mid = '$mid'");
$ucresult = uc_user_edit($row1['userid'], '', $pwdok, '', 1);
}
#/aip}}
具体操作:
打开/member/resetpassword.php
在134-145行的代码
复制代码
if($pwd == $pwdok)
{
$pwdok = md5($pwdok);
$sql = "DELETE FROM `dede_pwd_tmp` WHERE `mid` = '$id';";
$db->executenonequery($sql);
$sql = "UPDATE `dede_member` SET `pwd` = '$pwdok' WHERE `mid` = '$id';";
if($db->executenonequery($sql))
{
showmsg('更改密码成功,请牢记新密码', 'login.php');
exit;
}
}
修改为:
复制代码
if($pwd == $pwdok)
{
#api{{
if(defined('UC_API') && @include_once DEDEROOT.'/uc_client/client.php')
{
$row1 = $db->GetOne("Select * From dede_member where mid = '$mid'");
$ucresult = uc_user_edit($row1['userid'], '', $pwdok, '', 1);
}
#/aip}}
$pwdok = md5($pwdok);
$sql = "DELETE FROM `dede_pwd_tmp` WHERE `mid` = '$id';";
$db->executenonequery($sql);
$sql = "UPDATE `dede_member` SET `pwd` = '$pwdok' WHERE `mid` = '$id';";
if($db->executenonequery($sql))
{
showmsg('更改密码成功,请牢记新密码', 'login.php');
exit;
}
}
通过以上方法,能否解决UCenter通信后,找回密码失败的问题