vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Integration with vBulletin - Simple vB User login and access control on non vB pages (https://vborg.vbsupport.ru/showthread.php?t=173693)

Submerge 12-12-2008 04:48 PM

Thank you!

MadsK 12-19-2008 08:39 AM

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.

Jeffonfire 12-20-2008 09:41 PM

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

MadsK 12-22-2008 10:26 PM

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>
";

}
?>


tirol07 12-26-2008 12:38 AM

Than you for this useful hack!

How can i include header and navbar template to this script?

Jeffonfire 12-26-2008 06:02 PM

MadsK, any way to make your code work for those who aren't on Wordpress?

MadsK 01-03-2009 08:14 PM

You could try to replace the $user_id with the vbulletin equilant. But i'm not sure which that is.

daggz 01-08-2009 04:00 AM

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

.*

Jeffonfire 01-09-2009 02:11 AM

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.

cowmoo 02-20-2009 03:15 AM

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


All times are GMT. The time now is 10:16 PM.

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.01114 seconds
  • Memory Usage 1,750KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete