Browse Source

邮箱找回问题修复

tags/6.2.8
tianya 10 months ago
parent
commit
e8d15f2e7e
4 changed files with 22 additions and 8 deletions
  1. +1
    -1
      src/system/common.inc.php
  2. +2
    -1
      src/user/inc/inc_pwd_functions.php
  3. +3
    -1
      src/user/resetpassword.php
  4. +16
    -5
      src/user/templets/resetpassword.htm

+ 1
- 1
src/system/common.inc.php View File

@@ -7,7 +7,7 @@
* @link https://www.dedebiz.com
*/
//系统默认运行模式为安全模式,模板管理、标签管理、数据库管理、模块管理等功能已暂停,如果您需要这些功能,DEDEBIZ_SAFE_MODE后面值`TRUE`改为`FALSE`恢复使用
define('DEDEBIZ_SAFE_MODE', FALSE);
define('DEDEBIZ_SAFE_MODE', TRUE);
//生产环境使用`production`,如果采用`dev`模式,会有一些php的报错信息提示,用于开发调试
if (!defined('DEDE_ENVIRONMENT')) {
define('DEDE_ENVIRONMENT', 'production');


+ 2
- 1
src/user/inc/inc_pwd_functions.php View File

@@ -116,7 +116,8 @@ function newmail($mid, $userid, $mailto, $type, $send)
function member($mail, $userid)
{
global $db;
$sql = "SELECT mid,email,safequestion FROM `#@__member` WHERE email='$mail' AND userid = '$userid'";
$msql = empty($mail)? "1=1" : "email='$mail'";
$sql = "SELECT mid,email,safequestion FROM `#@__member` WHERE $msql AND userid = '$userid'";
$row = $db->GetOne($sql);
if (!is_array($row)) {
ShowMsg("会员id输入错误", "-1");


+ 3
- 1
src/user/resetpassword.php View File

@@ -18,6 +18,8 @@ if ($dopost == "") {
//验证验证码
if (!isset($vdcode)) $vdcode = '';
$svali = GetCkVdValue();
$type = intval($type);
$mail = HtmlReplace($mail, 0);
if (strtolower($vdcode) != $svali || $svali == '') {
ResetVdValue();
ShowMsg("验证码输入错误", "-1");
@@ -27,7 +29,7 @@ if ($dopost == "") {
if (empty($mail) && empty($userid)) {
showmsg('请输入会员名或邮箱', '-1');
exit;
} else if (!preg_match("#(.*)@(.*)\.(.*)#", $mail)) {
} else if (!empty($mail) && !preg_match("#(.*)@(.*)\.(.*)#", $mail)) {
showmsg('请输入正确的邮箱格式', '-1');
exit;
} else if (CheckUserID($userid, '', false) != 'ok') {


+ 16
- 5
src/user/templets/resetpassword.htm View File

@@ -24,19 +24,19 @@
<label>会员账号</label>
<input type="text" name="userid" id="iptUserid" class="form-control" placeholder="请输入会员账号" required="required">
</div>
<div class="form-group">
<label>邮箱</label>
<input type="text" name="mail" id="iptMail" class="form-control" placeholder="请输入邮箱" required="required">
</div>
<div class="form-group">
<label>找回方式</label>
<div class="input-group">
<select name="type" class="form-control">
<select id="selType" name="type" class="form-control" onchange="handleChange">
<option value="1" selected>通过邮件取回</option>
<option value="2">通过安全问题取回</option>
</select>
</div>
</div>
<div class="form-group" id="mail-box">
<label>邮箱</label>
<input type="text" name="mail" id="iptMail" class="form-control" placeholder="请输入邮箱">
</div>
<div class="form-group">
<label>验证码</label>
<div class="input-group">
@@ -50,5 +50,16 @@
</div>
</main>
<?php obtaintheme('foot.htm');?>
<script>
$(document).ready(function () {
$('#selType').on('change', function() {
if (this.value == 2) {
$("#mail-box").hide();
} else {
$("#mail-box").show();
}
});
});
</script>
</body>
</html>

Loading…
Cancel
Save