Forums

This topic is locked

Log In Behaviour.......

Posted 06 Mar 2002 17:16:27
1
has voted
06 Mar 2002 17:16:27 Andrew Watson posted:
Aright folks, i want to add a third parameter to the generic UD login behaviour. Ive tried fiddling with the code but im getting data type mismatches so before i devote all my waking minutes to solving this, does anyone know the answer.??

My login behaviour is this.....

----------ASP CODE---------------!
<-%
' *** 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("Username")
If MM_valUsername <> "" Then
MM_fldUserAuthorization=""
MM_redirectLoginSuccess="emp_PersonalArea.asp"
MM_redirectLoginFailed="default.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_ejobs_STRING
MM_rsUser.Source = "SELECT Username, Password"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source & "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM tblEmployers WHERE Username='" & MM_valUsername &"' AND Password='" & CStr(Request.Form("Password") & "'"
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("svUsername" = 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
%->

-------END ASP CODE-------------------!

This is the standard UD behaviour using just USERNAME and PASSWORD fields, i however have a third field on the login form called SITEMEMBER, i want to check this too...

This sound easy now ive written it doon but time is of the essence, If anyone can help id be well chuffed and ill pay you a virtual million ! <img src=../images/dmxzone/forum/icon_smile_wink.gif border=0 align=middle>

Cheers,
Leed

Edited by - leed on 06 Mar 2002 17:17:01

Replies

Replied 06 Mar 2002 18:16:18
06 Mar 2002 18:16:18 Andrew Watson replied:
Yep, it was as easy as it sounded after writing it down here! and ive solved it, so thanks anyway...!
<img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Reply to this topic