Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Tim Mannah #1
I edited the login behaviour to use 2 tables (not working please take a look)
I inserted the login behaviour but edited it so that is would check a
username and an email address for a valid login (the user may have either)
and search
for a vaild password and lookup another table called tbMemberAccessLvl to
get the users access level.
The code is below. It seems that the login function is
working out but I AM NOT SURE IF IT IS STORING THE APPROPRIATE ACCESS LEVEL.
I am using the Restrict access level behaviour which works for the first
access
level but doesnt work for the higher access level.
Im not sure if it is picking up the access level at all and may only be
working for one of my levels by default.
I changed MM_fldUserAuthorization='AccessLvl' (in the login page)
to what you can see, but since this comes from another table does the
behaviour know that ????
PLease take a look. The code is below
<%
' *** Validate request to log in to this site.
MM_LoginAction = Request.ServerVariables("URL")
If Request.QueryString<>"" Then MM_LoginAction = MM_LoginAction + "?" +
Server.HTMLEncode(Request.QueryString)
MM_valUsername=CStr(Request.Form("username"))
If MM_valUsername <> "" Then
MM_fldUserAuthorization="AccessLvl"
MM_redirectLoginSuccess="success.asp"
MM_redirectLoginFailed="failed.asp"
MM_flag="ADODB.Recordset"
set MM_rsUser = Server.CreateObject(MM_flag)
MM_rsUser.ActiveConnection = MM_connDANSW_STRING
MM_rsUser.Source = "SELECT dbo.tbMembers.MemberId,
dbo.tbMembers.MemberPass, dbo.tbMembers.email,
dbo.tbMemberAccessLvl.AccessLvl"
If MM_fldUserAuthorization <> "" Then MM_rsUser.Source = MM_rsUser.Source
& "," & MM_fldUserAuthorization
MM_rsUser.Source = MM_rsUser.Source & " FROM dbo.tbMembers,
dbo.tbMemberAccessLvl WHERE (dbo.tbMembers.MemberId='" &
Replace(MM_valUsername,"'","''") &"' OR dbo.tbMembers.email='" &
Replace(MM_valUsername,"'","''") &"') AND dbo.tbMembers.MemberPass='" &
Replace(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("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 true 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
%>
Tim Mannah Guest
-
Add clause to the login behaviour....how?
I want to add some more criteria to a user logging in other that correct username and password. I want to base it on a specific date and... -
CFML Session settings affecting DW Login Behaviour?
Hi everyone - I think I am going a little stir crazy. I've been using Dreamweaver / Ultradev since DW1/UD1/Drumbeat and have used the login... -
php login behaviour shows errors
Is there a problem with the Dreamweaver standard php behaviours? In particular the user login scripts? e.g. I have tried with both the "Newland... -
Using two tables to login
I am trying to create a login mechanisim that checks access levels. I am using the login user server behavior HOWEVER the Access levels are in a... -
Login user behaviour
I inserted the login behaviour but edited it so that is would check a username and an email address for a valid login (the user may have either) and...



Reply With Quote

