You are here

protected function LoginValidatorBase::validateCommonLoginConstraints in Lightweight Directory Access Protocol (LDAP) 8.4

Validate common login constraints for user.

Return value

bool Continue authentication.

2 calls to LoginValidatorBase::validateCommonLoginConstraints()
LoginValidatorLoginForm::processLogin in ldap_authentication/src/Controller/LoginValidatorLoginForm.php
Perform the actual logging in.
LoginValidatorSso::processLogin in ldap_authentication/src/Controller/LoginValidatorSso.php
Perform the actual logging in.

File

ldap_authentication/src/Controller/LoginValidatorBase.php, line 662

Class

LoginValidatorBase
Handles the actual testing of credentials and authentication of users.

Namespace

Drupal\ldap_authentication\Controller

Code

protected function validateCommonLoginConstraints() : bool {
  if (!$this->authenticationServers
    ->authenticationServersAvailable()) {
    $this->logger
      ->error('No LDAP servers configured for authentication.');
    if ($this->formState) {
      $this->formState
        ->setErrorByName('name', 'Server Error:  No LDAP servers configured.');
    }
    return FALSE;
  }
  $this
    ->initializeDrupalUserFromAuthName();
  if ($this->drupalUser) {
    $result = $this
      ->verifyUserAllowed();
  }
  else {
    $result = $this
      ->verifyAccountCreation();
  }
  return $result;
}