| Author |
Topic Search Topic Options
|
bhall007
Newbie
Joined: 22 November 2005
Status: Offline
Points: 23
|
Post Options
Thanks(0)
Quote Reply
Posted: 31 December 2005 at 2:58am |
Sorry for the lack of detail!  When I included the above code provided by arpee, it simply showed the code in the web page at the top, and then it showed the rest of the page normally. The file was a normal html file, that I renamed to .asp and simply inserted the above code at the top. I assume that I'm missing something else. Thanks in advance!
|
 |
arpee
Groupie
Joined: 09 November 2004
Status: Offline
Points: 57
|
Post Options
Thanks(0)
Quote Reply
Posted: 31 December 2005 at 11:03am |
Show us your code. Did you include the opening <% and closing %> around the code?
And there is no need to include the common.asp file if all you're doing is checking if the user is logged on. Session values work without it.
|
|
We're all stars. Some just shine brighter than others.
|
 |
dpyers
Senior Member
Joined: 12 May 2003
Status: Offline
Points: 3937
|
Post Options
Thanks(0)
Quote Reply
Posted: 31 December 2005 at 5:17pm |
|
Just to recap... the file must end in .asp, and you have to have asp code begine with <% and end with %>. Common.asp is not required.
If you're testing it on your own local pc, IIS has to be running.
|
Lead me not into temptation... I know the short cut, follow me.
|
 |
bhall007
Newbie
Joined: 22 November 2005
Status: Offline
Points: 23
|
Post Options
Thanks(0)
Quote Reply
Posted: 31 December 2005 at 8:56pm |
Okay, Here is the code that I insert at the top of the document: <%
If Session("IsLoggedOn") <> True then Response.Redirect("../forum/insufficient_permission.asp")
Response.End End If
%>
I'm getting a lot further than before. However, after I actually login to the forum, and then I go back to the page, it still redirects. I would like the page to allow me to stay on it as long as I am logged in. I'm using WWF v. 7.9. Thanks!
|
 |
bhall007
Newbie
Joined: 22 November 2005
Status: Offline
Points: 23
|
Post Options
Thanks(0)
Quote Reply
Posted: 03 January 2006 at 4:37pm |
The file is called index.asp, and the code at the top of the page is: <%
If Session("IsLoggedOn") <> True then Response.Redirect("../forum/insufficient_permission.asp")
Response.End End If
%>
It seems to run the code correctly (forwards to the login page). However, after logging in, it takes you to the main forum (and not the original page that referred me). But when I try to manually access the original page after I am logged in, it still refers me to the login page instead of granting access like it should. Any suggestions would be greatly appreciated.
Thanks!
|
 |
arpee
Groupie
Joined: 09 November 2004
Status: Offline
Points: 57
|
Post Options
Thanks(0)
Quote Reply
Posted: 03 January 2006 at 11:50pm |
OK, do this....
Change the code above on your page you want to protect to this...
<%
If Session("IsLoggedOn") <> True then Response.Redirect("../forum/insufficient_permission.asp") Session("ReturnPage")=Request.ServerVariables ("PATH_INFO")&"?"&Request.Querystring
Response.End
Else
Session("ReturnPage")=""
End If
%>
Edit login_user.asp like this (test in red is my addition)
'Return to forum homepage
Else
If Session("ReturnPage")<>"" then
Response.Redirect(Session("ReturnPage"))
Else
Response.Redirect("/forum.idc?show=login_user_test")
End If
End If
|
|
We're all stars. Some just shine brighter than others.
|
 |
bhall007
Newbie
Joined: 22 November 2005
Status: Offline
Points: 23
|
Post Options
Thanks(0)
Quote Reply
Posted: 06 January 2006 at 7:49pm |
|
I inserted the above exact code posted by arpee into the top of the asp file I'm trying to protect. I also replaced the code in the section of /forum/login_user.asp. When I access the page, it correctly forwards me to the login page, so I login, and it takes me back to the forum. I then try to access the original page (the one I'm trying to password protect) after logging into the forum, but it continues to forward me to insufficient_permission.asp (and shows me logged into the forum).
Objectives:
1) After logging in on the insufficient_permission.asp page, then allow access to the original referring page.
2) After logging into the forum on the insufficient_permission.asp page, redirect back to the original referring page. (could live without this)
Thanks in advance!
|
 |
arpee
Groupie
Joined: 09 November 2004
Status: Offline
Points: 57
|
Post Options
Thanks(0)
Quote Reply
Posted: 08 January 2006 at 12:54pm |
bhall - I'm sorry I forgot one very important piece of code.
You need to add Session("IsLoggedOn") = True to the login_use.asp page, like this:
'Return to forum homepage
Else
Session("IsLoggedOn") = True If Session("ReturnPage")<>"" then
Response.Redirect(Session("ReturnPage"))
Else
Response.Redirect("/forum.idc?show=login_user_test")
End If
End If
|
|
We're all stars. Some just shine brighter than others.
|
 |