Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Shmooter #1
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 different
table and so I cant access it from the server behavior window so I have to edit
the code. When the access levels are in the same table as the rest of the data
all works well. when the access levels are in a different table my code doesnt
work......why. Why code below works for one of the access levels and not the
other, mind you it is getting the info out of another table. Is this a major
FLUKE/default way of working or is it something else. My access levels are '1'
and '2'. 2 can access 1 but 1 cannot access 2. my code is below: Login User
Code <% ' *** 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 &
',' & 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 %>
Shmooter Guest
-
Strange problem with Forms authentication: After successfull login, login page is still displayed
Hi there I have a quite strange problem with my ASP.NET-Application. The application has being deployed one year ago and worked fine till last... -
Login to admin system through login screen only
Hi there, I have an issue relating to login to my asp.net application. Basically i have built the standard login page which compares against the... -
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)... -
session problem - login screen continually reloads after pressing the login button
I am trying to get sessions to work on a log in screen to give certain users access to certain pages/directories. The problem is that when the... -
LOGIN: ERROR- Failed to initialize policy manager. (IFOR_PM_FATAL) Login sessions denied.
Verify that you haven't set the system date by mistake to a far away future. All the licenses then become expired! Restoring the system to the...



Reply With Quote

