vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   hook for user ban and registration (https://vborg.vbsupport.ru/showthread.php?t=276638)

David_R 01-08-2012 02:06 PM

hook for user ban and registration
 
I am trying to run some code whenever a user is banned or his ban is lifted. There is no direct hooks for that, I have tried using userdata_postsave hook but that only gets fired when I change user data. In most cases, I just wish to ban the user without changing any user data, so does any have any insights on what hook can I use to run my code when a user is banned or his ban is lifted.

Other problem I am facing is, that my registration hook is not executed. I am using register_addmember_complete and I am testing by adding a user from admincp, please let me know if I am doing it wrong. What should be the hook to execute code for user registration and also when a user is added via admincp.

Thanks in Advance

kh99 01-08-2012 03:15 PM

When a user is banned, the usergroup gets updated to the banned group. In the two places I looked it was done using the user data manager, so it seems like the hook you tried to use would be fired (BTW, I'm looking at vb 3.8.3 because it's what I have here - it's possible it's different in vb3.6).

As for registration, that hook doesn't get called when a user is added via the adminCP. It doesn't look like there's any hook in the adminCP code, but it does use the data manager. IIRC there's a way in the datamanger code to compare the existing fields to the update values, and I think in the case of adding a user the existing userid would be 0.


All times are GMT. The time now is 02:36 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.01632 seconds
  • Memory Usage 1,703KB
  • 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
  • (2)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