PDA

View Full Version : Integration with vBulletin - Simple vB User login and access control on non vB pages


Billspaintball
21 Mar 2008, 13:01
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

vB 3.7 RC1



Change log

Version 2.00 (21st March 2008)

Initial vB 3.7.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 :)


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

Billspaintball
21 Mar 2008, 13:02
Usage

The hack is pretty useless without some usage instructions so here they are.

We can use conditionals to hide or display depending on a number of things such as
Logged in or out status,
or restrict to members of a specific usergroup.

We do this by using conditionals in php tags where the normal content of a webpage would go.


If you want something only accessable to a certain usergroup, use this code in your webpage. This example is only visible to members of usergroup 6.

<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
{
echo "This is only visible to people in usergroup 6";}
?>


You can use a simple variation of this to restrict entire pages to a certain usergroup.
For example,

<?php
if ($vbulletin->userinfo['usergroupid'] == '6' )
{
echo "Have stuff for here";
} else {
echo "You do not have permission for this page"; }
?>


You can of course use multiple usergroups by just modifiying the if statement a little.
For example:

if ($vbulletin->userinfo['usergroupid'] == '9'
or $vbulletin->userinfo['usergroupid'] == '6'
)



Another use is to display different content to users depending on if they are logged in or not. For example

<?php
If ($vbulletin->userinfo['userid']!=0)
{
echo "Your logged in so we can display this";
} else {
echo "Your not logged in so we display this";
}
?>


Another use is to restrict advertising to people who are not logged in.
For example

<?php
if ($vbulletin->userinfo['userid'] <1) { echo"add code stuff goes here"; }
?>


Of course you can play around with conditionals to do a whole range of things, these are just brief example snippets.



Troubleshooting

If your reading this chances are you are having problems.

Here are some common causes and fixes.


Headers already sent or cookies already sent errors. Chances are that there is something, even just a space before the 4 lines of code in part 1. Edit this and ensure that there are no spaces before it.



Path problems are the next biggest problem. Your paths must be exact else it will not work. Double check that all paths are correct.
If you are unsure what the path is place the following code in a page all by itself.

<?php
echo getcwd();
?>
Name this file something like path.php then upload it to your website, browse to it and it will show you the exact path to your sites root.



Appears to login ok, but wont show you as logged in
Often caused by the vB cookie path setting.
To fix log into you vB admin area;
AdminCP -> vBulletin Options -> Cookies and HTTP Header Options -> Path to Save Cookies

Change

'Suggested Settings' dropdown from '/forums/' to '/' or 'yourdomain.com'



Subdomains and cross site logins
This is a known issue with many scripts (not just this one), sometimes fixable sometimes not. Its caused by vB, PHP and your hosts security measures.

First change your "cookie domain" settings.
vB Admin > Control Panel > Cookies and HTTP Header Options > Cookie Domain
Change it from being blank to
.yourdomain.com

You may need to set a post referrer in your whitelist.
vB Admin > Control Panel > General Settings > Post Referrer Whitelist
Instructions on what to enter are listed where you change this setting.

That should fix it if your forum is a subdomain.

If that fails then,
Open your /forum/login.php file and look for this code:
error_reporting(E_ALL & ~E_NOTICE);
Below that add
define('SKIP_REFERRER_CHECK', true);
Now save this and overwrite the file on the server with this one.

A further reported work around is to make a copy of the required Forum Forum files on your second Server. Then you must set in the config.php on the second server to use the ip of the server with which the VB-Database is running.



404 Error on expiring passwords
Cause - When redirected for expired password you are redirected to the directory that your login script is located in, not your forums root.

Fix - Edit phrase called passwordexpired

Your current phrase should be
Your password is {1} days old, and has therefore expired.<br />
<br />
Please change your password using <a href="profile.php?{2}do=editpassword">this page</a>.

change it to

Your password is {1} days old, and has therefore expired.<br />
<br />
Please change your password using <a href="../forums/profile.php?{2}do=editpassword">this page</a>.

where ../forums/ is your forums directory.



Still got problems?
It may be a conflict with somthing already in your site.
To check this we can just make a simple page.
Call it test.php and use just this code in it.
(Make sure there is no whitespace before the 1st line)

<?php
$curdir = getcwd ();
chdir('/path/to/your/forums');
require_once('/path/to/your/forums/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('/path/to/your/login_inc.php');
?>
</body>
</html>

Naturally, change paths to fit your forums, then upload it.
Browse to it and run it.

punchbowl
21 Mar 2008, 13:07
superb stuff, brilliantly presented info. Thanks

NeuroLancer
21 Mar 2008, 13:12
Good one :up:

I have been wanting to do this but have been putting it off due to time restrictions.

You've made things alot easier and quicker for me by creating this mod, thank you so much.

*installed

dilbert
22 Mar 2008, 04:15
Wow, very timely!
I am developing a new section of the site, but it will be for forum users only.
My one glitch, the pages will be in cold fusion, not php. Any chance something like this could be modified for cfm pages?

ramsayeg
22 Mar 2008, 04:37
Just about to launch my new layout and wanted something like this to be released, thanks!

smooth-c
29 Mar 2008, 18:19
wow! this is great!!

Billspaintball
27 Apr 2008, 07:42
Wow, very timely!
I am developing a new section of the site, but it will be for forum users only.
My one glitch, the pages will be in cold fusion, not php. Any chance something like this could be modified for cfm pages?
I have zero experience in cold fusion so I cant answer this either way.

texas_txu
13 May 2008, 06:13
I have been struggling getting this to work for me. I am just trying to get the test.php script to work first. when i am not logged in, i cannot log into the pages off of vb, they are linked to the folder i have my non-vb files in, rather than the forum folders.
www.mydomain.com/forums
www.mydomain.com/music

i want to use this script in the music folder. when i try to load the test.php file, it looks for images and registration stuff under /music/images and /music/register.php rather thant /forums/images and what not. i have tried various setups for the login_inc.php file and also put the music folder inside the /forums dirstory (/forums/music) and still with no luck.

im pretty sure its something stupid and i'm over thinking this whole problem. but your help would be much abliged. thanks much.

pdblizzard
13 May 2008, 12:52
I had a devil of a time with this too, until I changed the URL in my login_inc.php from
this:

$forumpath = "http://www.yoursite.com/forums/";
to this:
$forumpath = "./forums/";

I have no idea if this will help you in your circumstances, but I thought I would share it just in case. I had multiple domain names pointing to the same content.

texas_txu
14 May 2008, 08:23
still running into issues...the login page that is generated makes links for the registration page and the login script to the /music/log.php etc...rather than /forums/login.php. even the logo is messed up

justchil
15 May 2008, 20:36
Super simple and works great!

pdblizzard
15 May 2008, 20:52
still running into issues...the login page that is generated makes links for the registration page and the login script to the /music/log.php etc...rather than /forums/login.php. even the logo is messed upMaybe if you post more information, i.e., the php code with your path statements (the part you're supposed to customize) we can help you out.

texas_txu
16 May 2008, 09:07
<?php
// Version 2.00
// Released March 21st, 2008
// For vB 3.7.x
// Edit the line below to show path to your forums
$forumpath = "./forums/";

also tried with
$forumpath = "https://www.mydomain.com/forums/"; (yes secure domain)
$forumpath = "c:\domains\mydomain\wwwroot\forums"; (IIS Server nomenclature)


and my php test file looks like (in mydomain.com/forums/music with login_inc in mydomain.com/:

<?php
$curdir = getcwd ();
chdir('../forums');
require_once('../forums/global.php');
echo getcwd();
chdir ($curdir);
echo getcwd();
?>

....

<?php
echo getcwd();
require_once('../login_inc.php');
?>

berry05
18 May 2008, 15:08
i did this hack and got this error...

Unable to add cookies, header already sent.
File: /home/content/b/e/r/berry05/html/tyler.php
Line: 3

and i did what the troubleshooting told me to do also...

oz_girl
01 Jun 2008, 01:59
This si another awesome mod, will it be to hard for a newbie to use?

fsbmax
03 Aug 2008, 23:04
i keep getting errors :s

Warning: chdir() [function.chdir]: No such file or directory (errno 2) in /home/fragreel/public_html/td2142/template/header.inc.php on line 4

Warning: require_once(/home/fragreel/td2142/forum/global.php) [function.require-once]: failed to open stream: No such file or directory in /home/fragreel/public_html/td2142/template/header.inc.php on line 5

Fatal error: require_once() [function.require]: Failed opening required '/home/fragreel/td2142/forum/global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/fragreel/public_html/td2142/template/header.inc.php on line 5

Hereward
04 Aug 2008, 08:31
I wonder if its possible to see a working example rather than just the code snippets?

<?php
If ($vbulletin->userinfo['userid']!=0)
{
echo "Your logged in so we can display this";
} else {
echo "Your not logged in so we display this";
}
?>

I am looking to create a page (within a separate CMS) which checks to see if the current user is authenticated against the forum. This code above looks promising but it seems incomplete.

I am wondering, where is the variable $vbulletin created? Does it need to be declared as a global?

cheers (:

ramsayeg
07 Aug 2008, 01:22
have some problems with this, the form works OK but when it returns to the page it still doesn't show me as logged on...

I did everything in the instructions... anyone cares to help?

ramsayeg
07 Aug 2008, 09:34
anyone?

I even managed to lock myself out by changing the cookie domain etc. and then had to reverse it by using tools.php. I'd love some ideas....

ForgotenDynasty
08 Aug 2008, 17:14
When i inserted it in to my blog so my users can login in my word press bridge i found my self doing alot of /" because often you would use quotes to open the echo then you would use them again in the html

and it also seems that it doesn't pick up when the user is logged in. it just brings the form back

TheInsaneManiac
08 Aug 2008, 20:13
Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/XXXXX/public_html/news/inc/functions.inc.php on line 43

Seems to be affecting cutenews.

PaylaX
21 Sep 2008, 17:46
Appears to login ok but won't show I as logged in,

In Simple Login Instructions;

AdminCP -> vBulletin Options -> Cookies and HTTP Header Options -> Path to Save Cookies
change 'Suggested Settings' dropdown from '/forums/' to '/' or 'yourdomain.com'I did, but won't show I as logged in again again..

qbn720
01 Oct 2008, 09:30
Appears to login ok but won't show I as logged in,

In Simple Login Instructions;
I did, but won't show I as logged in again again..
I'm having the same problem, I even added the urls on the whitelist. I'm not sure what I'm doing in correct but here's my entire file, thus far I've only been testing. However, my issue pertains to the fact that I'm actually using two subdomains. My forums has a subdomain and the other aspect of the site that I'm using also has a subdomain.

How do I get around this?

Shamil.
13 Oct 2008, 20:35
Anyone?

qbn720
03 Nov 2008, 00:37
I found out that you have to reset your browsers then use the website, or else it will continue cause problems.

Jeffonfire
23 Nov 2008, 19:54
I've got the same problem as some others, the form seems to work, but it still shows as logged off.

I've tried to set the path of the cookies to "/" and then clear my cookies then try to connect and still doesn't work.

I found out that if I go directly to the forum then connect then move to another section of my website, it'll then show as if I'm logged.

Thanks for help

Triky
30 Nov 2008, 21:37
Ive cut it down to the bare minimum that it needs to work, no fancy stuff such as avatars, PM's, or even formating.

So.. can you please post also an extended version? :)

lifanovsky
08 Dec 2008, 20:47
I have even installed additional hack to use cookie on few different domain. But still this plugin shows that I am not logged in... Will there be instructions or updated version?

gct13
12 Dec 2008, 18:18
Great hack.

I was wondering if there was a way to suppress the banned notification for banned users? If a banned user browses non-vb pages, those pages are also blocked from view. I'd prefer that non-vb pages with this hack are viewable for banned users.

Submerge
12 Dec 2008, 18:48
Thank you!

MadsK
19 Dec 2008, 10:39
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
20 Dec 2008, 23:41
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
23 Dec 2008, 00:26
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

<?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
26 Dec 2008, 02:38
Than you for this useful hack!

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

Jeffonfire
26 Dec 2008, 20:02
MadsK, any way to make your code work for those who aren't on Wordpress?

MadsK
03 Jan 2009, 22:14
You could try to replace the $user_id with the vbulletin equilant. But i'm not sure which that is.

daggz
08 Jan 2009, 06:00
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
09 Jan 2009, 04:11
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
20 Feb 2009, 05:15
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

Digma
30 Mar 2009, 14:40
We've just start re-coding our main website and one of the things on our wishlist was to integrate the vb login sequence and have vb help determine what 'non-registered' users can or can't do. Easy to use, easy to install and works like a charm. It has also encouraged me to look further into this and see what else is possible. Excellent work and thank you for this simple but very effective mod. :up:

Billspaintball
13 Nov 2009, 11:19
Just a brief heads up for anyone who is interested, initial testing shows that this works with vB4 beta 3

aspen0
14 Nov 2009, 14:45
thanks for that headsup Bill. I was about to come ask that. I've come to rely on this script a bit over the years (actually, an older version I think) and wanted to make sure it'd still work with the upgrade.

AndyAA
14 Dec 2009, 22:34
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

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

}
?>


You are a champion!!!!

I have been looking everywhere for a Wordpress login.

You made my day!


How can I display some user info ie: user photo/thread count/new messages like this mod:

http://www.vbulletin.org/forum/showthread.php?t=173698


Thanks again and hope you can help out

Andy

archaosus
05 Jan 2010, 13:23
So a quick question regarding user authentication as I got this working really well now - at the moment it is checking for user ID "6" which is admin - non admins are moved to the site frontpage and information isnt loaded - however what I would like to do is have multiple usergroups able to access the page - ie 6,12,13 - would I then just change the code to

<?php
If ($vbulletin->userinfo['6,12,13']!=0)
or would I have to make nested id statements?

Ipuck
19 Jan 2010, 03:03
Does any one know if I can use this mod on my site if the forums is in a subdomain? when I add: require_once('/path/to/your/forums/global.php'); the page goes blank.

mandingo
19 Jan 2010, 03:21
Does any one know if I can use this mod on my site if the forums is in a subdomain? when I add: require_once('/path/to/your/forums/global.php'); the page goes blank.

/path/to/your/forums needs to be the actual path to your forum root.
if you need:
Open up a text editor and paste this in it:
<?
echo getcwd();
?>
and name the file
path.php
make sure it's path.php and not path.php.txt or anything like that.
Upload that file to your forum root and point your browser to it.
example:
http://yourforum.org/forum/path.php
should show you what you need to replace /path/to/your/forums with. delete that file when you're done with it.
Hope this helps.

Ipuck
19 Jan 2010, 03:31
Thank you for your quick response. I actually did add the path to the forum, but still doesnt work. This is what I got:

<?php
$curdir = getcwd ();
chdir('/var/www/vhosts/mydomain.com/subdomains/mysubdomain/httpdocs/forum/');
require_once('global.php');
chdir ($curdir);
?>

It should work, but unfortunately it doesn't. I just don't understand why it doesn't work.

I also tried:

<?php
$curdir = getcwd ();
chdir('/var/www/vhosts/mydomain.com/subdomains/mysubdomain/httpdocs/forum/');
require_once(''/var/www/vhosts/mydomain.com/subdomains/mysubdomain/httpdocs/forum/global.php');
chdir ($curdir);
?>

mandingo
19 Jan 2010, 04:06
Thank you for your quick response. I actually did add the path to the forum, but still doesnt work. This is what I got:



It should work, but unfortunately it doesn't. I just don't understand why it doesn't work.

I also tried:

pm me the link to path.php on your server.

metalguy639
03 Feb 2010, 04:45
Just a brief heads up for anyone who is interested, initial testing shows that this works with vB4 beta 3

Great but is there a fix for this cookies problem that everyone is having. I used this hack before and never had it do this before so it must be something to do with vb 3.8.4.

wolbrom
22 Apr 2010, 15:47
Has this scrip been confirmed with vB4 (release) yet?

thenewuser
01 Jun 2010, 00:56
Thank you for this!

Right now I am getting a:

Fatal error: Call to a member function query_read() on a non-object in (path)/www/www/forums/includes/adminfunctions.php on line 2399

When it is loaded into a file with WordPress. It does work in a stand alone PHP file.

If you can help me debug this I shall donate! (Basically paying for your services as is only fair.)

I am using 3.8.5.

Hex_legend
22 Jul 2010, 20:26
My demo site is www.gungeuk.com/newdesign and the forums are at www.gungeuk.com/forum

On my site, I have /includes/header.php and /includes/sidebar.php.

On the sidebar is where I want to put the login box, so in my header, I put the code:


<?php
$curdir = getcwd ();
chdir('/home/gungeuk1/public_html/forum/');
require_once('/home/gungeuk1/public_html/forum/global.php');
chdir ($curdir);
?>


and in the sidebar, I have:


<?php
require_once('/home/gungeuk1/public_html/forum/login_inc.php');
?>


where the login box is to go.

However, when I login, it will log me in but still shows the login box on the sidebar.

In my ACP cookie path settings, its saved to /

My path can be found at www.gungeuk.com/forum/path.php

Please let me know how I can get it to show me as logged in.

Thanks

Leigh

fake83
28 Jul 2010, 14:53
same problem here

NinjaKiwi
04 Apr 2011, 03:22
Any chance of a solution to this problem for VB4?

theloller
23 Apr 2011, 15:52
same problem here

help us :confused: