一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

Discuz!升级后找回密码提示参数错误解决的二种办法

时间:2015-04-26 编辑:简简单单 来源:一聚教程网

方法一


找回密码功能,通过邮箱里的链接回跳,重新设置密码后提交会提示:“参数错误”;



解决方法如下:

打开
source\module\member\member_getpasswd.php
第32行找到
$uid = $_GET['uid'];
在下方添加一行
$sign = $_GET['sign'];
打开discuz模板文件:template\default\member\getpasswd.htm
找到第8行
  


修改为:
  


方法二

直接替换member_getpasswd.php文件代码

fetch($_GET['uid']), $member);
    list($dateline, $operation, $idstring) = explode("\t", $member['authstr']);
    if($dateline < TIMESTAMP - 86400 * 3 || $operation != 1 || $idstring != $_GET['id']) {
        showmessage('getpasswd_illegal', NULL);
    }
    if(!submitcheck('getpwsubmit') || $_GET['newpasswd1'] != $_GET['newpasswd2']) {
        $hashid = $_GET['id'];
        $uid = $_GET['uid'];
        include template('member/getpasswd');
    } else {
        if($_GET['newpasswd1'] != addslashes($_GET['newpasswd1'])) {
            showmessage('profile_passwd_illegal');
        }
        if($_G['setting']['pwlength']) {
            if(strlen($_GET['newpasswd1']) < $_G['setting']['pwlength']) {
                showmessage('profile_password_tooshort', '', array('pwlength' => $_G['setting']['pwlength']));
            }
        }
        if($_G['setting']['strongpw']) {
            $strongpw_str = array();
            if(in_array(1, $_G['setting']['strongpw']) && !preg_match("/\d+/", $_GET['newpasswd1'])) {
                $strongpw_str[] = lang('member/template', 'strongpw_1');
            }
            if(in_array(2, $_G['setting']['strongpw']) && !preg_match("/[a-z]+/", $_GET['newpasswd1'])) {
                $strongpw_str[] = lang('member/template', 'strongpw_2');
            }
            if(in_array(3, $_G['setting']['strongpw']) && !preg_match("/[A-Z]+/", $_GET['newpasswd1'])) {
                $strongpw_str[] = lang('member/template', 'strongpw_3');
            }
            if(in_array(4, $_G['setting']['strongpw']) && !preg_match("/[^a-zA-z0-9]+/", $_GET['newpasswd1'])) {
                $strongpw_str[] = lang('member/template', 'strongpw_4');
            }
            if($strongpw_str) {
                showmessage(lang('member/template', 'password_weak').implode(',', $strongpw_str));
            }
        }
        loaducenter();
        uc_user_edit(addslashes($member['username']), $_GET['newpasswd1'], $_GET['newpasswd1'], addslashes($member['email']), 1, 0);
        $password = md5(random(10));
        if(isset($member['_inarchive'])) {
            C::t('common_member_archive')->move_to_master($member['uid']);
        }
        C::t('common_member')->update($_GET['uid'], array('password' => $password));
        C::t('common_member_field_forum')->update($_GET['uid'], array('authstr' => ''));
        showmessage('getpasswd_succeed', 'index.php', array(), array('login' => 1));
    }
} else {
    showmessage('parameters_error');
}
?>

热门栏目