protected function SettingsTrait::isAdminDisabled in Social Auth 8.2
Same name and namespace in other branches
- 3.x src/SettingsTrait.php \Drupal\social_auth\SettingsTrait::isAdminDisabled()
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 SettingsTrait::isAdminDisabled()
- UserAuthenticator::authenticateExistingUser in src/
User/ UserAuthenticator.php - Authenticates and redirects existing users in authentication process.
File
- src/
SettingsTrait.php, line 70
Class
- SettingsTrait
- Helper methods for Social Auth and Drupal settings.
Namespace
Drupal\social_authCode
protected function isAdminDisabled(UserInterface $drupal_user) {
return $this->configFactory
->get('social_auth.settings')
->get('disable_admin_login') && $drupal_user
->id() == 1;
}