class CasLoginException in CAS 8
Same name and namespace in other branches
- 2.x src/Exception/CasLoginException.php \Drupal\cas\Exception\CasLoginException
Class CasLoginException.
Hierarchy
- class \Drupal\cas\Exception\CasLoginException extends \Drupal\cas\Exception\Exception
Expanded class hierarchy of CasLoginException
4 files declare their use of CasLoginException
- BulkAddCasUsers.php in src/Form/ BulkAddCasUsers.php 
- CasUserManager.php in src/Service/ CasUserManager.php 
- ServiceController.php in src/Controller/ ServiceController.php 
- ServiceControllerTest.php in tests/src/ Unit/ Controller/ ServiceControllerTest.php 
File
- src/Exception/ CasLoginException.php, line 8 
Namespace
Drupal\cas\ExceptionView source
class CasLoginException extends \Exception {
  /**
   * Auto registration turned off, and local account does not exist.
   */
  const NO_LOCAL_ACCOUNT = 1;
  /**
   * Auto reg turned on, but subscriber denied auto reg.
   */
  const SUBSCRIBER_DENIED_REG = 2;
  /**
   * Could not log user in, because Drupal account is blocked.
   */
  const ACCOUNT_BLOCKED = 3;
  /**
   * Event listener prevented login.
   */
  const SUBSCRIBER_DENIED_LOGIN = 4;
  /**
   * Error parsing CAS attributes during login.
   */
  const ATTRIBUTE_PARSING_ERROR = 5;
  /**
   * Auto registration attempted to register Drupal user that already exists.
   */
  const USERNAME_ALREADY_EXISTS = 6;
  /**
   * A user message when login failed on a subscriber cancellation.
   *
   * @var \Drupal\Component\Render\MarkupInterface|string;
   */
  protected $subscriberCancelReason;
  /**
   * Sets a user message when login failed on a subscriber cancellation.
   *
   * @param \Drupal\Component\Render\MarkupInterface|string $reason
   *   A user message to be set along with the exception.
   *
   * @return $this
   */
  public function setSubscriberCancelReason($reason) {
    if ($this
      ->getCode() === self::SUBSCRIBER_DENIED_LOGIN) {
      $this->subscriberCancelReason = $reason;
    }
    return $this;
  }
  /**
   * Returns the user message if login failed on a subscriber cancellation.
   *
   * @return \Drupal\Component\Render\MarkupInterface|string|null
   *   The reason why login failed, if any.
   */
  public function getSubscriberCancelReason() {
    return $this->subscriberCancelReason;
  }
}Members
| Name   | Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| CasLoginException:: | protected | property | A user message when login failed on a subscriber cancellation. | |
| CasLoginException:: | constant | Could not log user in, because Drupal account is blocked. | ||
| CasLoginException:: | constant | Error parsing CAS attributes during login. | ||
| CasLoginException:: | public | function | Returns the user message if login failed on a subscriber cancellation. | |
| CasLoginException:: | constant | Auto registration turned off, and local account does not exist. | ||
| CasLoginException:: | public | function | Sets a user message when login failed on a subscriber cancellation. | |
| CasLoginException:: | constant | Event listener prevented login. | ||
| CasLoginException:: | constant | Auto reg turned on, but subscriber denied auto reg. | ||
| CasLoginException:: | constant | Auto registration attempted to register Drupal user that already exists. | 
