You are here

public function SimpleLdapUserAuthenticator::skipCheck in Simple LDAP 8

Whether we should skip any LDAP checks on a User object.

Parameters

$user: A User object.

Return value

boolean TRUE if this User should be skipped and LDAP ignored.

File

modules/simple_ldap_user/src/SimpleLdapUserAuthenticator.php, line 76

Class

SimpleLdapUserAuthenticator

Namespace

Drupal\simple_ldap_user

Code

public function skipCheck(UserInterface $user) {
  $uid = $user
    ->get('uid')->value;

  // If User 1 or anonymous or blocked...
  if ($uid == 1 || $user
    ->isAnonymous() || $user
    ->isBlocked()) {
    return TRUE;
  }
  return FALSE;
}