<%-- Document : welcome Created on : 3/12/2012, 10:24:46 AM Author : martha --%> <%@page import="com.sun.xml.internal.ws.util.xml.CDATA"%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page import = "conexion.*" import = "java.sql.*" import = "general.Config" import = "general.Permisos" import = "own.codec.*" import = "java.text.NumberFormat" %> Declaranet <% out.println(""); String nompag[] = request.getRequestURI().split("/"); %> <% Conexion c = null; ConexionDeclaranet cd = null; Connection lcnt_con = null; Connection lcd_connection = null; Statement lst_stm = null; Statement lstg_conecta=null; ResultSet lrs_res = null; String ls_query = new String(""); String emergent_error = new String(""); boolean lb_connection = false; String debug = new String("si"); boolean elementos_encontrados = false; String patron_busqueda = new String(""); String patron_enviar = new String(""); String tipo_enviar = new String(""); String tipo_busqueda = new String(""); String lower_limit = new String("0"); String upper_limit = new String("50"); String total_telefonia = new String("0"); /********* INICIO. Conexión a la base de datos ********/ try { if (!Config.getParametro("debug").equals("si")) { debug = "no"; } c = new Conexion(); lcnt_con = c.getConnection(); lst_stm = lcnt_con.createStatement(); lb_connection = true; }catch (Exception e) { emergent_error = "Error al conectarse a la base de datos "; if (debug.equals("si")) { emergent_error += e; } lb_connection = false; } /********* FIN. Conexión a la base de datos ********/ /********* INICIO. Conexión a la base de datos ********/ try { cd = new ConexionDeclaranet(); lcd_connection = cd.getConnection(); lstg_conecta = lcd_connection.createStatement(); }catch (Exception e) { emergent_error = "Error al conectarse a la base de datos 2 "; } /********* FIN. Conexión a la base de datos ********/ //********* INICIO. Validación fundamental para evitar ejecución de código sin privilegios suficientes **********// try { if (!Permisos.PermisoModulo(nompag[nompag.length - 1].toString(), Integer.parseInt(session.getAttribute("id_user").toString()))) { if (lb_connection) { lst_stm.close(); lcnt_con.close(); lstg_conecta.close(); lcd_connection.close(); } emergent_error += " Privilegios insuficientes. "; lb_connection = false; } }catch (Exception e) { emergent_error += " Privilegios insuficientes. "; if (debug.equals("si")) { emergent_error += "Trace: " + e.toString(); } lb_connection = false; } /**FIN. Validación fundamental para; evitar ejecución de código sin privilegios suficientes****/ /*INICIA. parte del código*/ if(lb_connection){ try { %>
Resumen
<% %>
Declaraciones Anteriores
<% }catch (Exception e) { emergent_error += "Error: " + e.toString() + " Ultimo query: " + ls_query; %>
<%=emergent_error%>
<% } finally { lst_stm.close(); lstg_conecta.close(); } } else { %>
<%=emergent_error%>
<% } /*FIN. parte del código*/ /****INICIA. Registrar en la bitácora*/ try { String mensaje_log = new String(""); mensaje_log = "Usuario -" + session.getAttribute("username").toString() + "- Inicio sessión en Declaranet;"; Config.GuardarLog(Integer.parseInt(session.getAttribute("id_user").toString()), mensaje_log, 3); } catch (Exception e) { } /******FIN. Registrar en la bitácora*/ %>