vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   How to generate the Log Out Hash in VB4 (https://vborg.vbsupport.ru/showthread.php?t=235600)

dummwiam 02-11-2010 11:56 AM

How to generate the Log Out Hash in VB4
 
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:
Code:

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:
Code:

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:

PHP Code:

$time time();
$securitytoken $time '-' sha1($time sha1($userid sha1($salt) . sha1($cookie_salt))); 

(Hint: $logouthash == $securitytoken)

doob 03-25-2014 11:21 PM

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.


All times are GMT. The time now is 04:23 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.01873 seconds
  • Memory Usage 1,715KB
  • 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
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete