联系方式

站长:
联系人:赵先生
手机:18183869808

QQ 64816414
保健茶:

联系人:罗小姐

电话:15368244381

QQ 834856496

导入discuz的16位密码解决方案
发布者:zaq 类型:杂器快贴 发布时间:2018-10-23 1:25:22 浏览:4081次 [回复]

1.旧论坛的16位md5加密,是没有可能转为32位的,因此只能改造discuz的代码了
2.1需要修改的页面是logging.php,目的是让16位的密码也能通过认证,php中的16位密码获取方法substr(md5($password),8,16)
要更改的代码是
a.$discuz_user = $discuz_pw = $discuz_secques = $md5_password = $md5_password16 = '';
b.list($username, $md5_password) = daddslashes(explode("\t", authcode($loginauth, 'DECODE')), 1);
c.list($username, $md5_password16) = daddslashes(explode("\t", authcode($loginauth, 'DECODE')), 1);
d.$md5_password = md5($password);
e.$md5_password16 = substr(md5($password),8,16);
f.if($member['discuz_uid'] && ($member['discuz_pw'] == $md5_password)||($member['discuz_pw'] == $md5_password16))
3.需要修改的页面是memcp.php
要更改的代码是
a.if($newpassword || $secquesnew != $discuz_secques) {
if(md5($oldpassword)!= $discuz_pw) {
if(substr(md5($oldpassword),8,16)!= $discuz_pw){
showmessage('profile_passwd_wrong', NULL, 'HALTED');
}
}
}
b. if((md5($oldpassword)!=$discuz_pw) && !$passport_status)
{
if((substr(md5($oldpassword),8,16)!=$discuz_pw) && !$passport_status){
showmessage('profile_passwd_wrong', NULL, 'HALTED');
}
else{
$emailnew = $passport_status ? $member['email'] : $emailnew;
$accessexp = '/('.str_replace("\r\n", '|', preg_quote($accessemail, '/')).')$/i';
$censorexp = '/('.str_replace("\r\n", '|', preg_quote($censoremail, '/')).')$/i';
$invalidemail = $accessemail ? !preg_match($accessexp, $emailnew) : $censoremail && preg_match($censorexp, $emailnew);
if(!isemail($emailnew) || $invalidemail) {
showmessage('profile_email_illegal');
}
}
} else {
$emailnew = $passport_status ? $member['email'] : $emailnew;
$accessexp = '/('.str_replace("\r\n", '|', preg_quote($accessemail, '/')).')$/i';
$censorexp = '/('.str_replace("\r\n", '|', preg_quote($censoremail, '/')).')$/i';
$invalidemail = $accessemail ? !preg_match($accessexp, $emailnew) : $censoremail && preg_match($censorexp, $emailnew);
if(!isemail($emailnew) || $invalidemail) {
showmessage('profile_email_illegal');
}
}

4.如有疑问可以大家一起讨论解决
5.如果你有老论坛要导数据的,本人愿意帮忙

  QQ:64816414


源地址:http://www.zaqi.net/word_view.asp?files_id=1191
上一篇:Discuz!论坛常见数据库问题分析及解决方案
下一篇:不爱我你就早点告诉我
零售:¥80元
批发:¥76元
特价:¥20元
零售:¥25元
批发:¥18元
零售:¥50元
批发:¥35元
杂器网络版权所有  免责声明