You are here

public function CasPreLoginEvent::cancelLogin in CAS 2.x

Same name and namespace in other branches
  1. 8 src/Event/CasPreLoginEvent.php \Drupal\cas\Event\CasPreLoginEvent::cancelLogin()

Cancels the login operation.

Parameters

\Drupal\Component\Render\MarkupInterface|string|null $reason: (optional) A user message explaining why the login has been canceled. If passed, this value will be used to show a message to the user that tries to login. If omitted, a standard message will be displayed.

Return value

$this

File

src/Event/CasPreLoginEvent.php, line 110

Class

CasPreLoginEvent
Class CasPreLoginEvent.

Namespace

Drupal\cas\Event

Code

public function cancelLogin($reason = NULL) {
  $this->allowLogin = FALSE;
  $this->cancelLoginReason = $reason;
  return $this;
}