1 user.module user_save($account)

Save a new or updated user.


$account: The user object to modify or add. If you want to modify an existing user account, you need to ensure that (a) $account is an object, and (b) you have set $account->uid to the numeric user ID of the user account you wish to modify. If you want to create a new user account, you can set $account->is_new to TRUE or omit the $account->uid field.

Return value

int: Either SAVED_NEW or SAVED_UPDATED depending on the operation performed.


core/modules/user/user.module, line 335
Enables the user registration and login system.


function user_save($account) {
  return $account->save();