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
  #202  
Old 09-14-2006, 12:43 PM
Billspaintball's Avatar
Billspaintball Billspaintball is offline
 
Join Date: Sep 2003
Location: Bathurst, Au
Posts: 649
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think I may have solved the avatar problem for those that are not storing them in the database.

If anyone who was doing that and having trouble wants to test a revised version PM me.
Reply With Quote
  #203  
Old 09-14-2006, 08:37 PM
delive delive is offline
 
Join Date: May 2006
Posts: 14
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey bill,
I sent you a PM about an issue I was having with my login system.

Its odd in that it will log you in once, but the second you logout and try to relogin, it says it works yet shows you not logged in.

Something else thats weird is that even though you are not logged in, it shows you as a active user on the forums.
Reply With Quote
  #204  
Old 09-15-2006, 03:01 AM
Grasty Grasty is offline
 
Join Date: Jun 2006
Posts: 27
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

alright, my install is completely screwed up. All of the sudden when I login on the home page it wont redirect back to the home page, it keeps going to the forum home.

Also I was playing with the code to only allow usergroup 6 to go to a certain page, If i am not logged in it tells me i dont have permission (as well as "Unable to add cookies, header already sent.
File: /home2/grastyz/public_html/comedy.php
Line: 6") and if im logged in and in usergroup 6 it lets me view it, and then i tried changing the code to usergroup 9 which is an additional usergroup im in, and it let me go to the page, then i changed the code to usergroup 7 which is a usergroup im not in, and it still let me go to the page. im using this code from the first page
Code:
<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
    {
    echo "Have stuff for here";
             } else {
             echo "You do not have permission for this page"; }
    ?>
regardless of what usergroup i put in that code it still displays "You do not have permission for this page" on top of the screen, the difference is that when im not logged in it is a white screen with that and the error above, and when im logged in its the page plus "You do not have permission ...." at the top of the page

If I login from the home page, it then redirects me to the forum home, so then I would type my home page back in the url, everything looks fine, it shows my avatar, my name, my private messages, etc, but if i then click on the forum link, im not logged into the forums, but im still logged in on the home page.

Sorry, I know i went into rant mode on this, but I am getting so frustrated with this. It was working last week, i changed nothing, and now it doesnt work (last week i didnt test putting a usergroup i didnt belong to in the code listed above)
Reply With Quote
  #205  
Old 09-18-2006, 02:31 PM
odonel odonel is offline
 
Join Date: Sep 2006
Posts: 80
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hello all, i did all the above and still receive erros.....I also need to get the user's name and insert it in an .aspx form so that he/she can log in my chat page.. what do you guys think i should do with this once i get it working ?

thanx

"Notice: Undefined index: REQUEST_URI in D:\webscv\sites\page\vbull\includes\class_core.php on line 1944

Notice: Undefined index: REQUEST_URI in D:\webscv\sites\page\vbull\includes\class_core.php on line 1944

Notice: Undefined index: HTTP_REFERER in D:\webscv\sites\page\vbull\includes\class_core.php on line 1594

Unable to add cookies, header already sent.
File: D:\webscv\sites\page\vbull\includes\class_core.php
Line: 1944

"
Reply With Quote
  #206  
Old 09-28-2006, 01:45 AM
pumpiniron pumpiniron is offline
 
Join Date: Sep 2006
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm getting the following error...

Fatal error: Call to a member function on a non-object in /home/vertical/public_html/forums/login_inc.php on line 150

Line 150 in the login_inc.php file says this...

$getstats = $db->query_read('SELECT threadcount, replycount FROM ' . TABLE_PREFIX . 'forum');

I'm running vB 3.6.1 can anyone help me out with this?
Reply With Quote
  #207  
Old 09-28-2006, 02:36 AM
pumpiniron pumpiniron is offline
 
Join Date: Sep 2006
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is my code from the page that is calling the include that is bringing up the Fatal Error on line 150...

HTML Code:
<?php
   chdir('http://www.verticalterrain.com/forums/'); 
   require_once('http://www.verticalterrain.com/forums/global.php');  
?>  
<html><!-- InstanceBegin template="/Templates/index.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Vertical Terrain | Ski and Snowboard Forums and Communities</title>
<!-- InstanceEndEditable --><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="cssv1.css" rel="stylesheet" type="text/css">
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>

<body>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"><table width="780" border="0" cellpadding="0" cellspacing="0" class="maintable">
      <tr>
        <td colspan="3"><img src="images/main.jpg" width="780" height="124"></td>
      </tr>
      <tr>
        <td colspan="3">&nbsp;</td>
        </tr>
      <tr>
        <td colspan="3" class="headers">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="3">&nbsp;</td>
      </tr>
      <tr>
        <td width="160" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td class="center_headers"><img src="images/navigation.gif" alt="Navigation" width="160" height="20"></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellpadding="2" cellspacing="1" class="sidetable_bg">
                <tr>
                  <td class="sidetables"><a href="index.php">Home</a></td>
                </tr>
                <tr>
                  <td class="sidetables"><a href="forums/register.php">Register</a></td>
                </tr>
                <tr>
                  <td class="sidetables"><a href="forums/index.php">Discussion Forums</a></td>
                </tr>
                <tr>
                  <td class="sidetables"><a href="Galleries.php">Galleries</a></td>
                </tr>
                <tr>
                  <td class="sidetables"><a href="Online_Store.php">Online Store </a></td>
                </tr>
                <tr>
                  <td class="sidetables"><a href="Weather.php">Weather</a></td>
                </tr>
                <tr>
                  <td class="sidetables"><a href="Links.php">Links</a></td>
                </tr>
                <tr>
                  <td class="sidetables"><a href="Classifieds.php">Classifieds</a></td>
                </tr>
                <tr>
                  <td class="sidetables"><a href="Reviews.html">Reviews</a></td>
                </tr>
                <tr>
                  <td class="sidetables"><a href="Contact_Us.php">Contact Us</a></td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td class="center_headers"><img src="images/user_cp.gif" alt="User Control Panel" width="160" height="20"></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellpadding="2" cellspacing="1" class="sidetable_bg">
                <tr>
                  <td class="sidetables"><?php
   require_once('http://www.verticalterrain.com/forums/login_inc.php');
?> </td>
                </tr>
                
            </table></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td class="center_headers"><img src="images/features.gif" alt="Features" width="160" height="20"></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellpadding="2" cellspacing="1" class="sidetable_bg">
                <tr>
                  <td class="sidetables">Site Announcements</td>
                </tr>
                <tr>
                  <td class="sidetables"><a href="News.php">News</a></td>
                </tr>
                <tr>
                  <td class="sidetables">Resort Reviews</td>
                </tr>
                <tr>
                  <td class="sidetables">Gear Reviews</td>
                </tr>
            </table></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td class="center_headers"><img src="images/new_posts.gif" alt="New Posts" width="160" height="20"></td>
          </tr>
          <tr>
            <td><table width="100%" border="0" cellpadding="2" cellspacing="1" class="sidetable_bg">
              <tr>
                <td class="sidetables">&nbsp;</td>
              </tr>
              
              
            </table></td>
          </tr>
          
        </table></td>
        <td width="20">&nbsp;</td>
        <td width="600" valign="top"><!-- InstanceBeginEditable name="EditRegion1" -->
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="center"><img src="images/center_banner.jpg" alt="Welcome to Vertical Terrain, your online ski and snowboard forums and communities!" width="600" height="300"></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
            </tr>
            <tr>
              <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td class="center_headers">Site Announcements - Welcome to Vertical Terrain! </td>
                </tr>
                <tr>
                  <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="centertables">
                    <tr>
                      <td><p title="">Welcome to Vertical Terrain, your online ski and snowboard forums and communities! This site was recently launched and is therefore still growing. This site was designed as a community for people who share a passion for  skiing and snowboarding. Check out our forums where you can discuss anything related to skiing and snowboarding, meet other members from all over the world and have all your questions answered! Here you will be able to discuss a variety of things from your favorite mountain to your favorite run. Read and write reviews on different resorts and ski equipment. Buy or sell your new and used ski or snowboard gear with our classifieds or purchase new equipment at our online shop (coming soon!). If it involves skiing or snowboarding you can be rest assured that you will never have to look any further than Vertical Terrain! Make sure to tell your friends and spread the word about this site because it's going to be blowing up faster than you think! Thanks for stopping by and we hope you enjoy your stay. Have fun on the slopes and stay safe! </p>
                          <p>Best Regards,<br>
                            Vertical Terrain Staff <br>
                        </p></td>
                    </tr>
                  </table></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td class="center_headers">Site Announcements - Forums are up! </td>
                </tr>
                <tr>
                  <td><table width="100%" border="0" cellpadding="0" cellspacing="0" class="centertables">
                    <tr>
                      <td><p title="">The Vertical Terrain forums are officially up. The forums are currently undergoing a massive remodel in terms of looks (the idea is to make them match with the rest of the site) so you may feel free to register and post as much as you'd like just don't be alarmed when all of a sudden colors and page layouts in the forum are changing! We promise we will get it taken care of as fast as possible but none of the changes or maintenance will effect your ability to post or respond to topics. Having said this feel free to register as a member and use the forums as much as you would like! This is purely a cosmetic change and the forums will not be down at all during our remodel. </p>
                          <p>Best Regards,<br>
                          Vertical Terrain Staff </p>
                        <p title=""><br>
                        </p></td>
                    </tr>
                  </table></td>
                </tr>
                
              </table></td>
            </tr>
          </table>
        <!-- InstanceEndEditable --></td>
      </tr>
      

      <tr>
        <td colspan="3">&nbsp;</td>
        </tr>
      <tr>
        <td colspan="3" class="headers"><a href="About_Us.php">About Us</a>  | <a href="Advertising.php">Advertising</a> |
          <a href="Legal_Disclaimer.php">Legal Disclaimer</a> | <a href="Contact_Us.php">Contact Us</a></td>
        </tr>
      <tr>
        <td height="160" colspan="3" class="footer">Copyright &copy; 2006 verticalterrain.com All Rights
          Reserved<br>
          Web Design By Chris Jumonville</td>
        </tr>
    </table></td>
  </tr>
</table>
</body>
<!-- InstanceEnd --></html>
Reply With Quote
  #208  
Old 09-28-2006, 02:37 AM
pumpiniron pumpiniron is offline
 
Join Date: Sep 2006
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As you can see I'm running this page off a template in Dreamweaver... The problem with trying to put that PHP code in the template is it won't let you put it before the <html> or <head> tags because that is not considered part of the template and then that PHP code won't be in any other page that uses that template...
Reply With Quote
  #209  
Old 09-28-2006, 03:05 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 pumpiniron
I'm getting the following error...

Fatal error: Call to a member function on a non-object in /home/vertical/public_html/forums/login_inc.php on line 150
Login_inc.php should not be in the /forums directory.
Or, you have the path entered wrong.
Reply With Quote
  #210  
Old 09-28-2006, 03:31 AM
pumpiniron pumpiniron is offline
 
Join Date: Sep 2006
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It's not supposed to be in the /forums directory... Let me try taking it out of there... by the way if you want to see for yourself my site is www.verticalterrain.com
Reply With Quote
  #211  
Old 09-28-2006, 03:39 AM
pumpiniron pumpiniron is offline
 
Join Date: Sep 2006
Posts: 21
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Fixed this part...
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:31 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.13783 seconds
  • Memory Usage 2,370KB
  • 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_code
  • (1)bbcode_html
  • (1)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