Print Page | Close Window

Integrated Login system?

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=20793
Printed Date: 29 March 2026 at 2:09pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Integrated Login system?
Posted By: bikeweb
Subject: Integrated Login system?
Date Posted: 24 July 2006 at 11:35am
Is there a way to integrate the login system for the web wiz forum to use as a general login system for the rest of my website?  I have some sections that I would like to have secure for members only and I would like for them not to have more than one login for the website.
 
I tried to see if there was a way to track their session and see if they were logged in and then redirect them to a form if they are not but I'm not quite sure where to start.  Previously I had used the spooky login system and then developed my own system from there but I don't want to have to reinvent the wheel again.
 
Thanks in advance



Replies:
Posted By: Demon
Date Posted: 24 July 2006 at 12:35pm
common.asp holds all of a logged in user's variables that the forum uses such as lngLoggedInUserID and intGroupID. These are what you'll need to use most of the time on your pages. First you would want to use this code at the top of all the pages that you wish to protect, as well as the page you want the users to be able to login from.
Originally posted by Demon Demon wrote:

<!--#include file="forum/common.asp" -->

You would replace the forum/ directory with the correct directory of your site's forum.

On the page you want the users to log in from, here's some rough code that you may find useful:
Quote 'If the user has not logged in (guest user ID = 2) then show them a quick login form
If lngLoggedInUserID = 2 Then
     Response.Write(" <td align=""right"" class=""smText"">" & _
     vbCrLf & " <form method=""post"" name=""frmLogin"" id=""frmLogin"" action=""forum/login_user.asp" & strQsSID1 & """>" & strTxtQuickLogin & _
     vbCrLf & "   <input type=""text"" size=""10"" name=""name"" id=""name"" style=""font-size: 10px;"" />" & _
     vbCrLf & "   <input type=""password"" size=""10"" name=""password"" id=""password"" style=""font-size: 10px;"" />" & _
     vbCrLf & "   <input type=""hidden"" name=""NS"" id=""NS"" value=""1"" />" & _
     vbCrLf & "   <input type=""submit"" value=""" & strTxtGo & """ style=""font-size: 10px;"" />" & _
     vbCrLf & " </form>" & _
     vbCrLf & " </td>")     
End If

Change the red/bold text to the correct forum director for your site. You're gonna also want to structure the html to fit what you want it to look like visually.

On every page that you wish to be protected, or only accessable by your forum members, I suggest you look at the thread in this same forum titled '[MOD] a little firewall' I'll try and find you a link...

-------------
So Sayith the Demon.


Posted By: Demon
Date Posted: 24 July 2006 at 12:37pm
http://webwiz.net/bbs/forum_posts.asp?TID=20669

-------------
So Sayith the Demon.


Posted By: bikeweb
Date Posted: 24 July 2006 at 12:40pm
I'll start working on this.  Thanks for the quick reply.


Posted By: -koen-
Date Posted: 24 July 2006 at 4:11pm
Originally posted by demon demon wrote:

<!--#include file="forum/common.asp" -->
 
This isn't everything you need,
At each page you wan't to lock you need to paste under <!--#include file="common.asp" -->
 
<%
If if intGroupID = 3 or blnadmin then
%>
 
example:
 
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<% If if intGroupID = 3 or blnadmin then %>
 
The red part is what you need to add
 
Group ID is the id of the group you wan't to give premission like 3 the moderators, the easiest way the check the group id is in "manage groups" in admin cp. Move the mouse over and see the ID. blnadmin is administrator this work for mod and admin. At the end of the page paste:
 
<% else
        Response.Redirect("insufficient_permission.asp?M=PAGE")
end if %>


-------------
Don't check me english spelling please...


Posted By: slapmonkay
Date Posted: 24 July 2006 at 6:41pm
I think the easiest way would actully be make a "SiteCommon" file. Include the Forum Common file within the SiteCommon file On the site common file Include the If than statement in there. Then you could change/add stuff without having to change every single page agian.
 
A simple If Than like below should keep guests/banned users out if put into the site common file and all pages you want protected have the site common file included on them:
 
If blnGuest OR lngLoggedInUserID = 0 OR blnBanned = True Then
            Response.Redirect "Forum/insufficient_permission.asp"
End If


Posted By: -koen-
Date Posted: 24 July 2006 at 6:52pm
guest have login ID 2 not 0
And the firewall mod works for ppl that hav acces because of I made an game whit "beta testers" only them may have acces to the download page. Not the newbies, seniors enz. You gett? Watch me topic about the firewall, its reading an DB were I hav stand 1 or 0 so i can turn each page single on or off for mainentrance .
 
And sorry about the Forum/ mistake, I don't hav the forum in an folder


-------------
Don't check me english spelling please...


Posted By: slapmonkay
Date Posted: 24 July 2006 at 7:12pm
Originally posted by -koen- -koen- wrote:

guest have login ID 2 not 0
And the firewall mod works for ppl that hav acces because of I made an game whit "beta testers" only them may have acces to the download page. Not the newbies, seniors enz. You gett? Watch me topic about the firewall, its reading an DB were I hav stand 1 or 0 so i can turn each page single on or off for mainentrance .
 
And sorry about the Forum/ mistake, I don't hav the forum in an folder
 
The Guest ID was my bad... . I would still suggest using a sitecommon file across all files. the sitecommon file would simply check to see if you are logged in and not a guest. If you wanted to give spicific permissions to a certian group I would then suggest putting this at the top of the page then you would not have to have an If than accross the whole page. If at top and End at bottom (its messy that way).

<%
'3 being the group you want access given and 1 being the admin group
if intGroupID <> 3 or intGroupID <> 1 then
Response.Redirect "URL_of_No_Permissions_Page"
End If
%>


Posted By: -koen-
Date Posted: 24 July 2006 at 7:17pm
Srry but i'm already use an file for the firewall mod,
 
example

<% const strpagina="screenshot" %>
<!--#include file="includes/pagina_inc.asp"-->
<% if pagina_stat = 1 or blnadmin then %>
and at the end:

<% else
        Response.Redirect("insufficient_permission.asp?M=PAGE")
end if%>
 
I think this is the best


-------------
Don't check me english spelling please...


Posted By: slapmonkay
Date Posted: 24 July 2006 at 7:21pm
Originally posted by -koen- -koen- wrote:

Srry but i'm already use an file for the firewall mod,
 
example

<% const strpagina="screenshot" %>
<!--#include file="includes/pagina_inc.asp"-->
<% if pagina_stat = 1 or blnadmin then %>
and at the end:

<% else
        Response.Redirect("insufficient_permission.asp?M=PAGE")
end if%>
 
 
Thats fine it works! But when you are checking permissions and you want to keep it short my example would be the shortest and cleanest. I was just throwing it out there so if anyone else needs it they have it.


Posted By: -koen-
Date Posted: 24 July 2006 at 7:36pm
bikeweb are you done or still need help?
 
because of I'm going soon release the littelfire wall and I need people to test


-------------
Don't check me english spelling please...


Posted By: Scotty32
Date Posted: 25 July 2006 at 9:05am
Originally posted by demon demon wrote:

<!--#include file="forum/common.asp" -->
This isn't everything you need,
At each page you wan't to lock you need to paste under <!--#include file="common.asp" -->
 
<%
If if intGroupID = 3 or blnadmin then
%>
 
example:
 
<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<% If if intGroupID = 3 or blnadmin then %>
 
The red part is what you need to add
 
Group ID is the id of the group you wan't to give premission like 3 the moderators, the easiest way the check the group id is in "manage groups" in admin cp. Move the mouse over and see the ID. blnadmin is administrator this work for mod and admin. At the end of the page paste:
 
<% else
        Call closeDatabase()
        Response.Redirect("insufficient_permission.asp?M=PAGE")
end if %>


you forgot one of the most important parts - the part in green.

and for a better way of doing this would be:

<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->
<%
      If intGroupID = 3 or blnadmin then
      else
           Call closeDatabase()
           Response.Redirect("insufficient_permission.asp?M=PAGE")
     end if
%>



-------------
S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins

For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .


Posted By: -koen-
Date Posted: 25 July 2006 at 9:16am

Oh thanks scotty32,

I know I did forget something but not what.

<% @ Language=VBScript %>
<% Option Explicit %>
<!--#include file="common.asp" -->

<%
      If intGroupID = 3 or blnadmin then
      else
           Call closeDatabase()
           Response.Redirect("insufficient_permission.asp?M=PAGE")
     end if
%>

And is that way you did faster or better? I wanna know else I have to chance whole MOD...
Right now i use this for the mod:

<% Call closeDatabase()
const strpagina="download" %>
<!--#include file="includes/pagina_inc.asp"-->
<% if pagina_status = 1 or blnadmin then %>
and at the end

<% else
        Response.Redirect("insufficient_permission.asp?M=GAME")
end if%>


-------------
Don't check me english spelling please...



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