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
Deluxe vB User login and access control on non vB pages Details »»
Deluxe vB User login and access control on non vB pages
Version: 2.20, by Billspaintball Billspaintball is offline
Developer Last Online: Nov 2011 Show Printable Version Email this Page

Version: 3.5.8 Rating:
Released: 02-14-2006 Last Update: 04-23-2007 Installs: 223
Additional Files  
No support by the author.

Hack Description

This is the deluxe version of the user authentication and access control system I use on the non vB pages on my website.
For the simple no frills version look here.

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.

It also displays the logged in users Avatar, number of unread PM's, New posts since last visit, total posts and total threads.
It also allows you to specify a maximum Avatar size, and resize any avatars larger than that, while keeping their height/width ratios in proportion!
Its very handy if you allow large avatars, but want a small format display on your non forum pages.

If the user is not logged in, a login box is displayed, along with total posts and total threads in the forums.

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 is a work in progress and currently a beta version. It was a little rushed as a few people were pushing for it Its missing a couple of planned things like newest member etc, but they will be added in a later version.

This script has been confirmed as working on
  • vB 3.5.x - All Versions
  • vB 3.6.x - All Versions

Known Bugs
Will not display Avatars correctly if they are kept in the file system (database avatars are fine)

Changelog

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

Version 2.10 (4th June 2006)
  • Fixed - "MySQL Error : Invalid SQL " when using Database thread/forum marking.
  • Fixed - Javascrip error in some versions of IE.

Version 2.00 (16th April 2006)
  • Fixed - "MySQL Error : Unknown column 'newposts' in 'field list' "
  • Fixed - Number of PM's not displaying in all installs.
  • Added - Displays date and time of last login.
  • Added - Total number of saved PM's.
To upgrade just overwrite the existing login_inc.php file with the new one.
You will need to re-edit the path on line 3 and also redo any formatting changes you may have done for the last version.

Version 1.0 (15th Feb 2006)
  • Initial 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
  #352  
Old 07-30-2007, 05:25 PM
steveheinsch steveheinsch is offline
 
Join Date: Mar 2007
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would like to thank you for this hack Bill. I am using it as the heart of a custom CMS I am building for one of my clients and it works great. I just need to do some more digging into the vB core to see how they access certain info so I can use it. Thanks again...this rocks.
Reply With Quote
  #353  
Old 07-30-2007, 05:49 PM
steveheinsch steveheinsch is offline
 
Join Date: Mar 2007
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did anybody get this to work (check for membergroupids)?

