I have a small module that validates users creating new accounts using the 'validate' op in the _user hook. However this hook also gets invoked when they try to change any aspect of their profile.
How do I tell the difference between these two contexts?
The best stab I have is that $account['status'] is set to 1 when someone is trying to change their profile, but it isn't in either of the cases that a non-user is trying to create an account or an admin person is creating one for them.
But where is the documentation? Is this the right test or is there a better one?
A personal gripe: far too much of the documentation has MS disease. i.e. it is all "how to" rather than explaining intentions and documenting the data structures that are used. It's easy to write "how to"s but they rarely work much beyond the particular task they describe. Everything in hook_user is in terms of an edit and an account array but nowhere is there any description of what the significance is of the entries in these arrays.
Chris