[development] Can I Indicate failure from hook_user?

Pushyamitra Navare pushyamitra at gmail.com
Wed Jul 23 15:26:58 UTC 2008

On Tue, Jul 22, 2008 at 9:01 PM, John Fiala <jcfiala at gmail.com> wrote:
> Well, one option - I'm not sure how easy it is, because I don't know
> if you're talking Drupal 5 or Drupal 6 - would be to find all the
> forms that would try to delete a user via user_delete, and change the
> validation of those forms using hook_form_alter to call your
> validation function before the submit comes along and does a
> user_delete on them.  That wouldn't require hacking core.

Thanks John. I am using Drupal 6.2.

I am sure what you say will work, and I will be able to change
validate handler though form_alter, and validate hook will be called
before user is deleted. Only problem I guess is that: it will be
called only once even if multiple users are being deleted ('coz it's
form validate handler, not user delete handler). Right?

If possible, I wanted my validate function to be called for individual
user, and delete/not delete user based on errors returned by validate


More information about the development mailing list