The documentation for hook_user can cause an unforeseen problem...
The API documentation for
names the four parameters for
$category = NULL
which is all very well, except for the fact the
happens to also be the name of a global variable in Drupal.
So unsuspecting developers will notice changing behaviour for
some cases if they use the
global $user: for nodes
being edited by someone not already the node author, the author
information can be lost.
The fix is exceedingly simple: just rename the param to another name of
your choosing, like
$account, suggested by Moshe and Drumm
as it appears to be already renamed that way in some places within Drupal.
Note that the same is true for various places in Drupal. Unlike, say, Delphi Pascal, PHP does not rely on function definitions matching prototypes down to the parameter name: Drupal doesn't even use prototypes, as it dynamically builds the hook names and invokes them from the dynamically built variable. So don't hesitate if you don't like a param name !