From ba12756105b032e472014ba8ad170efbb6d88efa Mon Sep 17 00:00:00 2001 From: firesun Date: Tue, 26 Jan 2016 11:46:57 +0800 Subject: [PATCH] =?UTF-8?q?Version=203.2.0=20=E6=B7=BB=E5=8A=A0=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=AF=86=E7=A0=81=E9=94=99=E8=AF=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- login.php | 14 +++++++++----- static/js/pass_is_wrong.js | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 static/js/pass_is_wrong.js diff --git a/login.php b/login.php index 07ce353..567bf13 100644 --- a/login.php +++ b/login.php @@ -21,6 +21,7 @@ if(isset($_SESSION['isLogin']) && $_SESSION['isLogin']===true) //判断ip是否在封禁列表中 $forbiddenIPList=loadForbiddenIPList(); $ip=$_SERVER['REMOTE_ADDR']; +$is_pass_wrong=false; if(!isset($forbiddenIPList[$ip]) || $forbiddenIPList[$ip]<=5) { if(isset($_POST['password']) && $_POST['password']!="") @@ -45,10 +46,12 @@ if(!isset($forbiddenIPList[$ip]) || $forbiddenIPList[$ip]<=5) else $forbiddenIPList[$ip]=1; saveForbiddenIPList($forbiddenIPList); + $is_pass_wrong=true; } - } - + } } +else + $is_pass_wrong=true; function loadForbiddenIPList() { @@ -97,7 +100,6 @@ function checkPassword($p) $key=md5($salt.$key.$_SESSION['firesunCheck'].$salt); $key=md5($salt.$key.$_SESSION['firesunCheck'].$salt); return $key===$p; - } return false; } @@ -110,8 +112,6 @@ function generate_password( $length = 32 ) { $password .= $chars[ mt_rand(0, strlen($chars) - 1) ]; return $password; } - - ?> @@ -123,6 +123,10 @@ function generate_password( $length = 32 ) { + '; + ?> diff --git a/static/js/pass_is_wrong.js b/static/js/pass_is_wrong.js new file mode 100644 index 0000000..424206f --- /dev/null +++ b/static/js/pass_is_wrong.js @@ -0,0 +1 @@ +alert("密码错误!"); \ No newline at end of file