Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 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: 2.00, by Billspaintball Billspaintball is offline
Developer Last Online: Nov 2011 Show Printable Version Email this Page

Category: Integration with vBulletin - Version: 3.7.0 RC 1 Rating:
Released: 03-20-2008 Last Update: Never Installs: 100
Re-useable Code Additional Files Translations  
No support by the author.

Hack Description

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

This uses the vB 3.7 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 displaying 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 don't 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.7 RC1


Change log

Version 2.00 (21st March 2008)
  • Initial vB 3.7.x release



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
  #12  
Old 05-14-2008, 06:23 AM
texas_txu texas_txu is offline
 
Join Date: Mar 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

still running into issues...the login page that is generated makes links for the registration page and the login script to the /music/log.php etc...rather than /forums/login.php. even the logo is messed up
Reply With Quote
  #13  
Old 05-15-2008, 06:36 PM
justchil justchil is offline
 
Join Date: Sep 2005
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Super simple and works great!
Reply With Quote
  #14  
Old 05-15-2008, 06:52 PM
pdblizzard's Avatar
pdblizzard pdblizzard is offline
 
Join Date: Jun 2003
Location: Illinois
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by texas_txu View Post
still running into issues...the login page that is generated makes links for the registration page and the login script to the /music/log.php etc...rather than /forums/login.php. even the logo is messed up
Maybe if you post more information, i.e., the php code with your path statements (the part you're supposed to customize) we can help you out.
Reply With Quote
  #15  
Old 05-16-2008, 07:07 AM
texas_txu texas_txu is offline
 
Join Date: Mar 2008
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by longin_inc.php
<?php
// Version 2.00
// Released March 21st, 2008
// For vB 3.7.x
// Edit the line below to show path to your forums
$forumpath = "./forums/";

also tried with
$forumpath = "https://www.mydomain.com/forums/"; (yes secure domain)
$forumpath = "c:\domains\mydomain\wwwroot\forums"; (IIS Server nomenclature)
and my php test file looks like (in mydomain.com/forums/music with login_inc in mydomain.com/:
Quote:
<?php
$curdir = getcwd ();
chdir('../forums');
require_once('../forums/global.php');
echo getcwd();
chdir ($curdir);
echo getcwd();
?>

....

<?php
echo getcwd();
require_once('../login_inc.php');
?>
Reply With Quote
  #16  
Old 05-18-2008, 01:08 PM
berry05 berry05 is offline
 
Join Date: Dec 2007
Posts: 171
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i did this hack and got this error...

Unable to add cookies, header already sent.
File: /home/content/b/e/r/berry05/html/tyler.php
Line: 3

and i did what the troubleshooting told me to do also...
Reply With Quote
  #17  
Old 05-31-2008, 11:59 PM
oz_girl's Avatar
oz_girl oz_girl is offline
 
Join Date: Mar 2008
Location: Australia
Posts: 48
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This si another awesome mod, will it be to hard for a newbie to use?
Reply With Quote
  #18  
Old 08-03-2008, 09:04 PM
fsbmax's Avatar
fsbmax fsbmax is offline
 
Join Date: Aug 2007
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i keep getting errors :s

Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/fragreel/public_html/td2142/template/header.inc.php on line 4

Warning: require_once(/home/fragreel/td2142/forum/global.php) [function.require-once]: failed to open stream: No such file or directory in /home/fragreel/public_html/td2142/template/header.inc.php on line 5

Fatal error: require_once() [function.require]: Failed opening required '/home/fragreel/td2142/forum/global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/fragreel/public_html/td2142/template/header.inc.php on line 5
Reply With Quote
  #19  
Old 08-04-2008, 06:31 AM
Hereward Hereward is offline
 
Join Date: Jun 2008
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wonder if its possible to see a working example rather than just the code snippets?

PHP Code:
<?php
If ($vbulletin->userinfo['userid']!=0)
    {    
    echo 
"Your logged in so we can display this";
    } else {
    echo 
"Your not logged in so we display this";
    }
?>
I am looking to create a page (within a separate CMS) which checks to see if the current user is authenticated against the forum. This code above looks promising but it seems incomplete.

I am wondering, where is the variable $vbulletin created? Does it need to be declared as a global?

cheers (:
Reply With Quote
  #20  
Old 08-06-2008, 11:22 PM
ramsayeg ramsayeg is offline
 
Join Date: Mar 2008
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

have some problems with this, the form works OK but when it returns to the page it still doesn't show me as logged on...

I did everything in the instructions... anyone cares to help?
Reply With Quote
  #21  
Old 08-07-2008, 07:34 AM
ramsayeg ramsayeg is offline
 
Join Date: Mar 2008
Posts: 63
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

anyone?

I even managed to lock myself out by changing the cookie domain etc. and then had to reverse it by using tools.php. I'd love some ideas....
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 07:04 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.05309 seconds
  • Memory Usage 2,309KB
  • Queries Executed 25 (?)
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
  • (1)bbcode_php
  • (3)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
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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