[development] Can I Indicate failure from hook_user?
pushyamitra at gmail.com
Tue Jul 22 14:48:11 UTC 2008
On Tue, Jul 22, 2008 at 7:15 PM, Earnie Boyd
<earnie at users.sourceforge.net> wrote:
> Well that isn't too friendly. If you don't want the user to be deleted you
> could use a hook_form_alter to hide or remove the button.
Well, ideally I would like the pre-user-delete-validate function to be
called for every user. If I disable button etc. through
hook_form_alter, then either all users will be deleted or none. I
won't be able to validate individual users and decide to delete or not
delete that user.
I actually ended up modifying user.module code and calling my own
validate function just before deleting user. Based on validate
function's result I either delete the user or just register error. (
The obvious pain would arise when I wish to upgrade to newer Drupal
version in future. I would have patch the new user.module as wel. ).
For now, it's working...
More information about the development