CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Custom Security and Direct accessing for a page

Print topic Send  topic

Author Message
Alex
Posted: 05/10/2002, 10:28 PM

Sir,

I have a problem in designing a site for giving Online courses using CC.

I am using a table called Login_Table heaving the following fields :

User_id
User_Name
Password
Course_No

(I am using MSAccess Database and ASP for this)

I am using User_id is the Primary_key, User_name as Login field, Password as
password field and Course_no as Security level field.

I am facing problems in the follwing :

1. I have more than 7 courses, whereas CC defines only 3 security levels,
as well if I registerd for a course 3, I can access All courses equal to or
less than 3 i.e. I can access the pages for courses 3, 2 and 1.
How Can I restrict to a user to access ONLY those pages from these for which
he registered, ie. If he regestered for course 3, he can access only those
pages which are for Couse_No 3 (Course_No is the Security level field) not
for course 2 and 1. and if a person which have the Course_No 6 can access
only Course_No 6 Pages not 5,4,3,2,1 as well.

(I tried the solution giving by Ken Hardwick to an another question
"custom accessing of pages" but coult not get succeed)

2. I want different users who logged-in reaches on different pages of the
courses directly for which they registered , ie.When a user who is registered
for Course_No 3 logged-in successfully, go to on a page course-3.asp , and
if a user Logged-in successfully who is registered for Course_No 5 go to
directly on course-5.asp.

How can I do this in CC.

Please Help Me.

Nicole
Posted: 05/13/2002, 5:14 AM

Alex,
1. you should modify CC security. Refer to following article:
http://www.gotocode.com/art.asp?art_id=99&
to find how it could be done. In addition you should modify check_seciruty() function in common file in order to change condition from "<" to "=":
UserRights = security_level

where security_level is page access level.

2. on redirection issue please refer to article:
http://www.gotocode.com/art.asp?art_id=55&
But I advice not to use redirection page, but create Custom Login event and add redirection code after session vars are created.
Alex
Posted: 05/13/2002, 11:23 PM

Thanks Nicole,

The First this if working fine. i.e. More security level.

How do I do the Custom Login and redirection in ASP, as you adviced not to use redirection page, but create Custom Login event and add redirection code after session vars are created.

Please give me the sample code.

Thanks in advance.

Alex
Nicole
Posted: 05/14/2002, 4:57 AM

Alex,
first of all create Custom Login event and obtain generated code. Then find redirection part, e.g.:

cn.Close
Set cn = Nothing
if not(sPage = request.serverVariables("SCRIPT_NAME")) and not(isEmpty(sPage)) then
response.redirect(sPage & "?" & sQueryString)
end if
response.redirect("AdminMenu.asp")

You should modify it. E.g.:
cn.Close
Set cn = Nothing
if Session("UserRights") = 1 then
response.redirect ("Course1.asp")
end if
if Session("UserRights") = 2 then
response.redirect ("Course2.asp")
end if

That's all :)

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.