[development] Can I Indicate failure from hook_user?

Pushyamitra Navare pushyamitra at gmail.com
Tue Jul 22 04:03:31 UTC 2008


On Mon, Jul 21, 2008 at 3:53 PM, Steven Jones <darthsteven at gmail.com> wrote:
> You'll probably want to do something with the $op == "validate"
> argument of hook_user. Throw an error if you don't want the
> update/insert to continue.

Ok, thanks Steven! I will try to see how can I use hook_user's
validate operation for my purpose.

But can you tell me, is "validate" operation invoked for both "insert"
and "update"? If yes, then how do I know in hook_user if it is being
called for insert or for update? What parameter of hook_user should I
check? I quickly went through documentation but did not find anything.

Also, i need such a "validate" hook for "user delete" operation as
well. Any way to do that?

Thanks,
Pushyamitra


> On Mon, Jul 21, 2008 at 10:26 AM, Pushyamitra Navare
>> If Drupal hooks currently don't check for return value, would it be good
>> idea to add such a functionality? A "pre-operation" hook, which will
>> indicate (boolean TRUE/ FALSE) if the operation should continue or not. Such
>> a hook could be used for various validations when Drupal is integrated with
>> some third-party applications.


More information about the development mailing list