diff --git a/src/main/java/com/nis/util/SchedulerTaskUtil.java b/src/main/java/com/nis/util/SchedulerTaskUtil.java index 317b85ffa..fd465a32e 100644 --- a/src/main/java/com/nis/util/SchedulerTaskUtil.java +++ b/src/main/java/com/nis/util/SchedulerTaskUtil.java @@ -8,6 +8,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.apache.commons.lang3.StringEscapeUtils; import org.apache.shiro.SecurityUtils; import org.apache.shiro.authc.UsernamePasswordToken; import org.apache.shiro.config.IniSecurityManagerFactory; @@ -39,6 +40,7 @@ import com.nis.domain.configuration.PxyObjSpoofingIpPool; import com.nis.domain.configuration.PxyObjTrustedCaCert; import com.nis.domain.configuration.PxyObjTrustedCaCrl; import com.nis.domain.maat.MaatCfg; +import com.nis.domain.maat.ManipulatActionParam; import com.nis.domain.maat.ToMaatBean; import com.nis.domain.maat.ToMaatResult; import com.nis.domain.maat.ToUpdateMaatBeanStatus; @@ -238,6 +240,15 @@ public class SchedulerTaskUtil { userRegion = userRegion.substring(0, userRegion.length()-1); } } + // Proxy Block --xml无法描述的user_region + if(entity.getServiceId().equals(576)) { + ManipulatActionParam actionParam = new ManipulatActionParam(); + actionParam.setMethod("block"); + actionParam.setCode(Integer.valueOf(cfg.getUserRegion1())); + actionParam.setMessage(!StringUtil.isBlank(cfg.getUserRegion2()) ? cfg.getUserRegion2():""); + actionParam.setHtml_profile(Integer.valueOf(!StringUtil.isBlank(cfg.getUserRegion3()) ? cfg.getUserRegion3():"0")); + userRegion = StringEscapeUtils.unescapeJson(BaseService.gsonToJson(actionParam)); + } // Proxy Manipulate if(entity.getServiceId().equals(656)) { diff --git a/src/main/java/com/nis/web/service/configuration/ConfigSynchronizationService.java b/src/main/java/com/nis/web/service/configuration/ConfigSynchronizationService.java index 7c7321aae..f556e24cb 100644 --- a/src/main/java/com/nis/web/service/configuration/ConfigSynchronizationService.java +++ b/src/main/java/com/nis/web/service/configuration/ConfigSynchronizationService.java @@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletResponse; import net.sf.json.JSONObject; +import org.apache.commons.lang3.StringEscapeUtils; import org.apache.poi.ss.formula.functions.T; import org.dom4j.Node; import org.springframework.beans.BeanUtils; @@ -55,6 +56,7 @@ import com.nis.domain.maat.MaatCfg.GroupCfg; import com.nis.domain.maat.MaatCfg.IpCfg; import com.nis.domain.maat.MaatCfg.NumBoundaryCfg; import com.nis.domain.maat.MaatCfg.StringCfg; +import com.nis.domain.maat.ManipulatActionParam; import com.nis.domain.specific.ConfigGroupInfo; import com.nis.domain.specific.SpecificServiceCfg; import com.nis.util.ConfigServiceUtil; @@ -461,6 +463,16 @@ public class ConfigSynchronizationService extends BaseService{ userRegion = userRegion.substring(0, userRegion.length()-1); } } + // Proxy Block --xml无法描述的user_region + if(entity.getServiceId().equals(576)) { + ManipulatActionParam actionParam = new ManipulatActionParam(); + actionParam.setMethod("block"); + actionParam.setCode(Integer.valueOf(cfg.getUserRegion1())); + actionParam.setMessage(!StringUtil.isBlank(cfg.getUserRegion2()) ? cfg.getUserRegion2():""); + actionParam.setHtml_profile(Integer.valueOf(!StringUtil.isBlank(cfg.getUserRegion3()) ? cfg.getUserRegion3():"0")); + userRegion = StringEscapeUtils.unescapeJson(gsonToJson(actionParam)); + } + // Proxy Manipulation if(entity.getServiceId().equals(656)) { userRegion = BaseService.setUserRegionOfMantipulateCfg(cfg, userRegion); diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 09a9729d0..03cc93c14 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1557,6 +1557,7 @@ cert_verify_fail_method=Fail Method ssl_ver_min=Min SSL Version ssl_ver_max=Max SSL Version ssl_ver_mirror_client=Mirror Client +ssl_ver_allow_http2= Allow Http2 decrypt_mirror_enable=Mirror Enable decrypt_mirror_mirror_profile=Mirror Profile exclusions=Exclusions diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 7f9a0e67a..844431d51 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1559,6 +1559,7 @@ cert_verify_fail_method=Fail Method ssl_ver_min=Min SSL Version ssl_ver_max=Max SSL Version ssl_ver_mirror_client=Mirror Client +ssl_ver_allow_http2= Allow Http2 decrypt_mirror_enable=Mirror Enable decrypt_mirror_mirror_profile=Mirror Profile exclusions=Exclusions diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index 42a816104..13d2bd51b 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1557,6 +1557,7 @@ cert_verify_fail_method=\u5931\u8D25\u65B9\u6CD5 ssl_ver_min=\u6700\u5C0FSSL\u7248\u672C ssl_ver_max=\u6700\u5927SSL\u7248\u672C ssl_ver_mirror_client=\u955C\u50CF\u5BA2\u6237\u7AEF +ssl_ver_allow_http2= \u5141\u8BB8 Http2 decrypt_mirror_enable=\u542F\u7528\u955C\u50CF decrypt_mirror_mirror_profile=\u955C\u50CF\u6982\u8981 exclusions=\u6392\u9664 @@ -1571,7 +1572,7 @@ approach=\u63A5\u8FD1 cert_verify=\u8BC1\u4E66\u9A8C\u8BC1 ssl_version=SSL\u7248\u672C mirror_client=\u955C\u50CF\u5BA2\u6237\u7AEF -allow_http2=Allow Http2 +allow_http2=\u5141\u8BB8 Http2 min=\u6700\u5C0F max=\u6700\u5927 decrypt_mirror=\u89E3\u5BC6\u955C\u50CF diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/form.jsp index cec8c79aa..69404a6c1 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileHijack/form.jsp @@ -12,10 +12,19 @@ $("#cfgFile").on('change',function(){ $("#urlInfo").val($("#cfgFile").val()); - }); + cfgFileValidate(); + }); $("#cfgFrom") .validate( { submitHandler : function(form) { + + var cfgFile = $("#cfgFile").val(); + if(cfgFile!=''){ + if(!cfgFileValidate()){ + return false; + } + + } loading('onloading...'); form.submit(); }, @@ -26,6 +35,32 @@ }); }); + + function cfgFileValidate(){ + var flag=false; //状态,检测文件后缀用 + var arr=["exe","apk"];//使用是什么格式的后缀 + var cFile=$("#cfgFile").val();//文件的值 + //取出上传文件的扩展名 + var index=cFile.lastIndexOf("."); + var ext = cFile.substr(index+1).toLowerCase(); + //循环比较 + for(var i=0;i"); + return false; + } + return true; + } diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/form.jsp index d97ea9ffa..fd25da202 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileInsertScript/form.jsp @@ -12,10 +12,22 @@ $("#cfgFile").on('change',function(){ $("#urlInfo").val($("#cfgFile").val()); + cfgFileValidate(); + }); + $("#format").on('change',function(){ + cfgFileValidate(); }); $("#cfgFrom") .validate( { submitHandler : function(form) { + + var cfgFile = $("#cfgFile").val(); + if(cfgFile!=''){ + if(!cfgFileValidate()){ + return false; + } + + } loading('onloading...'); form.submit(); }, @@ -26,6 +38,31 @@ }); }); + function cfgFileValidate(){ + var flag=false; //状态,检测文件后缀用 + var arr=["js","css"];//使用是什么格式的后缀 + var cFile=$("#cfgFile").val();//文件的值 + //取出上传文件的扩展名 + var index=cFile.lastIndexOf("."); + var ext = cFile.substr(index+1).toLowerCase(); + //循环比较 + for(var i=0;i"); + return false; + } + return true; + } @@ -150,7 +187,7 @@ *
- diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileResponsePage/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileResponsePage/form.jsp index 520b01717..358974b8f 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/fileResponsePage/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileResponsePage/form.jsp @@ -12,10 +12,21 @@ $("#cfgFile").on('change',function(){ $("#urlInfo").val($("#cfgFile").val()); + cfgFileValidate(); + }); + $("#contentType").on('change',function(){ + cfgFileValidate(); }); - $("#cfgFrom") .validate( { submitHandler : function(form) { + + var cfgFile = $("#cfgFile").val(); + if(cfgFile!=''){ + if(!cfgFileValidate()){ + return false; + } + + } loading('onloading...'); form.submit(); }, @@ -26,6 +37,31 @@ }); }); + function cfgFileValidate(){ + var flag=false; //状态,检测文件后缀用 + var arr=["template","html"];//使用是什么格式的后缀 + var cFile=$("#cfgFile").val();//文件的值 + //取出上传文件的扩展名 + var index=cFile.lastIndexOf("."); + var ext = cFile.substr(index+1).toLowerCase(); + //循环比较 + for(var i=0;i"); + return false; + } + return true; + } @@ -151,7 +187,7 @@ *
- diff --git a/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp b/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp index a4353d080..12e1311d3 100644 --- a/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/proxy/fileStrategy/form.jsp @@ -12,10 +12,21 @@ $("#cfgFile").on('change',function(){ $("#urlInfo").val($("#cfgFile").val()); + cfgFileValidate(); + }); + $("#contentType").on('change',function(){ + cfgFileValidate(); }); - $("#cfgFrom") .validate( { submitHandler : function(form) { + + var cfgFile = $("#cfgFile").val(); + if(cfgFile!=''){ + if(!cfgFileValidate()){ + return false; + } + + } loading('onloading...'); form.submit(); }, @@ -26,6 +37,31 @@ }); }); + function cfgFileValidate(){ + var flag=false; //状态,检测文件后缀用 + var arr=["template","html"];//使用是什么格式的后缀 + var cFile=$("#cfgFile").val();//文件的值 + //取出上传文件的扩展名 + var index=cFile.lastIndexOf("."); + var ext = cFile.substr(index+1).toLowerCase(); + //循环比较 + for(var i=0;i"); + return false; + } + return true; + }