View Full Version : [fixed] Logging out as a guest removes all guest sessions
khalid
Sun 14th Jul '02, 5:12pm
I am not sure if it is considered a bug or not.
If a visitor (not logged in user or not registered) runs the logout action in a forum, he will remove all (online visitors) who appear in the "who's online" bar at the bottom of the main forum's page.
Example: run this url as a visitor and see how many visitors on line after that:
http://www.vbulletin.com/forum/member.php?action=logout
nuno
Sun 14th Jul '02, 5:26pm
Hehehe, this will logout all guests, so funny :D
Paul
Sun 14th Jul '02, 7:02pm
Oh for the love of....
Another guest bug.... :mad:
khalid
Tue 16th Jul '02, 10:18am
Any solution for this problem ???
Paul
Wed 17th Jul '02, 5:35pm
I think this needs to be moved into the bug forum. Confirmed on both my site and on vbulletin.com.
Paul
Paul
Wed 17th Jul '02, 5:48pm
// make sure any other of this user's sessions are deleted (incase they ended up with more than one)
$DB_site->query("DELETE FROM session WHERE userid='$bbuserinfo[userid]'");
This little tidbit of code seems to be the problem. Checking if the userid != 0 before running it should solve it. The following should work (don't sue me if it doesn't) ;)
Find the above code in member.php and replace $DB_site->query("DELETE FROM session WHERE userid='$bbuserinfo[userid]'"); with the following:
// Guest logout bug fix - Jul 17, 2002 - Paul
// $DB_site->query("DELETE FROM session WHERE userid='$bbuserinfo[userid]'");
if ($bbuserinfo[userid]!=0 and $bbuserinfo[userid]!=-1) {
$DB_site->query("DELETE FROM session WHERE userid='$bbuserinfo[userid]'");
}
// End guest logout bug fix
I'm not too sure what a userid of -1 means, but considering the check was done a few lines up, I figured it wouldn't hurt to include it as well. *shrug*
Paul
Edit: Wouldn't it be nice if I mentioned which file? ;)
Scott MacVicar
Wed 17th Jul '02, 6:29pm
That would be an appropriate fix.
Raz Meister
Wed 17th Jul '02, 6:51pm
// make sure any other of this user's sessions are deleted (incase they ended up with more than one)
$DB_site->query("DELETE FROM session WHERE userid='$bbuserinfo[userid]' LIMIT 1");Would remove only one guest user from the who's online.
Paul
Wed 17th Jul '02, 6:57pm
Originally posted by Razzie
// make sure any other of this user's sessions are deleted (incase they ended up with more than one)
$DB_site->query("DELETE FROM session WHERE userid='$bbuserinfo[userid]' LIMIT 1");
Would remove only one guest user from the who's online.
Scott MacVicar
Wed 17th Jul '02, 7:38pm
Actually it wont remove the correct session and may cause problems for another user.
Powered by vBulletin™ Version 4.0.2 Copyright © 2010 vBulletin Solutions, Inc. All rights reserved.