관리자 환경설정의 접근차단IP 중 현재 접속 IP를 차단못하게 하기

This commit is contained in:
thisgun
2020-11-09 15:06:08 +09:00
parent 0832f72914
commit 1cdb1b9397
2 changed files with 38 additions and 0 deletions

View File

@ -1434,6 +1434,26 @@ $(function(){
function fconfigform_submit(f)
{
var current_user_ip = "<?php echo $_SERVER['REMOTE_ADDR']; ?>";
var cf_intercept_ip_val = f.cf_intercept_ip.value;
if( cf_intercept_ip_val && current_user_ip ){
var cf_intercept_ips = cf_intercept_ip_val.split("\n");
for(var i=0; i < cf_intercept_ips.length; i++){
if ( cf_intercept_ips[i].trim() ) {
cf_intercept_ips[i] = cf_intercept_ips[i].replace(".", "\.");
cf_intercept_ips[i] = cf_intercept_ips[i].replace("+", "[0-9\.]+");
var re = new RegExp(cf_intercept_ips[i]);
if ( re.test(current_user_ip) ){
alert("현재 접속 IP : "+ current_user_ip +" 가 차단될수 있기 때문에, 다른 IP를 입력해 주세요.");
return false;
}
}
}
}
f.action = "./config_form_update.php";
return true;
}