
06/01/2002, 12:44
|
 | | | Fecha de Ingreso: octubre-2001 Ubicación: Dénia
Mensajes: 259
Antigüedad: 23 años, 4 meses Puntos: 2 | |
Re: User&Pass y redireccione a una URL especifica <%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" + Request.QueryString
MM_valUsername=CStr(Request.Form("usuario&quo t;))
If MM_valUsername <> "" Then
MM_fldUserAuthorization="Id"
MM_redirectLoginSuccess="login.asp"
MM_redirectLoginFailed="error.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_autentificacion_STRING
MM_rsUser.Source = "SELECT usuario, Contrasena"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM empresas_esp WHERE usuario='" & MM_valUsername &"' AND Contrasena='" & CStr(Request.Form("psw")) & "'"
MM_rsUser.CursorType = 0
MM_rsUser.CursorLocation = 2
MM_rsUser.LockType = 3
MM_rsUser.Open
If Not MM_rsUser.EOF Or Not MM_rsUser.BOF Then
' username and password match - this is a valid user
Session("MM_Username") = MM_valUsername
If (MM_fldUserAuthorization <> "") Then
Session("MM_UserAuthorization") = CStr(MM_rsUser.Fields.Item(MM_fldUserAuthorization ).Value)
Else
Session("MM_UserAuthorization") = ""
End If
if CStr(Request.QueryString("accessdenied") ) <> "" And false Then
MM_redirectLoginSuccess = Request.QueryString("accessdenied")
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginSuccess)
End If
MM_rsUser.Close
Response.Redirect(MM_redirectLoginFailed)
End If
%>
______________________________________
No ha funcionado URJOSE,pero gracias por intentarlo, este es un fragmento del código,sí no os importa me podríais decir donde lo podría modificar??
1000 gracias!
<img src="http://www.buscadata.com/imagenes/barraca.jpg"> |