The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Query in plugin simply wont work?
Hi I'm using the plugin register_addmember_complete and can not for the life of me get this to work. All i'm looking for is the users password hash
HERE are the current contents. $uidn = $vbulletin->userinfo['userid']; $db = $vbulletin->db; $a = $db->query_first("SELECT password FROM user WHERE userid = '4' "); vbsetcookie('userid', $vbulletin->userinfo['userid'], true, true, true); vbsetcookie('password', md5($a . COOKIE_SALT''), true, true, true); vbsetcookie('useridtmp', $a, true, true, true); $a is empty so my password is simply set to a hash of my cookie salt? --------------------------------------------------------------------------------- I've also tried this, vbsetcookie('userid', $vbulletin->userinfo['userid'], true, true, true); vbsetcookie('password', md5($vbulletin->userinfo['password'] . COOKIE_SALT), true, true, true); Same thing $vbulletin->userinfo['password'] is blank? so once again password cookies becomes just a hash of the cookie salt ------------------------------------------------------------------------------------- I've also tried this $uidn = intval($vbulletin->userinfo['userid']); $newpw = $db->query_read("SELECT password FROM user WHERE userid = $uidn"); Nothing seems capable of simply returning the users password? Any help greatly appreciated. Thanks |
#2
|
|||
|
|||
$db->query_first() will return an array (even if you are selecting only one field), or else NULL if it fails. So you should check for NULL, but maybe just try using $a['password'] and see if that works.
Edit: also I don't think $vbulletin->userinfo has been updated at that point (since the user was just created), so try using $userinfo and/or $userid instead. And of course using those is probably better than doing your own query. |
#3
|
|||
|
|||
Thanks very much you where correct $db->query_first() was returning an array.
Thanks for the help |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|