Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
Simple vB User login and access control on non vB pages Details »
Simple vB User login and access control on non vB pages
Mod Version: 1.10, by Billspaintball (Member) Billspaintball is offline
Developer Last Online: Nov 2011 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.6.5 Rating: (11 votes - 4.82 average) Installs: 195
Released: 02 Dec 2006 Last Update: 24 Apr 2007 Downloads: 1966
Not Supported Additional Files  

Hack Description

This is a cutdown version of the user authentication and access control system I use on the non vB pages on my website.

This uses the vB 3.6 login system to log you in and out. It allows you to move between your forums and other pages on your site while remaining logged in.

It allows you to do things such as restrict pages by usergroup, display different content depending on a user being logged in or not.
For example, you can have banner Adds displying to non members only, and/or let members access to specific content.

Ive cut it down to the bare minimum that it needs to work, no fancy stuff such as avatars, PM's, or even formating.

I will try and offer support, but work and family commitments mean I dont have much free time.

This code is a mix of my own, and pieces I have used from other hacks that are floating around.

This script has been confirmed as working on
  • vB 3.6
  • vB 3.6.1
  • vB 3.6.2
  • vB 3.6.3
  • vB 3.6.4
  • vB 3.6.5


Changelog

Version 1.10 (24th April 2007)
  • Fixed - // in paths bug
  • Fixed - Javascript warning in some browsers
  • Fixed - Tidied up some code

Version 1.0 (2nd December 2006)
  • Very similar to my vB 3.5 version, however logout bug fixed and should be more compatible with other scripts on your page.



Click on Install
If you have this script installed then please click on the install link because;
  • You will get notified if any security issues are reported.
  • You will get notified when there are any upgrades to this script
  • It gives me a warm fuzzy feeling and motivates me to develop more

Donations
First of all, to be clear. This script is 100% free.

However if you feel an urge to donate I'm not going to say no.
Donations can be made at http://www.billspaintball.com/vb3/bd_donate.php

Download Now

Only licensed members can download files, Click Here for more information.

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • If you like this modification support the author by donating.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Similar Mod
Mod Developer Type Replies Last Post
Deluxe vB User login and access control on non vB pages Billspaintball vBulletin 3.5 Add-ons 393 13 Jul 2011 21:50
Integration with vBulletin Deluxe vB User login and access control on non vB pages Billspaintball vBulletin 3.7 Add-ons 76 06 Jun 2011 21:44
Integration with vBulletin Simple vB User login and access control on non vB pages Billspaintball vBulletin 3.7 Add-ons 55 23 Apr 2011 14:52
Integration with vBulletin Deluxe vB user login and access control for non vB pages - REVISED Mastar vBulletin 3.6 Add-ons 12 15 May 2009 16:17
Simple vB User login and access control on non vB pages Billspaintball vBulletin 3.5 Add-ons 254 31 Jan 2009 10:57

  #46  
Old 21 Feb 2007, 02:40
Skeezster Skeezster is offline
 
Join Date: Jun 2003
I ended up putting the variable through the vbulletin variable cleaner which sorted things out nicely.

I'm able to log-in and out fine from any page with the includes, but when I attempt to use the user's name/id in the page then I don't get any result. I'm using the following code in the page:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

And this is up at the top of the page:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #47  
Old 21 Feb 2007, 02:59
Skeezster Skeezster is offline
 
Join Date: Jun 2003
Found the problem - it doesn't like being inside a function. Think I'm sorted now!
Reply With Quote
  #48  
Old 21 Feb 2007, 03:52
SocomNego SocomNego is offline
 
Join Date: Dec 2006
Hmmm error

Ok well I keep on getting an error...here it is

Fatal error: Call to a member function on a non-object in /home/gamesoga/public_html/forums/includes/functions.php on line 1154
Here is my functions.php file from line 1154 to 1174

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.


I have tried to check it out, but I don't have a clue what it could be...
Any help would be much appreciated!!!

Last edited by SocomNego; 21 Feb 2007 at 04:16. Reason: I thought I would add the error page code...
Reply With Quote
  #49  
Old 22 Feb 2007, 04:02
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Real name: Bill
There should be nothing wrong with the functions.php file, the problem will be in the page that has called it.

Have you followed the steps in the troubleshooting guide? http://www.vbulletin.org/forum/showp...79&postcount=2
Including step 5 with the test code.

If you still have problems after this, please post the first few lines of the page you are trying to use this hack on.
Reply With Quote
  #50  
Old 23 Feb 2007, 13:19
HoG HoG is offline
 
Join Date: May 2006
Is it possible to redirect back to the page you accessed the login form from? if so can someone please give me the code to edit?

Thnx
Reply With Quote
  #51  
Old 23 Feb 2007, 19:34
PnL PnL is offline
 
Join Date: Dec 2004
HoG - this always redirects me back to the page from which our members log in.

QUESTION: How do I manipulate the size of the "Log In" button? I'd like to be able to streamline this hack so it fits neatly in a small area, and the button is quite large right now - can I adjust the size of it?
Reply With Quote
  #52  
