You are here

function ldap_authentication_update_8306 in Lightweight Directory Access Protocol (LDAP) 8.4

Add system administrator role for exclusion.

File

ldap_authentication/ldap_authentication.install, line 130

Code

function ldap_authentication_update_8306() : \Drupal\Core\StringTranslation\TranslatableMarkup {
  $config = \Drupal::configFactory()
    ->getEditable('ldap_authentication.settings');
  if ($config
    ->get('authenticationMode') === 'mixed') {
    $config
      ->set('skipAdministrators', TRUE);
    $config
      ->save();
    return t('Custom behaviour for user 1 has been removed. Your system administrator role has been set to be excluded from LDAP since mixed mode is active.');
  }
  $config
    ->set('skipAdministrators', FALSE);
  $config
    ->save();
  return t('Custom behaviour for user 1 has been removed. Your system administrator role has been set to be included in LDAP since exclusive mode is active.');
}