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