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
%>