The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
![]() |
|||||||||||||||||||||||||||
Simple vB User login and access control on non vB pages
![]() Developer Last Online: Nov 2011 ![]() ![]()
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 3.7 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. 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 don't 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
Change log Version 2.00 (21st March 2008)
Click on Install If you have this script installed then please click on the install link because;
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
|
Comments |
#32
|
|||
|
|||
![]()
Thank you!
|
#33
|
|||
|
|||
![]()
I've finally got the script working - almost.
I can log in alright - but it does not show that i am logged in on the frontpage - only the log in box. I've checke my cookies path in the admincp and it is set to "/" - I've tried different browser and clearing my cookies etc. But nothing seems to work? If it is to any help - im using wordpress. |
#34
|
|||
|
|||
![]()
In response of MadsK, this bug seems to happen to a lot of us. I would really like to get some help from the developer of the code or from anyone else to find a way to solve this problem. This login box is a really important part of my website and right now it's a pain in the a** not to be able tu use it
|
#35
|
|||
|
|||
![]()
I found the trick to make it happen.
Below is the code i use for my site. It has been altered a little with some extra links after you've logged in but they can be changed. I've tested it with a couple of different friends on different computers, operating systems and browsers and it works on all of them. With that said this is only working with Wordpress as it collects the cookie from the wordpress database and outputs it. When logging out it also clears both wordpress and vbulletin cookie! I would really like some feedback on it ![]() You can see it in action on my website http://www.swtorcommunity.com Code:
<?php // Version 2.00 // Released March 21st, 2008 // For vB 3.7.x // Edit the line below to show path to your forums $forumpath = "/forum/"; // You dont have to edit anything underneath here, // but you can if you wish to style the login box // to match the style of your site. // --------------- // COPYRIGHT STUFF // --------------- // You are free to use and modify this script in anyway you like. // However, // - Do not remove copyright notice // - Dont pass it off as your own work. // // This script is provided free of charges, however If you use this on a commercial // venture a small paypal donation to cwp@cwp.id.au would be apprecieated. // We check if user is logged in if (isset($user_ID)) { // User is logged in echo "<div id=loginwelcome>"; $user_info = get_userdata($user_ID); echo $before_widget . $before_title . __("Welcome "). $user_info->display_name . $after_title; echo "</div>"; // If logged in display logout link echo "<br />"; echo "<div id=loginmeta>"; echo "<a href=\"".$forumpath."usercp.php"; echo "\">"; echo "User CP</a>"; echo "<a href=\"".$forumpath."private.php"; echo "\">"; echo "Private Messages</a>"; echo "<a href=\"".$forumpath."search.php"; echo "\">"; echo "Search</a>"; echo "<a href=\"/wp-login.php?action=logout\">Logout</a>"; echo "</div>"; } else { // If user is not logged in, we do this stuff // Display login boxes + button // You can style this with html or CSS as normal if desired. echo" <form id=loginform 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> <input name=vb_login_username value=Username id=user onFocus=this.value='' type=text id=navbar_username size=10 /> <input name=vb_login_password type=password id=password size=10 value=Password onFocus=this.value='' /> <br /> <label id=rememberme for=cb_cookieuser_navbar>Remember Me?<input name=cookieuser type=checkbox id=cb_cookieuser_navbar value=1 checked=checked /> </label> <input type=submit id=submit value=Login 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> "; } ?> |
#36
|
|||
|
|||
![]()
Than you for this useful hack!
How can i include header and navbar template to this script? |
#37
|
|||
|
|||
![]()
MadsK, any way to make your code work for those who aren't on Wordpress?
|
#38
|
|||
|
|||
![]()
You could try to replace the $user_id with the vbulletin equilant. But i'm not sure which that is.
|
#39
|
|||
|
|||
![]()
Okay - first off Props to the poster - this is a great little addon
Now if anyone is having issues with login.php here is the be all fix put the .php file inside your /forums directory this will solve most issues as you are using vbulletin functionality from outside it's operating path - and is where you are most likely running into issues For example prior I had a php page at mydomain/LINKS - the index.php was the link checker. When adding this hack in that /LINKS dir I was having issue (and I am not a code noob) - however the moment I put the php in my /forums directory and replaced my index.php on /LINKS with a frame loading the php from it's new location - everything works fine Any just a bitta info - oh and always - perfect syntax people Peace .* |
#40
|
|||
|
|||
![]()
Nope it doesn't work.
I put the .php that contains the login form in my forum folder, still shows as if i'm logged out. |
#41
|
|||
|
|||
![]()
Ok, I've been trying to get this working for a fair while now, I'm getting the same problem as a lot of people here, the script continues to show the login form after logging in.
I'm running Ubuntu and FF3, it shows logged out, however running under IE6 (using wine) it worked correctly the first time only (would work again even clearing cookies, history, re-opening browser etc). I noticed when it did work it sent back a session string as a _GET variable, but I couldn't get it to do that more than once without resetting my cookies etc. Still gonna work on it some more, but thought I'd share what I've found so far. cOwMoO |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|