You are here

function _ldap_api_get_ldap_settings in Lightweight Directory Access Protocol (LDAP) 6

1 call to _ldap_api_get_ldap_settings()
ldap_api_info in ./ldap_api.admin.inc
Implements the info page.

File

./ldap_api.admin.inc, line 29
Administrative page callbacks for the ldap_api module.

Code

function _ldap_api_get_ldap_settings() {
  $php_settings = array();
  $phpinfo = _ldap_api_parsePHPModules();
  $php_settings['PHP Version'] = phpversion();
  $php_settings['Drupal Version'] = VERSION;
  $php_settings['LDAP Extension Loaded'] = extension_loaded('ldap') ? 'Yes' : 'No';

  // set status array to be converted into html table.
  if ($phpinfo['Apache Environment']) {
    $php_settings['SERVER_SOFTWARE'] = $phpinfo['Apache Environment']['SERVER_SOFTWARE'];
  }
  elseif ($_SERVER["SERVER_SOFTWARE"]) {
    $php_settings['SERVER_SOFTWARE'] = $_SERVER["SERVER_SOFTWARE"];
  }
  foreach ($phpinfo['ldap'] as $key => $value) {
    $php_settings[$key] = $value[0];
  }
  $modules = module_rebuild_cache();
  $ldapmodules = array(
    'ldap_api',
    'ldap_authn',
    'ldap_authz',
    'ldap_authentication',
    'ldap_authorization',
  );
  foreach ($ldapmodules as $ldapmodule) {
    $php_settings[$ldapmodule]['status'] = $modules[$ldapmodule]->status;
    $php_settings[$ldapmodule]['schema_version'] = $modules[$ldapmodule]->schema_version;
    $php_settings[$ldapmodule]['version'] = $modules[$ldapmodule]->info['version'];
  }
  return $php_settings;
}