You are here

private function LoginController::loginUserNotSetFinalize in LDAP Single Sign On 8

Same name and namespace in other branches
  1. 8.4 src/Controller/LoginController.php \Drupal\ldap_sso\Controller\LoginController::loginUserNotSetFinalize()

Finalize login with user not set.

1 call to LoginController::loginUserNotSetFinalize()
LoginController::loginRemoteUser in src/Controller/LoginController.php
Perform the actual logging in of the user.

File

src/Controller/LoginController.php, line 226

Class

LoginController
Class LoginController.

Namespace

Drupal\ldap_sso\Controller

Code

private function loginUserNotSetFinalize() {
  $this->detailLog
    ->log('User not found, SSO aborted.', [], 'ldap_sso');
  setcookie('sso_stop', 'true', $this
    ->getCookieLifeTime(), base_path(), '');
  $this
    ->messenger()
    ->addError($this
    ->t('Sorry, your LDAP credentials were not found or the LDAP server is not available. You may log in with other credentials on the %user_login_form.', [
    '%user_login_form' => Link::fromTextAndUrl('login form', Url::fromRoute('user.login'))
      ->toString(),
  ]));
  $this->detailLog
    ->log('User not found or server error, redirecting to front page', [], 'ldap_sso');
}