You are here

public function CasPreLoginEvent::cancelLogin in CAS 8

Same name and namespace in other branches
  1. 2.x 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

1 call to CasPreLoginEvent::cancelLogin()
CasPreLoginEvent::setAllowLogin in src/Event/CasPreLoginEvent.php
Set the $allowLogin property.

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;
}