Old 23 Feb 2007, 20:44
SocomNego SocomNego is offline
 
Join Date: Dec 2006
Originally Posted by Billspaintball View Post
There should be nothing wrong with the functions.php file, the problem will be in the page that has called it.

Have you followed the steps in the troubleshooting guide? http://www.vbulletin.org/forum/showp...79&postcount=2
Including step 5 with the test code.

If you still have problems after this, please post the first few lines of the page you are trying to use this hack on.
Ok here is my code....The funny thing is that I have it on my home page and it works, but on this page it doesn't work even though I set it up the same way....


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Reply With Quote
  #53  
Old 26 Feb 2007, 05:13
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Real name: Bill
Originally Posted by HoG View Post
Is it possible to redirect back to the page you accessed the login form from? if so can someone please give me the code to edit?

Thnx
It should do that automaticly.
Reply With Quote
  #54  
Old 26 Feb 2007, 05:16
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Real name: Bill
Originally Posted by PnL View Post
HoG - this always redirects me back to the page from which our members log in.

QUESTION: How do I manipulate the size of the "Log In" button? I'd like to be able to streamline this hack so it fits neatly in a small area, and the button is quite large right now - can I adjust the size of it?
In the file
login_inc.php
find the line with
// You can style this with html or CSS as normal if desired.
and you will see the login form code.
You can make the boxes smaller by editing
size=10
and/or you can add css or html tags to format the text size/colour/font etc as desired.
Reply With Quote
  #55  
Old 26 Feb 2007, 05:21
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Real name: Bill
Originally Posted by SocomNego View Post
Ok here is my code....The funny thing is that I have it on my home page and it works, but on this page it doesn't work even though I set it up the same way....


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Try changing that bit above to
<?php
$curdir = getcwd ();
chdir('/home/gamesoga/public_html/forums');
require_once('/home/gamesoga/public_html/forums'/global.php');
chdir ($curdir);
?>

If that does not work I suspect that your trying to use a variable named the same as a reserved vB one.
Reply With Quote
  #56  
Old 26 Feb 2007, 18:14
DaveS DaveS is offline
 
Join Date: Apr 2006
Does this mod allow me to use the vB headers and footers?
Reply With Quote
  #57  
Old 26 Feb 2007, 22:23
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Real name: Bill
Originally Posted by DaveS View Post
Does this mod allow me to use the vB headers and footers?
I dont know.
I havent looked into whats involved in calling the vB header and footer templates.
Reply With Quote
  #58  
Old 28 Feb 2007, 17:17
abenoking abenoking is offline
 
Join Date: Sep 2006
Many thanks. This snippet allowed me to do something that I've been begging for support on vb.org for the past several months. Plus, it is super-easy to modify and customize.

My only question, is if you have a complete list of $vbulletin->userinfo[] variables that I can use in conjunction with this mod.
Reply With Quote
  #59  
Old 01 Mar 2007, 14:02
jasbell jasbell is offline
 
Join Date: Feb 2007
Lightbulb Challenges in implementing single authentication/authorization point

This is probably a common request/hack so that is why I am describing what I have done.

I took Billspaintball's script for use as a single point login for my site, with the objective of not letting anyone into my entire site without the correct credentials/authorization. I want to permit access only to user groups 2,5,6,or 7 (registered users, moderators, and admins).

www.mysite.com
www.mysite.com/forums

A page with Bill's script code sits at the root (index.php) and my forum is under /forums. If a non-authorized user comes along I want to bounce him/her back to the ROOT with a message.

First I set the permissions of the usergroups to what I think they should be to stop them from getting nto my site at all, then I also use the following alteration of Bill's code on the root index page:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

The complication arises when I set the permissions of the usergroups of the unauthorized users. I dont want them to see ANYTHING. However, if I set the permissions of these users so that Usergroup Manager>>Forum Viewing Permissions>>Can View Forum == NO, the basic VBulletin authentication stops working correctly and I get a ghostlike home index page that appears like a screwed up version of the forum index page (see 1st attached snapshot). Also, logout stops working (see second attached snapshot).

If I change the permissions and allow my defined set of unauthorized usergroups access to view forums the problem goes away. However, this defeats my goal in preventing these unauthorized users from seeing the forum in the first place and by typing in /forum they can view the forum homepage!

Can anyone can shed light on this and help me achieve what I would like to do?

Thanks!

Jonathan
Attached Images
File Type: jpg on-login-unauthorized.jpg (23.1 KB, 29 views)
File Type: jpg on-logout-unauthorized.jpg (25.1 KB, 28 views)
Reply With Quote
  #60  
Old 09 Mar 2007, 17:18
abenoking abenoking is offline
 
Join Date: Sep 2006
Originally Posted by Skeezster View Post
Found the problem - it doesn't like being inside a function. Think I'm sorted now!
Just thought I would emphasize this, as I missed it the first time, and it hung me up for a couple of days. You cannot call the form or require inside a function.

Any chance for a fix on this though? It would make templating much easier.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 17:55.

Layout Options | Width: Wide Color: