Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 4.70 KB | None | 0 0
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
  2. <%Response.Expires=0%>
  3. <%Response.Buffer=True%>
  4. <%Session.lcid=1046%>
  5.  
  6. <!--#include virtual="/comum/biblioteca/banco_dados/f_bd_conexao.asp"-->
  7. <!--#include virtual="/comum/biblioteca/arquivo/f_ler_escrever_arquivo_ini.asp"-->
  8. <!--#include virtual="/comum/biblioteca/url/f_redirecionar_url.asp"-->
  9. <!--#include virtual="/comum/biblioteca/data/f_formatacao_data.asp"-->
  10. <!--#include virtual="/comum/biblioteca/email/f_envio_email.asp"-->
  11. <!--#include virtual="/comum/biblioteca/geral/f_setProtocols.asp"-->
  12.  
  13. <!--#include virtual="/comum/biblioteca/geral/f_getFiles.asp"-->
  14. <!--#include virtual="/site/anuncio/scripts/s_anuncio.asp"-->
  15.  
  16. <%
  17.     '/////////////////////////////////////////////////////////////////////////////////////////////////////////////
  18.     ' ANP - AGENCIA NACIONAL DO PETROLEO, GAS NATURAL E BIOCOMBUSTIVEIS
  19.     '
  20.     ' PROGRAMA:     INDEX
  21.     ' AUTOR:        RODRIGO JUNQUEIRA DE OLIVEIRA
  22.     ' DATA:         16/02/2009
  23.     ' ACAO:         PAGINA PRINCIPAL DO SITE
  24.     '
  25.     ' INCLUDES:     /comum/biblioteca/arquivo/f_ler_escrever_arquivo_ini.asp
  26.     '               /comum/biblioteca/url/f_redirecionar_url.asp
  27.     '               /comum/biblioteca/data/f_formatacao_data.asp
  28.     '               /comum/biblioteca/geral/f_setProtocols.asp
  29.     '              
  30.     ' HISTORICO:   
  31.     '
  32.     '/////////////////////////////////////////////////////////////////////////////////////////////////////////////
  33.  
  34.  
  35.     ' DETERMINAR A URL DO SITE, INDEPENDENTEMENTE DO AMBIENTE EM QUE A PÁGINA ESTEJA
  36.     ' FREEDY CARVALHO
  37.     ' ------------------------------------------------------------------------------------------------------------
  38.  
  39.     Dim rootProtocol    : rootProtocol  = setProtocols ( Request.ServerVariables("HTTPS") )
  40.     Dim rootDomain      : rootDomain    = Request.ServerVariables("SERVER_NAME")
  41.     Dim rootURL         : rootURL       = rootProtocol & rootDomain
  42.  
  43.     On Error Resume Next
  44.  
  45.     ' CHECAR VARIAVEL DE DESATIVACAO
  46.     '----------------------------------------------------------
  47.     If ( fstrLerArquivoINI("Disponibilizacao", "LIGADO", "S", "site.ini") = "N" ) Then
  48.         Session( "strErro" ) =  "O SITE EST&Aacute; TEMPORARIAMENTE FORA DO AR."
  49.     End If
  50.  
  51.     ' DOWNLOAD DIRETO DE ARQUIVOS
  52.     '----------------------------------------------------------
  53.     If ( Trim(Request.QueryString("dw")) <> "" ) Then
  54.         Response.Redirect "/SITE/acao/download/?id=" & Trim(Request.QueryString("dw"))
  55.         Response.End
  56.     End If
  57.    
  58.  
  59.     ' ROTINA DE TRATAMENTO DE ERRO DO SITE
  60.     ' CHECAR VARIAVEL DE SESSAO STRERRO
  61.     '----------------------------------------------------------
  62.     If ( Session("strErro") <> "" ) Then
  63.  
  64.         If ( Session("strErro") = "404" ) then
  65.  
  66.         %>
  67.            
  68.             <!--#include virtual = "/SITE/incHome/404.asp" -->
  69.  
  70.             <%
  71.             Session("strErro") = ""
  72.            
  73.                 objConexao.Close
  74.             Set objConexao = Nothing
  75.            
  76.             Response.End
  77.    
  78.         Else
  79.    
  80.             %>
  81.             <!--#include virtual = "/SITE/incHome/erroProcessamento.asp"-->
  82.             <%
  83.            
  84.             If (    fstrLerArquivoINI("LogErro", "LIGADO", "", "site.ini") = "S" And _
  85.                     fstrLerArquivoINI("Disponibilizacao", "LIGADO", "", "site.ini") = "S") Then
  86.            
  87.                 Dim strAutor
  88.                 Dim strEmail
  89.                 Dim strMensagem
  90.            
  91.                 strAutor    =   "INTERNET"
  92.                 strEmail    =   fstrLerArquivoINI("LogErro", "EMAIL", "", "site.ini")
  93.                 strMensagem =   Session("strErro")                                                  & vbCrLf & _
  94.                                 "--------------------------------------------------------------"    & vbCrLf & _
  95.                                 "INTERNET - " & fstrLerArquivoINI("Conexao", "INSTANCIA", "", "site.ini")
  96.                                
  97.                 'fStrEnvioEmail strAutor , "INTERNET", strEmail, "INTERNET - " & fstrLerArquivoINI("Conexao", "INSTANCIA", "", "site.ini") & " - LOG DE ERRO", strMensagem 
  98.        
  99.             End If
  100.            
  101.             Session("strErro") = ""
  102.            
  103.             objConexao.Close
  104.             Set objConexao = Nothing
  105.            
  106.             Response.End
  107.            
  108.         End If
  109.     End If
  110.  
  111.     If ( Trim(Request.QueryString("v")) <> "" ) Then
  112.         If ( Session("strUsuarioGCI") = "" ) Then
  113.             Response.Redirect "/GCI/login/?s=" & Session.SessionID & "&r=" & Server.URLEncode(Request.ServerVariables("PATH_INFO") & "?pg=" & Trim(Request.QueryString("pg")) & "&v=true")
  114.             Response.End
  115.         End If
  116.     End If
  117.  
  118.     If ( Mid( Request.ServerVariables("QUERY_STRING"),1,3 ) ) = "404" Then
  119.         strNomePagina = Mid( Request.ServerVariables("QUERY_STRING"), 5, Len( Request.ServerVariables("QUERY_STRING") ) - 4)
  120.         fstrRedirecionarPagina ( strNomePagina )
  121.         Response.End
  122.     End If
  123.    
  124.     If ( Trim(Session("strSessao")) = "" ) Then
  125.         Session("strSessao") = Cstr(Request.ServerVariables("INSTANCE_ID"))
  126.     End If 
  127.  
  128. %>
  129.  
  130. <!--#include virtual = "/SITE/incHome/home.asp" -->
  131.  
  132. <%
  133.  
  134.         objConexao.Close
  135.     Set objConexao = Nothing
  136.    
  137.     If ( Err.Number <> 0 ) Then
  138.         Session("strErro") = "ERRO: " & Cstr(err.number) & " - " & Cstr(err.Description) & "[/]"
  139.         Response.Write("ERRO:")
  140.         Response.End
  141.     End If
  142.    
  143. %>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement