The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
We're switching to using vB (3.6.x) login across our site.
We have a plugin that is issuing a cookie for a legacy system but need to get the user's email address for it. $vbulletin->userinfo['email'] doesn't seem to be loaded at this point (the "login_verify_success" hook). I can hack the verify_authentication routine to load email in there but would rather not mod the core code. Is ther any other way to get it? Thanks! |
#2
|
|||
|
|||
![]()
At which hook are you executing your code exactly?
|
#3
|
|||
|
|||
![]()
We're using the "login_verify_success" hook.
(Thanks for asking. I'll edit my post to show this too.) |
#4
|
|||
|
|||
![]()
I've had a look and I think you'll have to edit the SQL for this one, unless you don't mind making an extra query in your hook to fetch the e-mail address.
|
#5
|
|||
|
|||
![]() Quote:
It'd be swell if 'email' was in that query anyway. I'd sure prefer not to modify the base code but, as you say, better that then to do a whole new extra query. Thanks again for your replies. I'm still hoping that someone else may know another place where the value has been loaded but suspect that this is "the way". |
#6
|
|||
|
|||
![]()
I suggest that you move to a hook location that is loaded later when the userinfo is available, if possible.
|
#7
|
|||
|
|||
![]() Quote:
We need it to get called immediately after successful logon and without depending on going to a vB page other than the "success" redirect page. What we're expecting to do is actually have legacy board logon go to the vB logon and return the users to the legacy system after success. The legacy system keeps the email address in the session cookie so that the database doesn't have to be hit again for it on post, etc. Thanks again. It looks like the small code mod to add "email" to the base query is the way to do it. |
#8
|
|||
|
|||
![]()
You could try global_start. It is executed in global.php after the userinfo is loaded.
Otherwise the following article might be usefull to find a better location: https://vborg.vbsupport.ru/showthread.php?t=94338 |
#9
|
|||
|
|||
![]() Quote:
I looked at this and it comes too late for our purposes but it does bring up a question about user session management. It looks like the system is doing a new query (or set of queries) whenever it needs to know the user info. My question is: why isn't this just loaded into a (single) cookie that can be used for userdata reference instead of re-hitting the database? The cookie could be timestamped for a freshness check and it can also be refreshed or completely re-issued from time to time -- like whenever a user does something significant. Using the cookie more and the database less might be a good thing. Hope this is a useful thought. |
#10
|
|||
|
|||
![]()
I doubt that would be very usefull for a few reasons:
- Cookies could be manipulated (ok, there could be a checksum, but if the algorithm gets public, that is useless) - The userinfo can be changed between the time the cookie was created and the time the user browse the board. Imagine you ban someone and it wil only take effect once his cookie timeout. - .... |
![]() |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|