浏览代码

修正登录提示div盒子错误

tags/6.0.4^2
xushubieli 3 年前
父节点
当前提交
91ee133802
共有 4 个文件被更改,包括 13 次插入23 次删除
  1. +1
    -1
      src/dede/css/codemirror.css
  2. +8
    -18
      src/dede/login.php
  3. +1
    -1
      src/dede/templets/index_body.htm
  4. +3
    -3
      src/dede/templets/login.htm

+ 1
- 1
src/dede/css/codemirror.css 查看文件

@@ -1,6 +1,6 @@
.CodeMirror { .CodeMirror {
font-family:monospace; font-family:monospace;
height:460px;
height:450px;
color:black color:black
} }
.CodeMirror-lines { .CodeMirror-lines {


+ 8
- 18
src/dede/login.php 查看文件

@@ -1,5 +1,4 @@
<?php <?php
/** /**
* 后台登录 * 后台登录
* *
@@ -13,9 +12,7 @@ require_once(dirname(__FILE__) . '/../include/common.inc.php');
require_once(DEDEINC . '/userlogin.class.php'); require_once(DEDEINC . '/userlogin.class.php');
if (empty($dopost)) $dopost = ''; if (empty($dopost)) $dopost = '';
if (empty($gotopage)) $gotopage = ''; if (empty($gotopage)) $gotopage = '';
$gotopage = RemoveXSS($gotopage); $gotopage = RemoveXSS($gotopage);
//检测安装目录安全性 //检测安装目录安全性
if (is_dir(dirname(__FILE__) . '/../install')) { if (is_dir(dirname(__FILE__) . '/../install')) {
if (!file_exists(dirname(__FILE__) . '/../install/install_lock.txt')) { if (!file_exists(dirname(__FILE__) . '/../install/install_lock.txt')) {
@@ -37,18 +34,15 @@ if (is_dir(dirname(__FILE__) . '/../install')) {
fclose($fp); fclose($fp);
} }
} }
//更新服务器 //更新服务器
require_once(DEDEDATA . '/admin/config_update.php'); require_once(DEDEDATA . '/admin/config_update.php');
//检测后台目录是否更名 //检测后台目录是否更名
$cururl = GetCurUrl(); $cururl = GetCurUrl();
if (preg_match('/dede\/login/i', $cururl)) { if (preg_match('/dede\/login/i', $cururl)) {
$redmsg = '<div class=\'safe-tips\'>您的管理目录的名称中包含默认名称dede,建议在FTP里把它修改为其它名称,那样会更安全!</div>';
$redmsg = '<div class="alert alert-warning" role="alert"><div class=\"safe-tips\">您的管理目录的名称中包含默认名称dede,建议在FTP里把它修改为其它名称,那样会更安全!</div></div>';
} else { } else {
$redmsg = ''; $redmsg = '';
} }
//登录检测 //登录检测
$admindirs = explode('/', str_replace("\\", '/', dirname(__FILE__))); $admindirs = explode('/', str_replace("\\", '/', dirname(__FILE__)));
$admindir = $admindirs[count($admindirs) - 1]; $admindir = $admindirs[count($admindirs) - 1];
@@ -57,44 +51,40 @@ if ($dopost == 'login') {
$svali = strtolower(GetCkVdValue()); $svali = strtolower(GetCkVdValue());
if (($validate == '' || $validate != $svali) && preg_match("/6/", $safe_gdopen)) { if (($validate == '' || $validate != $svali) && preg_match("/6/", $safe_gdopen)) {
ResetVdValue(); ResetVdValue();
ShowMsg('验证码不正确!', 'login.php', 0, 1000);
ShowMsg('验证码不正确', 'login.php', 0, 1000);
exit; exit;
} else { } else {
$cuserLogin = new userLogin($admindir); $cuserLogin = new userLogin($admindir);
if (!empty($userid) && !empty($pwd)) { if (!empty($userid) && !empty($pwd)) {
$res = $cuserLogin->checkUser($userid, $pwd); $res = $cuserLogin->checkUser($userid, $pwd);
//success //success
if ($res == 1) { if ($res == 1) {
$cuserLogin->keepUser(); $cuserLogin->keepUser();
if (!empty($gotopage)) { if (!empty($gotopage)) {
ShowMsg('成功登录,正在转向管理管理主页', $gotopage);
ShowMsg('成功登录,正在转向管理管理主页', $gotopage);
exit(); exit();
} else { } else {
ShowMsg('成功登录,正在转向管理管理主页', "index.php");
ShowMsg('成功登录,正在转向管理管理主页', "index.php");
exit(); exit();
} }
} }
//error //error
else if ($res == -1) { else if ($res == -1) {
ResetVdValue(); ResetVdValue();
ShowMsg('你的用户名不存在!', 'login.php', 0, 1000);
ShowMsg('你的用户名不存在', 'login.php', 0, 1000);
exit; exit;
} else { } else {
ResetVdValue(); ResetVdValue();
ShowMsg('你的密码错误!', 'login.php', 0, 1000);
ShowMsg('你的密码错误', 'login.php', 0, 1000);
exit; exit;
} }
} }
//password empty //password empty
else { else {
ResetVdValue(); ResetVdValue();
ShowMsg('用户和密码没填写完整!', 'login.php', 0, 1000);
ShowMsg('用户和密码没填写完整', 'login.php', 0, 1000);
exit; exit;
} }
} }
} }
include('templets/login.htm');
include('templets/login.htm');

+ 1
- 1
src/dede/templets/index_body.htm 查看文件

@@ -3,7 +3,7 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
<title>系统概况</title> <title>系统概况</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<base target="_self"> <base target="_self">
<link rel="stylesheet" href="../static/css/bootstrap.min.css"> <link rel="stylesheet" href="../static/css/bootstrap.min.css">
<link rel="stylesheet" href="../static/font-awesome/css/font-awesome.min.css"> <link rel="stylesheet" href="../static/font-awesome/css/font-awesome.min.css">


+ 3
- 3
src/dede/templets/login.htm 查看文件

@@ -3,7 +3,7 @@
<head> <head>
<meta charset="<?php echo $cfg_soft_lang; ?>"> <meta charset="<?php echo $cfg_soft_lang; ?>">
<meta name="robots" content="noindex,nofollow"> <meta name="robots" content="noindex,nofollow">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<link rel="stylesheet" href="../static/css/bootstrap.min.css"> <link rel="stylesheet" href="../static/css/bootstrap.min.css">
<link rel="stylesheet" href="../static/font-awesome/css/font-awesome.min.css"> <link rel="stylesheet" href="../static/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="../static/css/dede.css"> <link rel="stylesheet" href="../static/css/dede.css">
@@ -33,8 +33,8 @@ header .logo{width:260px;padding:1em 0}
</div> </div>
</div> </div>
</header> </header>
<main class="container login-from mt-4">
<div class="alert alert-warning" role="alert"><?php echo $redmsg; ?></div>
<main class="container login-from mt-5">
<?php echo $redmsg; ?>
<div class="login-area"> <div class="login-area">
<h3 class="text-center">后台登录</h3> <h3 class="text-center">后台登录</h3>
<form name="form1" method="post" action="login.php"> <form name="form1" method="post" action="login.php">


正在加载...
取消
保存