Print Page | Close Window

Using WWF as a Login Manager

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=17566
Printed Date: 29 March 2026 at 5:00pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Using WWF as a Login Manager
Posted By: bhall007
Subject: Using WWF as a Login Manager
Date Posted: 16 December 2005 at 3:03pm
I was wondering if there was any way to use Web Wiz Forums as a login manager to password-protect certain pages using the same user database as WWF.  I tried inserting the following into the header of a test .asp file to see if it would prompt to authenticate before accessing the page:

<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="forum/common.asp" -->
But it did nothing and still accessed the page.  I am aware of the Breath of Air Login Manager and the plug-in that allows you to link to the WWF database.

I wonder if it's possible to simply insert some "include" into the header of an .asp file to protect it and take you to the login page and require a login before it will display the page.

Thanks!




Replies:
Posted By: arpee
Date Posted: 29 December 2005 at 3:25pm
That's an extremely simple thing to do. If you still need help let me know


Posted By: bhall007
Date Posted: 29 December 2005 at 9:55pm
arpee,

Thanks for the reply--I was starting to lose hope.

Please, share!

Smile


Posted By: arpee
Date Posted: 29 December 2005 at 10:33pm
Assuming these pages are on the same site as your forum.
 
At the top of each page you want to protect:
 

If Session("IsLoggedOn") <> True then

            Response.Redirect("/forum/insufficient_permission.asp")
            'Or anywhere else you want to send them
 
             Response.End
End If


Posted By: bhall007
Date Posted: 30 December 2005 at 2:40pm
arpee,

Thanks for the reply.  I tried including the above at the very top of a test ASP file, but it didn't work.  What else am I missing?  Sorry!  I'm not an ASP programmer--noob!  Thanks!


Posted By: dpyers
Date Posted: 30 December 2005 at 4:47pm
You'll need to provide a little more detail than "it didn't work".Wink

Try turning off friendly http errors and then posting the entire error you receive.


-------------

Lead me not into temptation... I know the short cut, follow me.


Posted By: arpee
Date Posted: 30 December 2005 at 9:08pm
Yes, do what dpyers said. The code will work if on the same site as your forum.
 
Be sure you encapsulate the code :
 

<%

If Session("IsLoggedOn") <> True then
            Response.Redirect("/forum/insufficient_permission.asp")
            'Or anywhere else you want to send them
 
             Response.End
End If
%>


-------------
We're all stars. Some just shine brighter than others.


Posted By: aks427
Date Posted: 30 December 2005 at 11:43pm
Make sure you have the include file you had over that code that bhall007 posted.  It'll look something like this...
<!--#include file="forum/common.asp" -->

If Session("IsLoggedOn") <> True then

            Response.Redirect("/forum/insufficient_permission.asp")
            'Or anywhere else you want to send them
 
             Response.End
End If


Posted By: bhall007
Date Posted: 31 December 2005 at 2:58am
Sorry for the lack of detail!  Ouch

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!


Posted By: arpee
Date 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.


Posted By: dpyers
Date 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.


Posted By: bhall007
Date 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!




Posted By: bhall007
Date 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!


Posted By: arpee
Date 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.


Posted By: bhall007
Date 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!



Posted By: arpee
Date 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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net