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
  #212  
Old 10-06-2006, 04:12 PM
Jon.'s Avatar
Jon. Jon. is offline
 
Join Date: Dec 2005
Location: Kent, UK
Posts: 79
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello

Having problems with it logging me in. I've got my forum at thecarforum.net, and this page at imagecan.net. Both the forum folder and the imagecan folder are in my public html folder.

All logs in fine, but it just can't remember me. I log in and then it's forgotten about it. My cookie domain and path are both set to blank. Any ideas?
Reply With Quote
  #213  
Old 10-07-2006, 09:55 PM
TosaInu's Avatar
TosaInu TosaInu is offline
 
Join Date: Jul 2004
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the examples Billspaintball, they really helped me out.

Now I'm about to add a link into a template and I run into another problem. Normally <a href ="http://domain/vb/script.php" target="_blank">Script</a> works without problems. But when using something like that on a log page I just get a new blank screen that says about blank.

Just calling the page directly in the browser works fine. I tried things like ?[sessionurl], but that doesn't work. How to call a page inside a template?

There's at least a problem with the trailingslash in forumpath and
Code:
// If logged in display logout link
echo "<a href=\"".$forumpath."login.php?$session[sessionurl]do=logout&amp;logouthash=$logouthash";
in login_inc.php
forumpath should not have trailing and logout
Code:
// If logged in display logout link
echo "<a href=\"".$forumpath."/login.php?$session[sessionurl]do=logout&amp;logouthash=$logouthash";
Reply With Quote
  #214  
Old 10-10-2006, 08:16 PM
TosaInu's Avatar
TosaInu TosaInu is offline
 
Join Date: Jul 2004
Posts: 256
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Seems to be a browserissue, it also happens when the link to the login protected PHP is posted in a forumtopic. Firefox opens the page, but IE gives the about blank page. When looking closely, it actually requests the script URL but quickly procedes with the about blank page.
Reply With Quote
  #215  
Old 10-15-2006, 08:39 AM
johnn johnn is offline
 
Join Date: Jul 2004
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Billspaintball
Try this.
It should change you back to the origional directory.

PHP Code:
<?php  
$curdir 
getcwd (); 
chdir('/path/to/your/forums');     
require_once(
'/path/to/your/forums/global.php');  
chdir ($curdir); 
?>

PS, if this works and you use this hack please click instal

That all worked for me, but when I attempt to use one of the php scripts I wrote, it isn't letting this script insert data into my MySQl database. It's an information script. It'll read the data from the mysql db just fine, but when I try to use a webpased php form to submit/edit information to my DB it doesn't work.

I don't get any PHP errors, it just.....doesn't work..Lol.

When I remove all the chdir things and forum inclusions for my login/page restrictions it works just fine.

Any thoughts on this?
Reply With Quote
  #216  
Old 11-01-2006, 01:43 AM
masss masss is offline
 
Join Date: Sep 2006
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok now if this would just work with the new forums
Reply With Quote
  #217  
Old 11-01-2006, 06:41 AM
wingVTA wingVTA is offline
 
Join Date: Oct 2006
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi guys....

I get a problem tryig to incorporate this script!!

I actually get this problem with a lot of scripts!!

Quote:
Notice: Undefined index: REQUEST_URI in C:\Sites\Single30\vtamundane\webroot\forum\include s\class_core.php on line 1907

Notice: Undefined index: REQUEST_URI in C:\Sites\Single30\vtamundane\webroot\forum\include s\class_core.php on line 1907

Notice: Undefined index: PATH_INFO in C:\Sites\Single30\vtamundane\webroot\forum\include s\class_core.php on line 1913

Notice: Undefined index: PATH_INFO in C:\Sites\Single30\vtamundane\webroot\forum\include s\class_core.php on line 1913

Notice: Undefined index: REDIRECT_URL in C:\Sites\Single30\vtamundane\webroot\forum\include s\class_core.php on line 1917

Notice: Undefined index: REDIRECT_URL in C:\Sites\Single30\vtamundane\webroot\forum\include s\class_core.php on line 1917

Notice: Undefined index: HTTP_REFERER in C:\Sites\Single30\vtamundane\webroot\forum\include s\class_core.php on line 1574
Welcome Back, =VTA= teh-wing !
Log Out
^^ But as you can see, it knows who I am and I am logged in!!!

So the code is working!!

The problem is with using the global.php

I have tried adding "define('SKIP_REFERRER_CHECK', true);" to the login.php in the forum, but this does not help with anything...

Does anyone know what is causing this to go wrong, and if there is a way to fix it??

Cheers

wing
Reply With Quote
  #218  
Old 11-02-2006, 12:58 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 masss
Ok now if this would just work with the new forums
New forums?

You mean vB 3.6.x ?
If so, it works fine with 3.6.1 (Havent tested with 3.6.2 but should work)
Reply With Quote
  #219  
Old 11-12-2006, 08:19 PM
masss masss is offline
 
Join Date: Sep 2006
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ok what gives man

Unable to add cookies, header already sent.
File: /home/animelib/public_html/index.php
Line: 1
Reply With Quote
  #220  
Old 11-15-2006, 11:33 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 masss View Post
ok what gives man

Unable to add cookies, header already sent.
File: /home/animelib/public_html/index.php
Line: 1
The first item in the troubleshooting guide is your friend.
https://vborg.vbsupport.ru/showpost....98&postcount=2

You have some whitespace or html before a couple of lines.
Reply With Quote
  #221  
Old 11-24-2006, 08:21 PM
dklassen dklassen is offline
 
Join Date: Oct 2006
Location: Tennessee
Posts: 110
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Got it installed ok and it seems to be working except for the fact that when I put in my user name and password it takes me to my forum but doesn't log me in. Any thoughts? I'm running 3.6.3
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 09:45 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.05082 seconds
  • Memory Usage 2,322KB
  • 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
  • (2)bbcode_code
  • (1)bbcode_php
  • (4)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
  • (1)pagenav_pagelinkrel
  • (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