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
  #142  
Old 05-31-2006, 12:24 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 pcwfreak
Is there a way of making it remember a user without the 'Remember me?' checkbox?

Thanks.
Im at work at present so I havent had a chance to try this yet.
It may or may not work, and make sure you back up your login_inc.php first.

Find
PHP Code:
// Display login boxes + button
// You can style this with html or CSS as normal if desired.
echo"
    <form action=""
.$forumpath."/login.php" method=post onsubmit=md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)>
    <script type=text/javascript src=""
.$forumpath."/clientscript/vbulletin_md5.js"></script>
    User Name:<br>
    <input name=vb_login_username type=text id=navbar_username onfocus=if (this.value == '
$vbphrase[username]') this.value = ''; size=10 />
            
    <br>Password:<br>
    <input name=vb_login_password type=password size=10 />
    </br>
        
    <label for=cb_cookieuser_navbar><input name=cookieuser type=checkbox id=cb_cookieuser_navbar value=1 checked=checked />
    Remember Me?<br /></label>
    
        
    <input type=submit title=
$vbphrase[enter_username_to_login_or_register] value="Log In" />
        
    <input type=hidden name=s value=
$session[sessionhash] />
    <input type=hidden name=do value=login />        
    <input type=hidden name=vb_login_md5password />
    <input type=hidden name=vb_login_md5password_utf />

    </form>
"

And replace with
PHP Code:
// Display login boxes + button
// You can style this with html or CSS as normal if desired.
echo"
    <form action=""
.$forumpath."/login.php" method=post onsubmit=md5hash(vb_login_password,vb_login_md5password,vb_login_md5password_utf)>
    <script type=text/javascript src=""
.$forumpath."/clientscript/vbulletin_md5.js"></script>
    User Name:<br>
    <input name=vb_login_username type=text id=navbar_username onfocus=if (this.value == '
$vbphrase[username]') this.value = ''; size=10 />
            
    <br>Password:<br>
    <input name=vb_login_password type=password size=10 />
    </br>
        
    <input type=submit title=
$vbphrase[enter_username_to_login_or_register] value="Log In" />
        
    <input type=hidden name=s value=
$session[sessionhash] />
    <input type=hidden name=do value=login />
    <input type=hidden name=cookieuser id=cb_cookieuser_navbar value=1 checked=checked />    
    <input type=hidden name=vb_login_md5password />
    <input type=hidden name=vb_login_md5password_utf />

    </form>
"

Reply With Quote
  #143  
Old 05-31-2006, 10:32 AM
pcwfreak pcwfreak is offline
 
Join Date: Mar 2006
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It seems to be working properly right now. Thanks!
Reply With Quote
  #144  
Old 05-31-2006, 03:06 PM
ThatsIt ThatsIt is offline
 
Join Date: Apr 2006
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is my situation. I installed the Simple -version on my forum and it was working perfectly. No problems what-so-ever, things were going as smooth as I could hope.

Then I decided to setup a test forum, and proceeded by creating a testvb folder, protected it with htaccess and installed the test forum along with the Simple login extension. This is where the problems begun.

According to vB instructions, the 'Path to Save Cookies' setting (Cookies and HTTP Header options) must be set to the directory of individual forums, if one runs more than one forum on the same domain. In my case, this meant that I set the path on my live forum to '/forums/' and on my test forums to '/testvb/forums/'.

This, of course, meant that the Simple login extension stopped working on my live forums since the 'Path to Save Cookies' setting should be set to '/'. If, on the other hand, I leave the live forums setting to '/', then I am not able to log on to my test forums at all, while the extension works perfectly on the live forums.

Does anyone see a way around this problem, or am I just out of luck. Is it possible to use this extension simultaneously and successfully on test forum thats running on the same domain with the 'live forum'.
Reply With Quote
  #145  
Old 06-06-2006, 12:24 AM
Rated Rated is offline
 
Join Date: Apr 2006
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Really cool hack, but i can't use it because i have a random banner / header script going on, and the..
PHP Code:
<?php 
    chdir
('/path/to/your/forums');  
    require_once(
'/path/to/your/forums/global.php');   
    require_once(
'/path/to/login_inc.php'); 
?>
Makes it no longer work

Dammit, any fix ?
Reply With Quote
  #146  
Old 06-06-2006, 02:01 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 Rated

Dammit, any fix ?
Maybe.
Can you post the first dozen lines or so of your page so we can have a look.
Reply With Quote
  #147  
Old 06-08-2006, 11:24 PM
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Location: Bathurst, Au
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Confirmed working on vB 3.6 Beta 1
Reply With Quote
  #148  
Old 06-09-2006, 03:20 AM
Rated Rated is offline
 
Join Date: Apr 2006
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi bill,

Ive not got the error codes handy - but ill show you my random banner script, if this doesn't help i will add it again and show the error codes that are confliciting with this script.

PHP Code:
<?php 
// Random Picture v0.1 
// (c) Guido Faecke, GF-Data Inc. 

  
$pic_dir 'images/banners/'
   
  
$counter 0

  
$d dir($pic_dir); 
  while(
$entry=$d->read()) { 
    if (
$entry != "." && $entry != "..") { 
      
$array[] = $entry
      
$counter++; 
    } 
  } 
  
$d->close(); 
  
$counter--; 
  
$which rand(0$counter); 
?>
<? echo '<img src="'.$pic_dir.$array[$which].'" border="0">'; ?>
Thanks for the help
Reply With Quote
  #149  
Old 06-09-2006, 03:35 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 Rated
Hi bill,

Ive not got the error codes handy - but ill show you my random banner script, if this doesn't help i will add it again and show the error codes that are confliciting with this script.

PHP Code:
<?php 
// Random Picture v0.1 
// (c) Guido Faecke, GF-Data Inc. 

  
$pic_dir 'images/banners/'
   
  
$counter 0

  
$d dir($pic_dir); 
  while(
$entry=$d->read()) { 
    if (
$entry != "." && $entry != "..") { 
      
$array[] = $entry
      
$counter++; 
    } 
  } 
  
$d->close(); 
  
$counter--; 
  
$which rand(0$counter); 
?>
<? echo '<img src="'.$pic_dir.$array[$which].'" border="0">'; ?>
Thanks for the help
Have you tried something like
PHP Code:
<?php
chdir
('/path/to/your/forums');   
require_once(
'/path/to/your/forums/global.php');    
// Random Picture v0.1 
// (c) Guido Faecke, GF-Data Inc. 

  
$pic_dir 'images/banners/'
   
  
$counter 0

  
$d dir($pic_dir); 
while(
$entry=$d->read()) { 
    if (
$entry != "." && $entry != "..") { 
      
$array[] = $entry
      
$counter++; 
    } 
  } 
  
$d->close(); 
  
$counter--; 
  
$which rand(0$counter); 
?>
<? echo '<img src="'.$pic_dir.$array[$which].'" border="0">'; ?>

//whatever stuff you like goes here.
<?php  
// And we put this where we want the login box
    
require_once('/path/to/your/login_inc.php');  
?>
Reply With Quote
  #150  
Old 06-09-2006, 01:02 PM
Rated Rated is offline
 
Join Date: Apr 2006
Posts: 64
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't really understand that, the random image script goes inside a table, and the php code your supposed to put at the top of the page won't work if it's in the table too, right? :s
Reply With Quote
  #151  
Old 06-10-2006, 02: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 Rated
I don't really understand that, the random image script goes inside a table, and the php code your supposed to put at the top of the page won't work if it's in the table too, right? :s
Ok, I thought that what you posted was at the top of the page.

Correct, my code wont work if its not at the very top of the page (before any output anyhow).

I suspect that your banner script may be broken because of the directory change in my script.
What was the exact error message you got?
You can change back to current directory after my script if you like.
I will post the code to do that as soon as I remember how...
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:07 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.04791 seconds
  • Memory Usage 2,354KB
  • 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
  • (6)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
  • (2)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