The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
hook for password / email update
Hi everyone.
I want an external db to be syncronized with the vb forum one. i already managed to have the registration hook working so that every new user confirmed is actually backupped in my other db. Now i want to keep this data syncronizedm especially the password and the salt fields. i hooked an update script to profile_updatepassword_complete and the script is correctly called. but PHP Code:
thanks for your help! |
#2
|
||||
|
||||
Go look at the hook. It's in profile.php. If you look it up, you will see what the correct variable names are for what you want.
|
#3
|
|||
|
|||
i'm new to vbulletin and the hook system, hope i'm not doing mess :P.
i'm not sure but may be perhaps $userdata? if i use that i get Quote:
on that line i just say $udata[u_id]=$userinfo['userid']; where userinfo is just the passed array that contains userdata and udata is the new array wich need to be written. perhaps this is a problem related in used reserved names like userdata , userinfo? thanks for your assistance, much appreciated |
#4
|
||||
|
||||
Did you look up the file I asked you to and find the hook? Right above it, they define $username and $userid. Please look in the code and you will see what I mean.
|
#5
|
|||
|
|||
i had a look at profile.php.
but $username is empty $password is empty. $userid is empty $userinfo have other stuff into it. $userdata is empty i can't fetch any data at all...i can't know what user is performing the email/password update! ---------------MY SOLUTION Thanks for your help,i still need to learn Vbulletin, is an amazing software. i found a more elegant solution for my problem to sync data between those two db. I post it here for everyone that need the same backup system... this may not be fit for everyone,but in my case i wanted the website to be autonomous from the server, so i need data redundancy and i need to save on a secondary db login access plus more data related to the website. this way i still can use all website custom functions (such as login, commenting email profiling etc) while , for example, forum is under mainteinance, shut down, defaced, or even absent al all. This allows also to change the board in the future still being able to have data saved virtually everywhere. Also a quick and dirty backup of access data table only can be done much faster and stored or sent via rsync on the backup server much more frequently since it's smaller than the Vb user table. for creating a user: hook a function in "register_activate_process" then fetch user data and insert custom fields OR use an insert trigger. (the hook is better since it will create the data once the user is verified, ence able to login effectlively from website or forum) to keep data syncronized just go to your phpmyadmin panel or similar, and drop the SQL code while your forum DB is selected: PHP Code:
PHP Code:
if you want to remove a trigger just do a DROP TRIGGER triggername Obviusly in the update trigger you will also need to specify if the user is active,so he can eventually login or not. you may perhaps do more stuff, like sync across multiple websites. PHP Code:
Very important: In my case, since i did not needed data to be manipulated, this is, imho, the best option. if you need data manipulation you will still need to use the hooks. For example i did not used the insert trigger because i wanted to process user data. hope it helps. Cya |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|