diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 60572b078..30654cadf 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -2062,10 +2062,18 @@ public class BaseController { Properties prop = this.getMsgProp(); String prefix = ip.split("-")[0]; String subfix = ip.split("-")[1]; - if (Integer.parseInt(prefix.split("\\.")[0]) < 192 || Integer.parseInt(prefix.split("\\.")[0]) > 223 - || Integer.parseInt(subfix.split("\\.")[0]) < 192 || Integer.parseInt(subfix.split("\\.")[0]) > 223) { - errInfo.append(prop.get(ipName) + " " + prop.get("ip_range_in_c") + ";"); + if ((Integer.parseInt(prefix.split("\\.")[0])<128&&Integer.parseInt(subfix.split("\\.")[0])<128) + ||(Integer.parseInt(prefix.split("\\.")[0])>127&&Integer.parseInt(subfix.split("\\.")[0])>127&&Integer.parseInt(prefix.split("\\.")[0])<192&&Integer.parseInt(subfix.split("\\.")[0])<192) + ||(Integer.parseInt(prefix.split("\\.")[0])>191&&Integer.parseInt(subfix.split("\\.")[0])>191&&Integer.parseInt(prefix.split("\\.")[0])<224&&Integer.parseInt(subfix.split("\\.")[0])<224) + ||(Integer.parseInt(prefix.split("\\.")[0])>223&&Integer.parseInt(subfix.split("\\.")[0])>223&&Integer.parseInt(prefix.split("\\.")[0])<240&&Integer.parseInt(subfix.split("\\.")[0])<240) + ||(Integer.parseInt(prefix.split("\\.")[0])>239&&Integer.parseInt(subfix.split("\\.")[0])>239&&Integer.parseInt(prefix.split("\\.")[0])<256&&Integer.parseInt(subfix.split("\\.")[0])<256)) { + }else { + errInfo.append(prop.get(ipName) + " " + prop.get("ip_range_in_the_same") + ";"); } +// if (Integer.parseInt(prefix.split("\\.")[0]) < 192 || Integer.parseInt(prefix.split("\\.")[0]) > 223 +// || Integer.parseInt(subfix.split("\\.")[0]) < 192 || Integer.parseInt(subfix.split("\\.")[0]) > 223) { +// errInfo.append(prop.get(ipName) + " " + prop.get("ip_range_in_c") + ";"); +// } if (!prefix.split("\\.")[0].equals(subfix.split("\\.")[0]) || !prefix.split("\\.")[1].equals(subfix.split("\\.")[1]) || !prefix.split("\\.")[2].equals(subfix.split("\\.")[2])) { diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 0a046eee8..334903143 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1295,4 +1295,5 @@ cfg_operation_log=Configuration Operation Log function_name=Operation Module config_service_statistics=Config Statistics ruleLimitTip=The number of effective rules has reached the limit(%s). -av_protocol_note=Note:Recognizable Protocols Include RTSP,RTMP. \ No newline at end of file +av_protocol_note=Note:Recognizable Protocols Include RTSP,RTMP. +ip_range_in_the_same=Start IP and end IP in a IP range must with in the same subnet \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index d0a93e641..92dd2631a 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1287,4 +1287,5 @@ cfg_operation_log=\u914D\u7F6E\u64E6\u6B27\u6D32\u54E6\u65E5\u5FD7 function_name=\u64CD\u4F5C\u6A21\u5757 config_service_statistics=\u914D\u7F6E\u7EDF\u8BA1 ruleLimitTip=\u6709\u6548\u89C4\u5219\u91CF\u5DF2\u8FBE\u5230\u9650\u5236(%s). -av_protocol_note=\u6CE8\uFF1A\u53EF\u8BC6\u522B\u534F\u8BAE\u5305\u62EC RTSP\u3001RTMP\u3002 \ No newline at end of file +av_protocol_note=\u6CE8\uFF1A\u53EF\u8BC6\u522B\u534F\u8BAE\u5305\u62EC RTSP\u3001RTMP\u3002 +ip_range_in_the_same=IP\u8303\u56F4\u7684\u8D77\u59CBIP\u4E0E\u7EC8\u6B62IP\u5FC5\u987B\u5728\u76F8\u540C\u7F51\u6BB5 \ No newline at end of file diff --git a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js index e372daf00..d5a00a9ef 100644 --- a/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js +++ b/src/main/webapp/static/global/plugins/jquery-validation/1.11.0/jquery.validate.method.js @@ -341,7 +341,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) { if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192) ||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224) ||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240) - ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许C段IP + ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许同段IP if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小 if((startIp.split(".")[0]!=endIp.split(".")[0])|| (startIp.split(".")[1]!=endIp.split(".")[1])|| @@ -465,7 +465,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) { if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192) ||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224) ||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240) - ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许C段IP + ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许同段IP if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小 if((startIp.split(".")[0]!=endIp.split(".")[0])|| (startIp.split(".")[1]!=endIp.split(".")[1])|| @@ -636,7 +636,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) { if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192) ||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224) ||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240) - ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许C段IP + ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许同段IP if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小 if((startIp.split(".")[0]!=endIp.split(".")[0])|| (startIp.split(".")[1]!=endIp.split(".")[1])|| @@ -692,7 +692,7 @@ jQuery.validator.addMethod("ipCheck",function(value, element) { if((startPart0<128&&startPart1<128)||(startPart0>127&&startPart1>127&&startPart0<192&&startPart1<192) ||(startPart0>191&&startPart1>191&&startPart0<224&&startPart1<224) ||(startPart0>223&&startPart1>223&&startPart0<240&&startPart1<240) - ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许C段IP + ||(startPart0>239&&startPart1>239&&startPart0<256&&startPart1<256)){//仅允许同段IP if(ipToNumber(startIp)<=ipToNumber(endIp)){//比较IP大小 if((startIp.split(".")[0]!=endIp.split(".")[0])|| (startIp.split(".")[1]!=endIp.split(".")[1])||