Is there any other way of achieving this.
I simply wish to have two login states;
I have a table containing
USER_NAME
PASSWORD
ACCESS_CODE
USER TYPE (ADMIN/USER) or (TRUE or FALSE)
I have got the user_name / password / access_code to work, but this always open the same page.
See below;
VALIDATE
AFTER VALIDATE
Can i redirect the page based on the value below;
1. ADMIN
2. USER
If admin is true then open page 1
If admin is false then open page 2
or
If admin open page 1
If user open page 2
Any support on this one is really appreciated.
I simply wish to have two login states;
I have a table containing
USER_NAME
PASSWORD
ACCESS_CODE
USER TYPE (ADMIN/USER) or (TRUE or FALSE)
I have got the user_name / password / access_code to work, but this always open the same page.
See below;
VALIDATE
Code:
if (session.User_Name="") .or. (Password="") .or. (Access_Code="") then currentform.has_error=.t. currentform.error_message="User Name, Password or Access Code cannot be blank." else dim correct_password as C correct_password=lookup("<ABD_Path>\contacts", "User_Name="+quote(session.User_Name), "password") if (correct_password<>password) then currentform.has_error=.t. currentform.error_message="Invalid User Name or Password" end if dim correct_access_code as C correct_access_code=lookup("<ADB_Path>\contacts","User_Name="+quote(session.User_Name), "access_code") if (correct_access_code<>access_code) then currentform.has_error=.t. currentform.error_message="Invalid Access Code" end if end if
Code:
session.vcompany_id=lookup("<ABD_Path>\contacts", "User_Name="+quote(session.User_Name), "company_id") session.vtitle=lookup("<ADB_Path>\contacts", "User_Name="+quote(session.User_Name), "title") session.vfirst_name=lookup("<ADB_Path>\contacts", "User_Name="+quote(session.User_Name), "first_name") session.vlast_name=lookup("<ADB_Path>\contacts", "User_Name="+quote(session.User_Name), "last_name") if eval_valid("session.targetUrl") then if session.targetURL <> "" then Currentform.RedirectTarget=session.targetURL else currentform.redirectTarget = "main_menu.a5w" end if else currentform.redirecttarget="main_menu.a5w" end if session.__protected__flagisloggedin = .t.
Can i redirect the page based on the value below;
1. ADMIN
2. USER
If admin is true then open page 1
If admin is false then open page 2
or
If admin open page 1
If user open page 2
Any support on this one is really appreciated.
Comment