You are here

public function LdapAuthenticationConf::load in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_authentication/LdapAuthenticationConf.class.php \LdapAuthenticationConf::load()
  2. 7 ldap_authentication/LdapAuthenticationConf.class.php \LdapAuthenticationConf::load()
2 calls to LdapAuthenticationConf::load()
LdapAuthenticationConf::__construct in ldap_authentication/LdapAuthenticationConf.class.php
LdapAuthenticationConfAdmin::save in ldap_authentication/LdapAuthenticationConfAdmin.class.php

File

ldap_authentication/LdapAuthenticationConf.class.php, line 301

Class

LdapAuthenticationConf

Code

public function load() {
  if ($saved = variable_get("ldap_authentication_conf", FALSE)) {
    $this->inDatabase = TRUE;
    foreach ($this->saveable as $property) {
      if (isset($saved[$property])) {
        $this->{$property} = $saved[$property];
      }
    }

    // Reset in case reloading instantiated object.
    $this->enabledAuthenticationServers = [];
    $enabled_ldap_servers = ldap_servers_get_servers(NULL, 'enabled');
    foreach ($this->sids as $sid => $enabled) {
      if ($enabled && isset($enabled_ldap_servers[$sid])) {
        $this->enabledAuthenticationServers[$sid] = $enabled_ldap_servers[$sid];
      }
    }
  }
  else {
    $this->inDatabase = FALSE;
  }
  $this->ldapUser = new LdapUserConf();
  $this->ssoEnabled = module_exists('ldap_sso');
  $this->apiPrefs['requireHttps'] = variable_get('ldap_servers_require_ssl_for_credentials', 0);
  $this->apiPrefs['encryption'] = variable_get('ldap_servers_encryption', LDAP_SERVERS_ENC_TYPE_CLEARTEXT);
}