Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 11 May 2014, 12:31
principle_slw principle_slw is offline
 
Join Date: Nov 2003
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
Reply With Quote
  #2  
Old 11 May 2014, 12:47
kh99 kh99 is offline
 
Join Date: Aug 2009
Real name: Kevin
$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.

Last edited by kh99; 11 May 2014 at 12:52.
Reply With Quote
  #3  
Old 11 May 2014, 16:21
principle_slw principle_slw is offline
 
Join Date: Nov 2003
Thanks very much you where correct $db->query_first() was returning an array.

Thanks for the help
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 16:17.

Layout Options | Width: Wide Color: