%
Dim Error_Msg
Response.Expires = -1000 'Makes the browser not cache this page
Response.Buffer = True 'Buffers the content so our Response.Redirect will work
Session("UserLoggedIn") = ""
If Request.Form("logando") = "true" Then
CheckLogin
Else
ShowLogin
End If
Sub ShowLogin
%>
Torus Informática - SAJUT
Softwares, Consultoria e
Desenvolvimento
|
Acesso
restrito somente a pessoas autorizadas
<%
if Error_Msg <> "" then
Response.Write("")
Response.Write(Error_Msg & "")
Error_Msg = ""
end if
%>
|

torus@uol.com.br
<%
End Sub
Sub CheckLogin
Dim Conn, sql, RS, login, senha
login = Request.Form("login")
senha = Request.Form("senha")
Set Conn = Server.CreateObject("ADODB.Connection")
abreConexao(Conn)
sql = "select login, pagina from usuarios where login = '" & LCase(login) & "'"
sql = sql & " and senha = '" & LCase(senha) & "'"
Set RS = Conn.Execute(sql)
If RS.BOF And RS.EOF Then
Error_Msg = "Login ou Senha inválidos. Tente novamente."
ShowLogin
Else
Session("UserLoggedIn") = RS("pagina")
Response.Redirect RS("pagina")
End If
set RS = nothing
Conn.Close
set Conn = nothing
End Sub
%>