This topic is locked
[SOLVED]

 Pages required login or not

3/3/2007 00:04:08
ASPRunnerPro General questions
J
Joseph Zuanger author

I am building a project and most of the pages require login, but there are a few pages not. How do I accomplish this. I know I can make two projects, one with login and one without. But I thought this is wasteful. Is there any way, I can delete some code on the pages which login is not required, to accomplish this?

Help is appreciated.

Joe

Sergey Kornilov admin 3/3/2007

Enable guest login. Use User group permissions to allow guest user access some page and perform some actions.

J
Joseph Zuanger author 3/4/2007

Enable guest login. Use User group permissions to allow guest user access some page and perform some actions.


Hi,

Thanks for the help. It works. However, I want the guest to only view the list.asp, not the view.asp page. In the asprunner, I can not separate list and view pages, permission wise.
Pls let me know what is the best way to implement this.

Joe

J
Jane 3/5/2007

Joseph,
you can create custom view of this table for the guests only and uncheck View page for this View.

J
Joseph Zuanger author 3/5/2007

Joseph,

you can create custom view of this table for the guests only and uncheck View page for this View.


Jane,

Thanks!

But is possible to creat a event code and check before the view is open? If the user is the guest and then direct to the login page. I have copy the security check code on the asp code, but do not know how to modify this:
if SESSION("UserID")="" or not CheckSecurity(SESSION("OwnerID"),"Search") then

SESSION("MyURL")=request.ServerVariables("SCRIPT_NAME")&"?"&request.ServerVariables("QUERY_STRING")

response.Redirect "login.asp?message=expired"

response.End

end if
Thanks!

Joe

J
Jane 3/5/2007

Joe,
to redirect to the login page use following code in the ViewOnLoad event:

if Session("UserID")="" or Session("UserID")="Guest" then

%><script>

window.location='./login.asp';

</script><%

end if

J
Joseph Zuanger author 3/5/2007

Joe,

to redirect to the login page use following code in the ViewOnLoad event:


Jane,

It is not working. With above code, the view page can still be viewed by Guest.
I am thinking to complish the goal by removing the security check on the list page. Is there any way to remove the security check of a specific page?

Thanks!

Joe

Sergey Kornilov admin 3/6/2007

You can also modify generated ..._view.asp file removing the following code snippet:

if SESSION("UserID")="" or not CheckSecurity(SESSION("OwnerID"),"Search") then

SESSION("MyURL")=request.ServerVariables("SCRIPT_NAME")&"?"&request.ServerVariables("QUERY_STRING")

response.Redirect "login.asp?message=expired"

response.End

end if


This will remove security check on the View page.