The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Accessing User Info in Plugin Code
Hi experts,
I'm currently working on integrating our legacy login system with VBulletin. As such, I've created a new plugin for the 'login_verify_success' hook. Next, I'm trying to set a few session variables that are needed by our other system. I'm running into troubles with accessing all the userinfo fields. The below code works fine, and the session variable is set correctly. (Works for userid, usergroupid, membergroupid, infractiongroupids, username password, and salt) PHP Code:
When I'm trying to access other values such as email or custom fields, the session variables remains empty. Is my syntax incorrect? PHP Code:
Thanks! |
#2
|
|||
|
|||
Does anybody know how to access the userinfo data structure in the plugin code section?
|
#3
|
|||
|
|||
I'm not really familiar with that, but since no one else answered...I grep'ed for 'login_verify_success' and found it in includes/functions_login.php around line 149. Right above that some user data is read from the database, so I guess you could either modify that query to add the fields you need, or else do a similar query in your code. (Because, although I don't know, I'm guessing that at least some of those data items you want are not available unless you somehow get them from the db).
|
#4
|
|||
|
|||
Well, the strange thing is if I do a print_r of the vbulletin datastructure, all the fields show up correctly (email, skype, aim, etc). But I can't seem to access them.
As a last resort, I can have an extra query for getting the data I need. Thanks for your input. |
#5
|
|||
|
|||
Hmm...after verify_authentication(), process_login() is called (also in function_login.php), and it looks like maybe that sets up the full $vbulletin->userdata. So maybe you can try moving your plugin to the login_process hook that's called at the end of process_login().
|
#6
|
|||
|
|||
Case Close!
@kh99: Thanks a lot for this pointer. That's the right hook and all the data is available. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|