Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Simple vB User login and access control on non vB pages Details »»
Simple vB User login and access control on non vB pages
Version: 1.30, by Billspaintball Billspaintball is offline
Developer Last Online: Nov 2011 Show Printable Version Email this Page

Version: 3.5.8 Rating:
Released: 11-16-2005 Last Update: 04-23-2007 Installs: 138
Additional Files  
No support by the author.

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.5 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.5.x - All Versions


Changelog

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

Version 1.20 (2nd December 2006)
  • Fixed Logout incorrect path bug
  • Made change to reduce compatibility problems with foreign scripts

Version 1.10 (4th Feb 2006)
  • Changed login_inc.php so you only need to edit path in one place now.
  • Added more commenting to login_inc.php
  • Added usage instructions to instructions file
  • Added troubleshooting guide with all common problems and fixes to instructions file.
Note: It is NOT necessary to update from 1.0 to 1.10.
There is no functionality changes or bug fixes between these 2 releases.

Version 1.0 (17th November 2005)
  • Initial Release


Deluxe Version of this hack is now available
Has Avatars, PM's, Number of Posts etc.

Click Here


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

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #152  
Old 06-10-2006, 03:32 AM
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Location: Bathurst, Au
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, try this.
Right at the top of the page put
PHP Code:
<?php 
$curdir 
getcwd ();
chdir('/path/to/your/forums');    
require_once(
'/path/to/your/forums/global.php'); 
chdir ($curdir);
?>
and put the login box where ever with
PHP Code:
<?php   
// And we put this where we want the login box 
    
require_once('/path/to/your/login_inc.php');   
?>
let us know if this works, If not, I will need the exact error message before I can look any further.
Reply With Quote
  #153  
Old 06-10-2006, 09:42 AM
Munnday Munnday is offline
 
Join Date: Jul 2002
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I receive the following error:
Quote:
Warning: array_keys(): The first argument should be an array in /includes/functions.php on line 3277

Warning: Invalid argument supplied for foreach() in /includes/functions.php on line 3277

Fatal error: Call to a member function on a non-object in /home/.katona/wisemonkeys/www.4wisemonkeys.com/community/includes/functions.php on line 2502
Reply With Quote
  #154  
Old 06-14-2006, 02:25 AM
evenmonkeys's Avatar
evenmonkeys evenmonkeys is offline
 
Join Date: Aug 2004
Location: Iowa
Posts: 896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I am not able to run this and I have gone through the troubleshooting steps that you have provided. I am running my main site on http://website.com and I am running my forum on http://forums.website.com. I've tried using website.com/forums as well, but that is not working either. Other than the steps you have provided, do you have any other recommendations?

The reason I'm still curious is because I had the vBadvanced CMPS working on my website before, and I had it set up the exact same way. However, I am unable to figure out what made what tick. Let me know please.
Reply With Quote
  #155  
Old 06-14-2006, 08:12 AM
nonstop nonstop is offline
 
Join Date: Jun 2006
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Yarub
I am not able to run this and I have gone through the troubleshooting steps that you have provided. I am running my main site on http://website.com and I am running my forum on http://forums.website.com. I've tried using website.com/forums as well, but that is not working either. Other than the steps you have provided, do you have any other recommendations?

The reason I'm still curious is because I had the vBadvanced CMPS working on my website before, and I had it set up the exact same way. However, I am unable to figure out what made what tick. Let me know please.
I would suggest looking at the error log file for the site in question and see if it gives some errors to point were the problem. I had a similar problem as I just recently setup the forums on something like forum.mydomain.com and the site with the loging on www.mydomain.com (these are examples). Since the location of the files for each of these domains are in totally different directory structures the php configuration open_basedir refused to all the include for security reasons (value open_basedir was set to null which means that I can include anything below the directoy of the script calling). Not sure if this may be your problem with the installation with the forums in a separate directory or not. Its all based on physical file location. If this is the problem you might have the option of having your admin set the open_basedir configuration specific to your domain such that you can include the files needed from the forums. Here is the link on php site relating to the open_basedir http://us2.php.net/features.safe-mode. Hope this helps.
Reply With Quote
  #156  
