fixes bug#0021044

qua:wallysson
dev:alberto

git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/AdmVenta/Web/trunk/ventaboletos@104444 d1611594-4594-4d17-8e1d-87c2c4800839
master
changelogweb 2020-11-23 03:11:26 +00:00
parent 66c15d74c8
commit b991bdc601
1 changed files with 19 additions and 3 deletions

View File

@ -4,6 +4,9 @@
*/
package com.rjconsultores.ventaboletos.web.utilerias;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.ServletContext;
import javax.sql.DataSource;
@ -138,15 +141,28 @@ public class MyAppInit implements org.zkoss.zk.ui.util.WebAppInit {
private boolean ipBloqueadoGeracaoServico() {
Constante constanteServidorException = getConstanteService().buscarPorNomeConstante("SERVIDOR_EXCEPCION_GENERACION_CORRIDA");
String ipConstante = constanteServidorException == null ? "" : constanteServidorException.getValorconstante();
log.info(" IP Constante: " + ipConstante);
if (ipConstante.equals("")) {
return false;
}
String ipExternalAWS = IPValidatorUtileria.getIpExternalAWS();
List<String> lsIps = new ArrayList<String>();
if (ipConstante.equals(IPValidatorUtileria.getIpExternalAWS())) {
log.info(" IP capturado: " + ipExternalAWS);
log.info(" IP: " + ipConstante);
String ipExternalAWS = IPValidatorUtileria.getIpExternalAWS();
log.info("ipExternalAWS: "+ipExternalAWS);
String ip = IPValidatorUtileria.getIp();
log.info("ip: "+ip);
if (ipExternalAWS!=null){lsIps.add(ipExternalAWS);}
if (ip!=null){lsIps.add(ip);}
if (lsIps.contains(ipConstante)) {
log.info(" IP bloqueado");
return true;
} else {