You are here

function ldap_help_status in Lightweight Directory Access Protocol (LDAP) 7.2

Same name and namespace in other branches
  1. 8.2 ldap_help/ldap_help.status.inc \ldap_help_status()
  2. 7 ldap_help/ldap_help.status.inc \ldap_help_status()
1 call to ldap_help_status()
ldap_help_issues in ldap_help/ldap_help.issues.inc
1 string reference to 'ldap_help_status'
ldap_help_menu in ldap_help/ldap_help.module
Implements hook_menu().

File

ldap_help/ldap_help.status.inc, line 11
Status file for ldaphelp module.

Code

function ldap_help_status($return = 'html') {
  drupal_add_css(drupal_get_path('module', 'system') . '/system.css', 'module', 'all', FALSE);
  include_once drupal_get_path('module', 'system') . '/system.admin.inc';

  // Server and LDAP Module Data.
  $heading = "Server and LDAP Module";
  $key = 'server';
  $phpinfo = ldap_help_parsePHPModules();
  $status['server'] = ldap_help_get_server($phpinfo, $info);
  $reporting_text = _ldap_help_parse_status_to_text($status['server'], $heading);
  $content = "<h3>{$heading}</h3>" . theme('status_report', [
    'requirements' => $status['server'],
  ]);
  $status['user_settings'] = ldap_help_get_user_settings();
  $content .= "<h3>User Settings</h3>" . theme('status_report', [
    'requirements' => $status['user_settings'],
  ]);
  if (module_exists('ldap_servers')) {
    list($status['ldap_servers'], $servers) = ldap_help_get_ldap_servers();
    $content .= "<h3>General Settings</h3>" . theme('status_report', [
      'requirements' => $status['ldap_servers'],
    ]);
    foreach ($servers as $sid => $server) {
      $content .= "<h3>Server: " . $server[1]['value'] . "</h3>" . theme('status_report', [
        'requirements' => $server,
      ]);
    }
  }
  if (module_exists('ldap_authentication')) {
    $status['ldap_authentication'] = ldap_help_get_ldap_authentication();
    $content .= "<h3>LDAP Authentication Settings</h3>" . theme('status_report', [
      'requirements' => $status['ldap_authentication'],
    ]);
  }
  if (module_exists('ldap_authorization')) {
    $status['ldap_authorizations'] = ldap_help_get_ldap_authorization();
    if (count($status['ldap_authorizations'])) {
      foreach ($status['ldap_authorizations'] as $sid => $mapping) {
        $content .= "<h3>LDAP Authorization Mapping</h3>" . theme('status_report', [
          'requirements' => $mapping,
        ]);
      }
    }
  }
  if ($return == 'array') {
    return $status;
  }
  else {
    return $content;
  }
}