Act on a user account being inserted or updated.
This hook is invoked before the user account is saved to the database.
$account: The user account object.
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
function hook_user_presave($account) {
// Ensure that our value is an array.
if (isset($account->mymodule_foo)) {
$account->mymodule_foo = (array) $account->mymodule_foo;
}
}