vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Here is how to retrieve LOG OUT HASH for various purposes. (https://vborg.vbsupport.ru/showthread.php?t=170768)

evannn 02-17-2008 05:27 PM

Here is how to retrieve LOG OUT HASH for various purposes.
 
Many times we may need to use the LOG OUT HASH - Let's say, share a common logout between VB and non-VB pages?

Or perhaps serve as a unique ID?

Instead of including it into a config file thru PHP, why not use mysql instead? It is a centralised location for your web apps.

Requirements: mysql 5
Code:

Create  VIEW vw_usernamelist AS (select userid,username,
md5(concat(userid,salt,'<YOUR VB LICENSE CODE>')

) AS logouthash from user order by userid)

Usage:

Code:

select logouthash from vw_usernamelist where userid='12345'

Dismounted 02-18-2008 03:55 AM

How about just generate the ID dynamically with PHP? No need to query the SQL server. :)
PHP Code:

$logouthash md5($userid $salt $license); 

$userid is the user's id. $salt is the user's password salt. $license is your license number, not your customer number.

evannn 02-18-2008 05:47 AM

I opted for mysql style so that I will be able to do a query from db server directly. It will also be indepedent of any development language. Eg: A vb forum + integration with a non-PHP web scripting lang.

Dismounted 02-19-2008 08:23 AM

The code I posted is pseudo and can be adapted for different languages. Most languages will have an MD5 function built-in, and those that don't have scripts created for them.

CtrlAltDel 09-08-2008 03:56 PM

Is this still the same method used to generate the logout hash? It seems that it is different now.

[edit]

ok, nm found the new 3.7.2'ish method


All times are GMT. The time now is 03:09 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.00923 seconds
  • Memory Usage 1,716KB
  • 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