1 user.actions.inc user_unblock_user_action($account, &$context)

Unblocks a specific user account.

Parameters

User $account: The user entity whose account will be unblocked.

Related topics

File

core/modules/user/user.actions.inc, line 42
Action callbacks for User module.

Code

function user_unblock_user_action($account, &$context) {
  if ($account->status == 0) {
    $account->status = 1;
    $account->save();
  }
}