You are here

public function UnblockUser::execute in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/user/src/Plugin/Action/UnblockUser.php \Drupal\user\Plugin\Action\UnblockUser::execute()

Executes the plugin.

Overrides ExecutableInterface::execute

File

core/modules/user/src/Plugin/Action/UnblockUser.php, line 27
Contains \Drupal\user\Plugin\Action\UnblockUser.

Class

UnblockUser
Unblocks a user.

Namespace

Drupal\user\Plugin\Action

Code

public function execute($account = NULL) {

  // Skip unblocking user if they are already unblocked.
  if ($account !== FALSE && $account
    ->isBlocked()) {
    $account
      ->activate();
    $account
      ->save();
  }
}