加州大学论坛 UCBBS.org

 找回密码
 注册Register(需身份验证,用Paylal或支付宝获取邀请码或向会员索取)

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 2722|回复: 0
打印 上一主题 下一主题

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

[复制链接]
跳转到指定楼层
楼主
发表于 2015-7-8 09:43:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
解决方法如下:
打开
source\module\member\member_getpasswd.php
第32行找到
$uid = $_GET['uid'];
在下方添加一行
$sign = $_GET['sign'];
打开discuz模板文件:template\default\member\getpasswd.htm
找到第8行
   <form method="post" autocomplete="off" action="member.php?mod=getpasswd&uid=$uid&id=$hashid">
修改为:
   <form method="post" autocomplete="off" action="member.php?mod=getpasswd&uid=$uid&id=$hashid&sign=$sign">

方法二
直接替换member_getpasswd.php文件代码
<?php
/**
*      [Discuz!] (C)2001-2099 Comsenz Inc.
*      This is NOT a freeware, use is subject to license terms
*
*      $Id: member_getpasswd.php 32853 2013-03-15 02:10:51Z liulanbo $
*/
if(!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
define('NOROBOT', TRUE);
if($_GET['uid'] && $_GET['id']) {
    $discuz_action = 141;
    $member = getuserbyuid($_GET['uid'], 1);
    $table_ext = isset($member['_inarchive']) ? '_archive' : '';
    $member = array_merge(C::t('common_member_field_forum'.$table_ext)->fetch($_GET['uid']), $member);
    list($dateline, $operation, $idstring) = <a href="/tags.php/explode/" target="_blank">explode</a>("\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'];
        <a href="/tags.php/include/" target="_blank">include</a> 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']) && !<a href="/tags.php/preg_match/" target="_blank">preg_match</a>("/\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');
}
?>


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友 微信微信
收藏收藏
加州大学论坛',www.ucbbs.org,欢迎您! 服务于美国西海岸加州地区著名大学,为海外和内地中国留学生,博士后,学者及社区华人提供房屋出租、租房等生活信息和沟通交流的平台.
回复

使用道具 举报

本版积分规则

赞助捐赠、广告合作请联系我们 support@ucbbs.org  , 谢谢您的支持!

Contact us 联系我们|Darkroom|手机版|Archiver|加州大学论坛 UCBBS.ORG (Universities in California Bulletin Board System)

GMT-8, 2024-4-25 14:51 , Processed in 1.031683 second(s), 30 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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