You are here

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

Same name and namespace in other branches
  1. 7.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 207

Class

LdapAuthenticationConf

Code

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];
      }
    }
    $this->enabledAuthenticationServers = array();

    // reset in case reloading instantiated object
    $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'] = config('ldap_servers.settings')
    ->get('require_ssl_for_credentails');
  $this->apiPrefs['encryption'] = config('ldap_servers.settings')
    ->get('encryption');
}