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' 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='../login_s.htm'
MM_redirectLoginFailed='../login_f.htm' 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 &amp;
',' &amp; MM_fldUserAuthorization MM_rsUser.Source = MM_rsUser.Source &amp; '
FROM dbo.tbMembers, dbo.tbMemberAccessLvl WHERE dbo.tbMembers.MemberId='' &amp;
Replace(MM_valUsername,''','''') &amp;'' OR dbo.tbMembers.email='' &amp;
Replace(MM_valUsername,''','''') &amp;'' AND dbo.tbMembers.MemberPass='' &amp;
Replace(Request.Form('password'),''','''') &amp; ''' 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 %>