I have written this hook in my custom module, just to track the status changes of the users.
/**
* Implements @see hook_user_presave
*/
function mycustommodule_user_presave(&$edit, $account, $category) {
$account_user_id_=$account->uid ;
$new_status= $edit['status'];
$previous_status= $account->status;
watchdog('attention',
'User %ui changed status to: %newstat, previous status was %previousstat',
array('%ui' => $account_user_id_, '%newstat' => $new_status, '%previousstat' => $previous_status, WATCHDOG_NOTICE));
}
I noticed for example that when a user activates his newly created account by clicking on the link sent by email, the status moves to 1 which is good . But I also noticed other message that I couldn't know its cause:
"user 34 changed status to: , previous status was 1" . What makes the status of a user moves from 1 to null ?