vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   [How-To] Deal with User deletion/pruning and Username Changes (https://vborg.vbsupport.ru/showthread.php?t=97132)

Andreas 09-28-2005 10:00 PM

[How-To] Deal with User deletion/pruning and Username Changes
 
If your Hack keeps user dependant Data (in it's own tables), you should code Plugins for the following Hooks to react on Events where this Data does change, eg. when Users get deleted or their Username changed.
Otherwise you might end up with invalid data or data for users that don't even exist anymore

Hook userdata_delete
This Hook will be called when a single Users gets deleted.
The Userid is $this->existing['userid']

Hook useradmin_prune
This Hook will be called when Users are being mass-pruned
The affected Userids are $userids, which is a comma-separated string of User-IDs.

Hook userdata_update_username
This Hook is called when the Username of a User is being changed.
$userid is the UserID, $username the new Username and $this->existing['username'] is the old Username.

Please note that the two userdata Hooks are within the User Data Manager, whichj means that $vbulletin and $db as well as all other global variables are not within the scope and you have to use $this->registry and $this->dbobject (or $this->registry->db) instead.


All times are GMT. The time now is 11:13 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01094 seconds
  • Memory Usage 1,702KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (1)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete