1

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 1

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.