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

Category: Integration with vBulletin - Version: 4.0.0 Beta 3 Rating:
Released: 11-15-2009 Last Update: Never Installs: 99
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 4.0 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.

I've cut it down to the bare minimum that it needs to work, no fancy stuff such as avatars, PM's, or even formating. (That is in the Deluxe version - not yet released)

This is not supported, but if any questions / issues are posted here (not PM'ed or emailed) I will try and answer them if I have 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 4.0 beta3


Change log

Version 4.00 (15th November 2009)
  • Initial vB 4.0.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

Download Now

File Type: zip Login simple vb4.0 v4.00.zip (3.9 KB, 1408 views)

Screenshots

File Type: jpg cep-loggedin.jpg (7.2 KB, 0 views)
File Type: jpg cwp-loggedout.jpg (7.3 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
mightyudis

Comments
  #22  
Old 01-09-2010, 01:17 AM
Cface Cface is offline
 
Join Date: Dec 2009
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If we hook this mod up can we extend it with features from deluxe (once it comes) without having to undo everything we installed from this mod?
Reply With Quote
  #23  
Old 01-17-2010, 04:55 PM
ptiteuf ptiteuf is offline
 
Join Date: May 2008
Location: BELGIQUE
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello everyone,

I have a little problem on my main page of my site and that with this change that you put up here and I want to have on my page.

Your code is only nickel but as I joined my current page that has a system of multi-language ca va plus.

Thank you for your help.

common.php
Code:
<?php
session_start();
header('Cache-control: private'); // IE 6 FIX

if(isSet($_GET['lang']))
{
$lang = $_GET['lang'];

// register the session and set the cookie
$_SESSION['lang'] = $lang;

setcookie("lang", $lang, time() + (3600 * 24 * 30));
}
else if(isSet($_SESSION['lang']))
{
$lang = $_SESSION['lang'];
}
else if(isSet($_COOKIE['lang']))
{
$lang = $_COOKIE['lang'];
}
else
{
$lang = 'fr';
}

switch ($lang) {
  case 'en':
  $lang_file = 'lang.en.php';
  break;

  case 'de':
  $lang_file = 'lang.de.php';
  break;

  case 'es':
  $lang_file = 'lang.es.php';
  break;

  case 'it':
  $lang_file = 'lang.it.php';
  break;

  case 'nl':
  $lang_file = 'lang.nl.php';
  break;

  case 'pt':
  $lang_file = 'lang.pt.php';
  break;

  case 'fr':
  $lang_file = 'lang.fr.php';
  break;

  default:
  $lang_file = 'lang.fr.php';

}

include_once 'languages/'.$lang_file;
?>
index.php

Code:
<?php
include_once 'common.php';
?>
Reply With Quote
  #24  
Old 01-26-2010, 07:11 PM
ptiteuf ptiteuf is offline
 
Join Date: May 2008
Location: BELGIQUE
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,

I managed to set up your mod and now I telnet to see the game appear to say whether it has the message and what we are and what login into your mod.

Thank you in advance for your valuable help
Reply With Quote
  #25  
Old 01-26-2010, 08:30 PM
dietpepsi dietpepsi is offline
 
Join Date: Dec 2009
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Do our webpages need to be named *.php? Virtually all of my non-vB pages are currently *.shtml as they pull dynamic data from another program. Will this mod work for me?
Reply With Quote
  #26  
Old 01-31-2010, 08:10 PM
abdicar abdicar is offline
 
Join Date: Oct 2006
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It not works on 4.0.1
Reply With Quote
  #27  
Old 02-02-2010, 02:51 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 dietpepsi View Post
Do our webpages need to be named *.php? Virtually all of my non-vB pages are currently *.shtml as they pull dynamic data from another program. Will this mod work for me?
Only works with php pages as it is.


Quote:
Originally Posted by abdicar View Post
It not works on 4.0.1
Well it does on my test site.
Unless you post some error messages its hard to guess whats happened.
Reply With Quote
  #28  
Old 02-05-2010, 12:13 PM
Cface Cface is offline
 
Join Date: Dec 2009
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I thought i'd throw out there that i'm getting the old "no such file or directory" error for
PHP Code:
<?php
$curdir 
getcwd ();
chdir('/forum');
require_once(
'/forum/global.php');
chdir ($curdir);
?>
// also tried
require_once('/global.php');
which does exist... I've also tried with full url
PHP Code:
Warningchdir() [function.chdir]: No such file or directory (errno 2in /home/wonderna/public_html/index.php  on line 3

Warning
: require_once(/global.php) [function.require-once]: failed to open streamNo such file or directory in /home/wonderna/public_html/index.php on line 4

Fatal error
: require_once() [function.require]: Failed opening required '/global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php'in /home/wonderna/public_html/index.php on line 4 
EDIT: nevermind got it fixed, i'm such a dumbass :P
Reply With Quote
  #29  
Old 02-05-2010, 01:09 PM
Cface Cface is offline
 
Join Date: Dec 2009
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could add this code in the login_inc.php to have it show avatars:
PHP Code:
if ($vbulletin->userinfo['avatarid']) 

    
// using a predefined avatar 
    
$avatar $db->query_first("SELECT avatarpath FROM " TABLE_PREFIX "avatar WHERE avatarid = " $vbulletin->userinfo[avatarid] . ""); 
    
$avatarid $avatar['avatarid']; 
    
$navbaravatar "<img src=\"" $vbulletin->options[bburl] . "/$avatar[avatarpath]\" border=\"0\" />"
    echo 
$navbaravatar;
        echo 
"<br>";

else 

    
// not using a predefined avatar, check for custom 
    
if ($avatar $db->query_first("SELECT dateline, userid FROM " TABLE_PREFIX "customavatar WHERE userid = " $vbulletin->userinfo[userid] . "")) 
    { 
        
// using a custom avatar 
        
$navbaravatarurl = ($vbulletin->options['usefileavatar']) ? "" $vbulletin->options[avatarurl] . "/avatar$avatar[userid]_" $vbulletin->userinfo[avatarrevision] . ".gif" "" $vbulletin->options[bburl] . "/image.php?u=" $vbulletin->userinfo['userid'] . "&amp;dateline=" $avatar['dateline'] . "";
        
$navbaravatar "<img src=\"$navbaravatarurl\"  border=\"0\" />";
        echo 
$navbaravatar;
        echo 
"<br>";
    } 
    else
    { 
        
// no avatar specified 
        
$nouseavatarchecked HTML_CHECKED
        
$avatarchecked[0] = ''
        
$navbaravatar "<img src=\"" $vbulletin->options[bburl] . "/$stylevar[imgdir_misc]/noavatar.gif\" border=\"0\" />"// "<span class=\"smallfont\">No Avatar<br/ >Specified</span>";
        
echo $navbaravatar;
        echo 
"<br>";
    } 

Reply With Quote
  #30  
Old 02-06-2010, 09:33 PM
dennisuello dennisuello is offline
 
Join Date: Mar 2005
Location: Reno, Nevada
Posts: 49
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How do I use it for a site on a different domain (and server) than my vB installation?
Reply With Quote
  #31  
Old 02-24-2010, 11:51 AM
Prism27 Prism27 is offline
 
Join Date: Nov 2005
Location: Bonnie Scotland
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey,

Having an issue with this mod, normally I can fix them myself being a developer. Cant seem to figure this one out tho!

I'm getting this error: Undefined variable: specialtemplates on line 20 of global.php.

The forum works fine stand-alone, it's just when I include this into my own system. I've already done all the normal error checking and directory checking, it's all fine.

Anyone recommend something I've missed?
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 02:55 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.04989 seconds
  • Memory Usage 2,369KB
  • Queries Executed 26 (?)
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
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete