The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
TIMENOW and access to it outside the Forum Software
I want to display a logout button to logged in users on my new custom homepage that I am writing. I have been able to recreate the logout hash, but since it is based off of appending "time()-" to the front, the value it gets is different than what the value would be when generated by login.php.
How do I get to the global TIMENOW variable that VB uses? Do I need to just include global.php into my application? Is there another way to do this without including that entire file? Trying to avoid unnecessary bloat from 'over including' files. TIA |
#2
|
||||
|
||||
There is no difference; vBulletin uses time() as TIMENOW.
See line 32 of init.php: Code:
define('TIMENOW', time()); Check out line 1335 of functions.php: Code:
$user['securitytoken'] = sha1($user['userid'] . sha1($user['salt']) . sha1(COOKIE_SALT)); $user['logouthash'] =& $user['securitytoken']; |
#3
|
|||
|
|||
Maybe I need to update the forum that I'm working with. As this is the code from my functions.php...
PHP Code:
1. myscript.php is a script outside my forum root directory 2. login.php is the standard file included in vB Appending time() in myscript.php is going to be different than the generated one that would be generated from login.php. So when I pass the hash from one myscript.php to login.php, login.php will error out and then display a new (and correct) logout link w/proper logouthash. If the newest version of VB has dropped this timestamping feature of the logout hash then this simplifies things dramatically. |
#4
|
||||
|
||||
Ah, I didn't realize the 3.7.3 hash now included the time (I was looking at 3.7.0).
Try including your global file. At least then the constant would be in namespace. Code:
chdir('/path/to/forum'); require_once('global.php'); |
#5
|
|||
|
|||
Yeah I figured I had to do that so I started playing with that.
It works all well and good, but the logout hash is not correct. I click it and then I get an error page on login.php and it then generates a logouthash that is correct. I wonder what magical step I'm missing. Maybe I'm missing setting some cookie var, or session var. --------------- Added [DATE]1220931509[/DATE] at [TIME]1220931509[/TIME] --------------- By including the global.php shouldnt I be able to use things like $bbuserinfo inside my custom php page? --------------- Added [DATE]1220983002[/DATE] at [TIME]1220983002[/TIME] --------------- figured it out, just needed to use the right variable, $vbulletin->userinfo['logouthash'] |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|