You are here

function ldaphelp_status in LDAP integration 6

1 string reference to 'ldaphelp_status'
ldaphelp_menu in ldaphelp/ldaphelp.module
Implementation of hook_menu().

File

ldaphelp/ldaphelp_status.inc, line 14
status file for ldaphelp module

Code

function ldaphelp_status() {
  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 Modules";
  $key = 'server';
  $phpinfo = ldaphelp_parsePHPModules();
  $status = ldaphelp_get_server($phpinfo, $info);
  $reportingtext .= _ldaphelp_parse_status_to_text($status, $heading);
  $content .= "<h3>{$heading}</h3>" . theme_status_report($status);

  // overall ldapauth settings
  $heading = "LDAP Authentication Settings";
  $status = ldaphelp_get_ldapauth($info);
  $content .= "<h3>{$heading}</h3>" . theme_status_report($status);
  $reportingtext .= _ldaphelp_parse_status_to_text($status, $heading);
  $conf_data = _ldaphelp_get_configuration(TRUE, NULL);
  $ldaps = $conf_data['ldaps'];
  foreach ($ldaps as $sid => $ldap) {
    $heading = "LDAP Server: " . $ldap['name'] . ' LDAP (sid=' . $ldap['sid'] . ')';
    $edit_ldap = l(t('[edit]'), "admin/settings/ldap/ldapauth/edit/" . $sid);
    $test_results = _ldaphelp_testldap($ldap, $sid);
    $status = ldaphelp_get_ldap_server($info, $sid, $ldap, $test_results, $edit_ldap);
    $content .= "<h3>{$heading}</h3>" . theme_status_report($status);
    $reportingtext .= _ldaphelp_parse_status_to_text($status, $heading, array(
      $edit_ldap => "",
    ));
  }
  $reportingtext .= _ldaphelp_parse_status_to_text(array(), "RAW ADMIN SETTINGS");
  $reportingtext .= ldaphelp_arraytotxt($conf_data['admin_settings']);
  foreach ($conf_data['ldaps'] as $sid => $ldap) {
    $reportingtext .= "\r\nLDAP sid={$sid}\r\n" . ldaphelp_arraytotxt($conf_data['ldaps'][$sid]);
  }
  $content .= '<h3>Bug and Support Reporting Info</h3><p>
  Cut and paste this into a text file and attach it to any bug or support requests.
  <strong><em>Remove or replace any data you feel should not be made public before sharing this data.</em></strong></p>
  <form><textarea cols="80" rows="20">' . $reportingtext . '</textarea></form>';
  return $content;
}