You are here

function ldap_sso_update_8001 in LDAP Single Sign On 8.4

Same name and namespace in other branches
  1. 8 ldap_sso.install \ldap_sso_update_8001()

Moves SSO to own schema.

File

./ldap_sso.install, line 13

Code

function ldap_sso_update_8001() {
  $config_factory = \Drupal::configFactory();
  $config_old = $config_factory
    ->getEditable('ldap_authentication.settings');
  $config_new = $config_factory
    ->getEditable('ldap_sso.settings');
  $config_new
    ->set('ssoExcludedPaths', $config_old
    ->get('ssoExcludedPaths'));
  $config_new
    ->set('ssoExcludedHosts', $config_old
    ->get('ssoExcludedHosts'));
  $config_new
    ->set('ssoRemoteUserStripDomainName', $config_old
    ->get('ssoRemoteUserStripDomainName'));
  $config_new
    ->set('seamlessLogin', $config_old
    ->get('seamlessLogin'));
  $config_new
    ->set('cookieExpire', $config_old
    ->get('cookieExpire'));
  $config_new
    ->set('ldapImplementation', $config_old
    ->get('ldapImplementation'));
  $config_new
    ->save(TRUE);
  $config_old
    ->clear('ssoExcludedPaths');
  $config_old
    ->clear('ssoExcludedHosts');
  $config_old
    ->clear('seamlessLogin');
  $config_old
    ->clear('ssoRemoteUserStripDomainName');
  $config_old
    ->clear('cookieExpire');
  $config_old
    ->clear('ldapImplementation');
  $config_old
    ->save(TRUE);
}