I'm trying to execute some custom code in drupal 6 after i ban/block a user. What would be the appropriate way to do this? I tried using hook_user specifically looking for an 'update' $op when I block a user, but no 'update' operation seems to get passed into my hook, only 'load' gets passed. I guess the equivalent of this in Drupal 7 would be hook_user_cancel.
1 Answer
hook_user() has an operation for delete, it does however lack an option for ban or block. In this case you should use the rules module and implement a custom action that gets called when a user is banned, the action being in your custom code. There's a few Drupalcon presentations on Rules, Conditions and Actions available on Drupal.org.