Looking at the below example, I noticed that you are using 'usergroupid' and I think this needs to be 'membergroupids' like:
PHP Code:
<?php 
if ($vbulletin->userinfo['membergroupids'is_member_of(n,n,n)) 
    { 
    echo 
"This is only visible to people in usergroups n,n,n";} 
    
?>
usergroupid is a users primary access level while membergroupids can contain multiple secondary access levels.

Quote:
Originally Posted by Billspaintball View Post
Try something like

PHP Code:
<?php 
if ($vbulletin->userinfo['usergroupid'is_member_of(n,n,n)) 
    { 
    echo 
"This is only visible to people in usergroups n,n,n";} 
    
?>
where n = the groups you want to check.

I havent tried this yet, it may or may not work.
Look here for more info https://vborg.vbsupport.ru/showthread.php?t=132024
Reply With Quote
  #354  
Old 07-31-2007, 03:03 AM
Thorlax402 Thorlax402 is offline
 
Join Date: Sep 2006
Posts: 32
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,

I have been having a lot of trouble with getting this modification to work. I have read of numerous people having the same problem as well. I read to about page 13 before I gave up and decided to post (sorry if this was fixed between here and there).

Anyway, my login box appears to work fine in all aspects accept actually logging in. After typing in my username and password, I am sent to the page saying I have successfully logged in. However, I am then redirected back to the page with the login only to find that I am in fact not logged in. The same thing happens when I try to log out using this script as well. Everything appears fine, but I don't log out.

On the other hand, the login box reflects perfectly whether I am actually logged in or not. It can tell if I have logged in on the forum's login page and reacts accordingly. It just can't perform any of the operations itself.

I have also read through the troubleshooting and the changing the cookie information didn't change anything.
Any suggestions?
Reply With Quote
  #355  
Old 07-31-2007, 03:49 AM
Luke Brown256 Luke Brown256 is offline
 
Join Date: Jun 2005
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok i am having some problems, i set the login script up to how i needed it and i ran this script:

Code:
<?php
$curdir = getcwd ();
chdir('../../vbulletin');
require_once('global.php');
chdir ($curdir);
?>
<html> 
<body> 
This is a heading<br /> 
This is some more stuff <br /> 
And another line<br /> 
You get the idea<br /> 
Just place stuff as you normally would with HTML<br /> 
I use CSS to style and position on my site fwiw<br /> 
<br /> 
How about we put the login box right under here?<br /> 
<br /> 
<?php 
   require_once('login_inc.php'); 
?> 
</body> 
</html>
simple and bog standard, but as soon as i execute the script, the page loads a copy of the login page, but it is NOT redirecting to my login page as the path stays the same:



This seems to occur when i include global.php and i am completely lost, can anyone help?

----
UPDATE:
Ok i forgot to include some pertinent information, this only occurs when i am not logged in, if i am logged in then it all works fine:
URL=http://img505.imageshack.us/my.php?image=icasdo1.jpg][/URL]

But if i am not logged in, or click log out, then when i attempt to access the login page, (the one i designed using the login_inc) it simple embeds the proper login page attempting to use my style aswell, but failing because the images paths are not correct, (because the script remains the same, it does NOT redirect to a new script)

I cant login using this page because the paths are all wrong.
Reply With Quote
  #356  
Old 08-02-2007, 01:09 AM
Luke Brown256 Luke Brown256 is offline
 
Join Date: Jun 2005
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok i have worked out what is wrong, i dont know if this is something that can be fixed or not but perhaps it should be added as a notice.

If you set your forums up so unregistered/ not logged in users can NOT see any forums, then you will get the same problem i have done, if the user tries to access any page in which global.php is included then it will embed a vb login box, but all the paths will be relative, so it wont work.

Took me several hours of reading global.php and then trying some things but yeah, so i am going to bed now.
The way around this is simply to enable unregistered users to see SOMETHING, but if someone finds another way around this then i look forward to reading it.
Reply With Quote
  #357  
Old 08-02-2007, 01:22 AM
steveheinsch steveheinsch is offline
 
Join Date: Mar 2007
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This code will check BOTH the primary and secondary usergroups for access...

PHP Code:
if (is_member_of($vbulletin->userinfoXXX)) { 
  echo 
"Your usergroup has access to this area";
}
else { 
   echo 
"You are not in a usergroup with access";

Where X is a usergroup (primary or secondary, it checks them BOTH).
If you only want to check for one value, just use one groupid...multiple values use multiple groupids. You can check for as many as you would like.

Hope it helps,
Steve
Reply With Quote
  #358  
Old 08-03-2007, 01:17 PM
essexell essexell is offline
 
Join Date: Jun 2006
Posts: 1
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm having a problem using this mod which I see other people have had before - but I couldn't find a solution on this thread.
I'm using the login box in the header all pages on the site, and for consistency, it's in the same place on the forum pages. All is working fins apart from the variables:
$pmbox[lastvisitdate]
$pmbox[lastvisittime]
$vbphrase[unread_x_nav_compiled]
$vbphrase[total_x_nav_compiled]
Which won't show on the forum (fine on all other pages).
Sorry if this has been resolved before - but I'd really appreciate some help!
THanks.
Reply With Quote
  #359  
Old 08-05-2007, 02:46 PM
CSGCarl CSGCarl is offline
 
Join Date: Feb 2007
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello,

I was just wondering if any one knows how to edit the global.php file so when forum is closed it dosn't close the site as well?

Cheers
Reply With Quote
  #360  
Old 08-22-2007, 03:23 AM
RPG_Messiah RPG_Messiah is offline
 
Join Date: Jul 2007
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

my avatar and the other stuff shows up but above all that there is an error that shows up:
Quote:
Warning: getimagesize() [function.getimagesize]: URL file-access is disabled in the server configuration in /home/.kirsten/rpg_messiah/galanovagames.com/login_inc.php on line 34

Warning: getimagesize(http://www.galanovagames.com/community/image.php?u=1) [function.getimagesize]: failed to open stream: no suitable wrapper could be found in /home/.kirsten/rpg_messiah/galanovagames.com/login_inc.php on line 34

EDIT: Well I fixed that problem....all I did was delete line 34.

But one problem I can't seem to figure out is why I have to press the refresh button on my browser to update the online/offline status if I login/logout in the forum and then go to my home page from there. I already cleared my cache and it still does it. Can someone please help me w/this?
Reply With Quote
  #361  
Old 08-25-2007, 05:35 PM
RPG_Messiah RPG_Messiah is offline
 
Join Date: Jul 2007
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any way of forcing the page to automatically refresh or something???
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:36 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04899 seconds
  • Memory Usage 2,326KB
  • Queries Executed 27 (?)
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_code
  • (3)bbcode_php
  • (2)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_postinfo_query
  • fetch_postinfo
  • 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