Old 06-15-2006, 04:18 PM
s.blair s.blair is offline
 
Join Date: Jan 2006
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great looking hack!

I've got the basics of it working on my site.

However I need to control access based on secondary 'additional' user groups rather than the primary usergroup id.

How can I have it check to see if the user is in the array of membergroup id's instead of a single usergroup?

Thanks.
Scott
Reply With Quote
  #157  
Old 06-17-2006, 02:11 PM
Majava Majava is offline
 
Join Date: Jun 2006
Location: East Sussex, England
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, i need help please.. i added the login box on the index page, works great. but when i try and access the other pages. i get the following error.

Code:
Warning: main(includes/0.php) [function.main]: failed to open stream: No such file or directory in /usr/home/web/wse90457/index.php on line 180

Warning: main() [function.include]: Failed opening 'includes/0.php' for inclusion (include_path='.:/usr/local/share/pear') in /usr/home/web/wse90457/index.php on line 180
I think its because my index page includes other files from /includes/ for the other pages. so basically everything is run through the index page. If you want to view it go here. www.silkroad-oasis.com.


also, if you go to http://www.silkroad-oasis.com and login on the box, it logs in and works fine, but if you go to http://silkroad-oasis.com and try and login, it logs you in, but still shows the login boxes. how to fix?

Please help. Thanks
Reply With Quote
  #158  
Old 06-19-2006, 10:27 AM
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Location: Bathurst, Au
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Majava
I think its because my index page includes other files from /includes/ for the other pages. so basically everything is run through the index page. If you want to view it go here. www.silkroad-oasis.com.


also, if you go to http://www.silkroad-oasis.com and login on the box, it logs in and works fine, but if you go to http://silkroad-oasis.com and try and login, it logs you in, but still shows the login boxes. how to fix?

Please help. Thanks
Have you tried steps 3 and 4 in the troubleshooting guide yet?
Reply With Quote
  #159  
Old 06-20-2006, 04:04 PM
Majava Majava is offline
 
Join Date: Jun 2006
Location: East Sussex, England
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Billspaintball
Have you tried steps 3 and 4 in the troubleshooting guide yet?

ok, Step 3 had already been done. by default? i dont know.

I dont both things in step 4, but still i get the following errors on every other page, but it did sort out the login box problem,

Code:
Warning: main(includes/0.php) [function.main]: failed to open stream: No such file or directory in /usr/home/web/wse90457/index.php on line 180

Warning: main() [function.include]: Failed opening 'includes/0.php' for inclusion (include_path='.:/usr/local/share/pear') in /usr/home/web/wse90457/index.php on line 180
my index file is used as the main page.. when someone clicks a new page on the site the index file finds the included file and uses it. eg. index.php ---> index.php?page=status

Is there anyway to fix this warning?
Reply With Quote
  #160  
Old 06-20-2006, 11:07 PM
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Location: Bathurst, Au
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Majava
ok, Step 3 had already been done. by default? i dont know.

I dont both things in step 4, but still i get the following errors on every other page, but it did sort out the login box problem,
Yes, those steps in the troubleshooting guide will only fix the login box, not your other path problems, its two seperate issues.

Quote:
Is there anyway to fix this warning?
It looks like its a path problem, could well be caused because the path is set to your forums directory for global.php.
Try changing
Code:
<?php  
chdir('/path/to/your/forums');     
require_once('/path/to/your/forums/global.php');  
?>
to
Code:
<?php  
$curdir = getcwd (); 
chdir('/path/to/your/forums');     
require_once('/path/to/your/forums/global.php');  
chdir ($curdir); 
?>
Reply With Quote
  #161  
Old 06-21-2006, 08:46 AM
Majava Majava is offline
 
Join Date: Jun 2006
Location: East Sussex, England
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nope, still same error.

Do i need to put that still in everypage? or just the index page?

and if you need me to, i can post the index page php code.
Reply With Quote
  #162  
Old 06-22-2006, 05:11 AM
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Location: Bathurst, Au
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Majava
Do i need to put that still in everypage? or just the index page?
.
If everything is just included into the index page thats the only spot you would need to put it.

You can post the index page code if you like and I will have a look for anything obvious.
Reply With Quote
  #163  
Old 06-22-2006, 08:58 AM
Majava Majava is offline
 
Join Date: Jun 2006
Location: East Sussex, England
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is at the top
PHP Code:
<?php
   chdir
('/path/to/forum'); 
   require_once(
'/path/to/forum/global.php');  

    
// Do not edit anything below this line
    // Do not edit anything below this line
    
session_start();

    
// You can now edit below this line
    // You can now edit below this line
?>
PHP Code:
            <?php
            $page 
$_GET['page'];
            
            if ((
$page == "news") || ($page == "status") || ($page == "armour") || 
                (
$page == "protector") || ($page == "garment") || ($page == "swords") || 
                (
$page == "blades") || ($page == "spears") || ($page == "glaives") || 
                (
$page == "bow") || ($page == "jewlery") || ($page == "accesories") || 
                (
$page == "skills") || ($page == "guides") || ($page == "guilds") || 
                (
$page == "quests") || ($page == "maps") || ($page == "faq") || 
                (
$page == "movies") || ($page == "screenshots") || ($page == "pictures") || 
                (
$page == "wallpapers") || ($page == "art") || ($page == "downloads") || 
                (
$page == "links") || ($page == "contact") || ($page == "jobs") || 
                (
$page == "irc") || ($page == "main") || ($page == "potions") ||
                (
$page == "scrolls") || ($page == "thanks") || ($page == "error_job") ||
                (
$page == "explist") || ($page == "mailthanks") || ($page == "register") ||
                (
$page == "lostpw")) {
    
                include(
"includes/".$page.".php");     
            } else if (
$page == "") {
                include(
"includes/main.php");
            } else {        
//                include("includes/broken.php"); 
            
}     
            
?>
This is my main code
Reply With Quote
  #164  
Old 06-23-2006, 03:14 AM
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Location: Bathurst, Au
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

[QUOTE=Majava]This is at the top
PHP Code:
<?php
   chdir
('/path/to/forum'); 
   require_once(
'/path/to/forum/global.php');  

    
// Do not edit anything below this line
    // Do not edit anything below this line
    
session_start();

    
// You can now edit below this line
    // You can now edit below this line
?>
Try something like

PHP Code:
<?php  
session_start
();
$curdir getcwd (); 
chdir('/path/to/your/forums');     
require_once(
'/path/to/your/forums/global.php');  
chdir ($curdir); 
?>
If that fails to work then it looks like both scripts are just incompatible
Reply With Quote
  #165  
Old 06-24-2006, 09:07 AM
Dark s.s. Trunk's Avatar
Dark s.s. Trunk Dark s.s. Trunk is offline
 
Join Date: Apr 2004
Location: Good Guestion its dark
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have a strange problem lol i seem to be permittly logged in. Now on my forums when i log off and go to main forum page it shows me as logged in, and on the page i put the code i hit log out goes to forums cookies cleared aand all but when it goes back to page still logged in,, even cleared IE cashe and still does it
----------------
Edit: that problem was bad cashe in IE but now ran into another problem, i have 2 php files i use one has a bit different b/c of the way i display some pages but works perfect on mainpage.php but any file that seems to use my mainpage2.php it goes to log in but keeps telling me to log in but still logged in on mainpage.php.. all ode for login exact same.

Note seems pages dun work on anything linked to in the address bar like thsi http://twistedeffects.com/mainpage.p...iles/tutorials
Reply With Quote
  #166  
Old 06-25-2006, 10:28 AM
hurry hurry is offline
 
Join Date: Feb 2006
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by AutoXer
I fixed it. Here's how:

AdminCP -> vBulletin Options -> Cookies and HTTP Header Options -> Path to Save Cookies

I changed the 'Suggested Settings' dropdown from '/forums/' to '/'
I did this but it still does not work for me and gives me the forum logged in screen and then again returns back to the page without being logged in. Please help.
Reply With Quote
Reply


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


All times are GMT. The time now is 04:41 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09591 seconds
  • Memory Usage 2,411KB
  • Queries Executed 30 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (6)bbcode_php
  • (8)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete