View Full Version : How to generate the Log Out Hash in VB4
dummwiam
02-11-2010, 11:56 AM
Can anyone tell me how I will be able to generate the logout hash, in order to logout the user from the root site?
I found a relative post for VB3 that was something like this:
md5($userid . $sal . $license)
But that doesn't seem to work in VB4.
Thanx in advance :)
bananalive
02-11-2010, 12:13 PM
It's within the within the userinfo of the user
Within php files use: $vbulletin->userinfo['logouthash']
Within templates use: {vb:raw bbuserinfo.logouthash}
dummwiam
02-11-2010, 12:18 PM
My Forum resides inside /forum/ directory and the main code is outside (I am using the Kohana framework) so I don't want and I don'thave any access to the VB variables or code, I will have to generate it myself.
Anyway I made some progress and figured out the first part of the hash... see what I mean bellow in the url:
login.php?do=logout&logouthash=1265897467-dd88ae6c82e21b914e1a5dbb1b9fed44f40fee57
the first part 1265897467 is the value from session.lastactivity field, but the second value is always changing and I cannot figure out how to calculate it.
Thanx
Incendium
03-13-2010, 12:53 AM
As of 3.8.4 PL2 and 4.0.0 PL1, the license is no longer used to generate the security token. Instead, it uses a randomly generated hash called COOKIE_SALT which can be found at the top of functions.php. You can use this code to generate the security token:
$time = time();
$securitytoken = $time . '-' . sha1($time . sha1($userid . sha1($salt) . sha1($cookie_salt)));
(Hint: $logouthash == $securitytoken)
Sweet! This thread was EXACTLY what I needed today!
Am plugging the navbar functions into external directories and could not get the logouthash to work. swapping $bbuserinfo['logout'] for $vbulletin->userinfo['logouthash']
did the trick.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.