Merge branch 'rosewiper'

This commit is contained in:
woo 2023-07-03 11:23:07 +09:00
commit ef42457e25

View File

@ -85,6 +85,48 @@ public class IPIgnoreInterceptorHandler extends HandlerInterceptorAdapter{
HackIpVO hackIpVO = new HackIpVO();
hackIpVO.setIgnoreIp(userIP);
/*
* 헤더 아이피 체크 해주기
* "." 기준으로 문자열 분할 0 ~ 255 사이 값인지 체크
* 범위 값이 아닌경우 오류 처리
*
* */
String[] checkIP = userIP.split("\\.");
boolean ipCheckType = false;
if(checkIP.length < 4 || checkIP == null) {
System.out.println("IPIgnoreInterceptorHandler-preHandle Header IP Check ERROR !!! ");
System.out.println("userIP ::: "+userIP);
response.sendRedirect(request.getContextPath() + "/");
return true;
}else {
for(String tmp : checkIP) {
int ipNum = Integer.parseInt(tmp);
if(ipNum >=0 && ipNum <= 255) {
ipCheckType = true;
}
}
}
if(!ipCheckType) {
System.out.println("IPIgnoreInterceptorHandler-preHandle Header IP Check ERROR !!! ");
System.out.println("userIP ::: "+userIP);
response.sendRedirect(request.getContextPath() + "/");
return true;
}
int i_ignoreCnt = hackIpService.selectIgnoreIpCnt(hackIpVO);
//System.out.println("result=="+hackIpService.selectIgnoreIpCnt(hackIpVO));
@ -151,7 +193,11 @@ public class IPIgnoreInterceptorHandler extends HandlerInterceptorAdapter{
loginLogService.logInsertLoginLog4Ajax(loginLog);
}catch(Exception ex) {
ex.printStackTrace();
//ex.printStackTrace();
System.out.println("IPIgnoreInterceptorHandler-preHandle Error !!! " + ex);
//오류가 발생하면 메일화면으로 이동 시킨다.
response.sendRedirect(request.getContextPath() + "/");
return true;
}
}
@ -163,11 +209,13 @@ public class IPIgnoreInterceptorHandler extends HandlerInterceptorAdapter{
}catch(Exception ex) {
ex.printStackTrace();
//ex.printStackTrace();
System.out.println("IPIgnoreInterceptorHandler-preHandle Error !!! " + ex);
//오류가 발생하면 경로 오류를 발생 시킨다.
response.sendRedirect(request.getContextPath() + "/");
return true;
}
return v_ret;
}