You are here

protected function SocialAuthUserManager::isAdminDisabled in Social Auth 8

Checks if Admin (user 1) can login.

Parameters

\Drupal\user\UserInterface $drupal_user: User object to check if user is admin.

Return value

bool True if user 1 can't login. False otherwise

1 call to SocialAuthUserManager::isAdminDisabled()
SocialAuthUserManager::authenticateExistingUser in src/SocialAuthUserManager.php
Authenticates and redirects existing users in authentication process.

File

src/SocialAuthUserManager.php, line 424

Class

SocialAuthUserManager
Contains all logic that is related to Drupal user management.

Namespace

Drupal\social_auth

Code

protected function isAdminDisabled(UserInterface $drupal_user) {
  if ($this->configFactory
    ->get('social_auth.settings')
    ->get('disable_admin_login') && $drupal_user
    ->id() == 1) {
    return TRUE;
  }
  return FALSE;
}