Exemplo n.º 1
0
 /**
  * Unblock a user.
  *
  * @param \Drupal\user\UserInterface $user
  *   The user to unblock.
  */
 protected function doExecute(UserInterface $user)
 {
     // Do nothing if user is anonymous or isn't blocked.
     if ($user->isAuthenticated() && $user->isBlocked()) {
         $user->activate();
         // Set flag that indicates if the entity should be auto-saved later.
         $this->saveLater = TRUE;
     }
 }
 /**
  * {@inheritdoc}
  */
 public function isBlocked()
 {
     return $this->subject->isBlocked();
 }
Exemplo n.º 3
0
 /**
  * Check if user is blocked.
  *
  * @param \Drupal\user\UserInterface $account
  *   The account to check.
  *
  * @return bool
  *   TRUE if the account is blocked.
  */
 protected function doEvaluate(UserInterface $account)
 {
     return $account->isBlocked();
 }