Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Integrated Login system?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Integrated Login system?

 Post Reply Post Reply Page  12>
Author
bikeweb View Drop Down
Newbie
Newbie


Joined: 24 July 2006
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote bikeweb Quote  Post ReplyReply Direct Link To This Post Topic: Integrated Login system?
    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
Back to Top
Demon View Drop Down
Mod Builder Group
Mod Builder Group
Avatar
Mod-n-Skin Moderator

Joined: 26 July 2003
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote Demon Quote  Post ReplyReply Direct Link To This Post 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...

Edited by Demon - 24 July 2006 at 12:35pm
So Sayith the Demon.
Back to Top
Demon View Drop Down
Mod Builder Group
Mod Builder Group
Avatar
Mod-n-Skin Moderator

Joined: 26 July 2003
Status: Offline
Points: 299
Post Options Post Options   Thanks (0) Thanks(0)   Quote Demon Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2006 at 12:37pm
http://webwiz.net/bbs/forum_posts.asp?TID=20669
So Sayith the Demon.
Back to Top
bikeweb View Drop Down
Newbie
Newbie


Joined: 24 July 2006
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote bikeweb Quote  Post ReplyReply Direct Link To This Post Posted: 24 July 2006 at 12:40pm
I'll start working on this.  Thanks for the quick reply.
Back to Top
-koen- View Drop Down
Groupie
Groupie
Avatar

Joined: 22 February 2006
Location: Netherlands
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote -koen- Quote  Post ReplyReply Direct Link To This Post 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...
Back to Top
slapmonkay View Drop Down
Newbie
Newbie


Joined: 13 July 2006
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote slapmonkay Quote  Post ReplyReply Direct Link To This Post 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


Edited by slapmonkay - 24 July 2006 at 6:42pm
Back to Top
-koen- View Drop Down
Groupie
Groupie
Avatar

Joined: 22 February 2006
Location: Netherlands
Status: Offline
Points: 54
Post Options Post Options   Thanks (0) Thanks(0)   Quote -koen- Quote  Post ReplyReply Direct Link To This Post 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


Edited by -koen- - 24 July 2006 at 6:57pm
Don't check me english spelling please...
Back to Top
slapmonkay View Drop Down
Newbie
Newbie


Joined: 13 July 2006
Status: Offline
Points: 21
Post Options Post Options   Thanks (0) Thanks(0)   Quote slapmonkay Quote  Post ReplyReply Direct Link To This Post 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
%>
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.