You are here

protected function SettingsTrait::isRegistrationDisabled in Social Auth 8.2

Same name and namespace in other branches
  1. 3.x src/SettingsTrait.php \Drupal\social_auth\SettingsTrait::isRegistrationDisabled()

Checks if user registration is disabled.

Return value

bool True if registration is disabled False if registration is not disabled

2 calls to SettingsTrait::isRegistrationDisabled()
UserAuthenticator::authenticateNewUser in src/User/UserAuthenticator.php
Authenticates and redirects new users in authentication process.
UserManager::createUser in src/User/UserManager.php
Create a new user account.

File

src/SettingsTrait.php, line 42

Class

SettingsTrait
Helper methods for Social Auth and Drupal settings.

Namespace

Drupal\social_auth

Code

protected function isRegistrationDisabled() {

  // Check if Drupal account registration settings is Administrators only
  // OR if it is disabled in Social Auth Settings.
  return $this->configFactory
    ->get('user.settings')
    ->get('register') == 'admin_only' || $this->configFactory
    ->get('social_auth.settings')
    ->get('user_allowed') == 'login';
}