diff --git a/modules/ldapstatus/config-templates/module_ldapstatus.php b/modules/ldapstatus/config-templates/module_ldapstatus.php new file mode 100644 index 0000000000000000000000000000000000000000..728ac26a11a9b910673027a9c01cc7756028f06e --- /dev/null +++ b/modules/ldapstatus/config-templates/module_ldapstatus.php @@ -0,0 +1,18 @@ +<?php +/* + * Configuration for the module ldapstatus. + * + * $Id$ + */ + +$config = array ( + + // Ping command in Debian + Ubuntu + 'ping' => 'ping -W 1 -c 1', + + // Ping command in Mac OS X + //'ping' => 'ping -t 1 -c 1', + +); + +?> diff --git a/modules/ldapstatus/templates/default/ldapstatus.php b/modules/ldapstatus/templates/default/ldapstatus.php index 19043223f7afd6eef85a42eb7f9b92ad5db6a60c..a82b6cb4f6f93889fcd0cc044fe53a22557fbdf7 100644 --- a/modules/ldapstatus/templates/default/ldapstatus.php +++ b/modules/ldapstatus/templates/default/ldapstatus.php @@ -8,7 +8,7 @@ $this->includeAtTemplateBase('includes/header.php'); <h2>LDAP test</h2> -<table style="width: 100%"> +<table class="attributes" style="width: 100%; border: 1px solid #aaa"> <tr> <th>Name of institusion</th> <th>Conf</th> @@ -38,15 +38,16 @@ function showRes($key, $res, $template) { />'; } } else { - echo('<span style="color: #eee;">NA</span>'); + echo('<span style="color: #b4b4b4; font-size: x-small">NA</span>'); } echo('</td>'); } +$i = 0; +$classes = array('odd', 'even'); foreach($this->data['results'] as $orgkey => $res) { - echo('<tr>'); -# print_r($this->data['orgconfig']); exit; + echo('<tr class="' . ($classes[($i++ % 2)]) . '">'); echo('<td>' . htmlspecialchars($this->getTranslation($this->data['orgconfig'][$orgkey]['description'])) . '</td>'); showRes('config', $res, $this); showRes('configMeta', $res, $this); diff --git a/modules/ldapstatus/www/index.php b/modules/ldapstatus/www/index.php index da693640bcfceb05bf4127065b095b72943063ff..d272f8dd26330badc9312d8879ef997bf2e61cdf 100644 --- a/modules/ldapstatus/www/index.php +++ b/modules/ldapstatus/www/index.php @@ -12,8 +12,9 @@ if (!$session->isValid('login-admin') ) { $ldapconfig = $config->copyFromBase('loginfeide', 'config-login-feide.php'); +$ldapStatusConfig = $config->copyFromBase('ldapstatus', 'module_ldapstatus.php'); - +$pingcommand = $ldapStatusConfig->getValue('ping'); $orgs = $ldapconfig->getValue('orgldapconfig'); @@ -45,7 +46,10 @@ foreach ($orgs AS $orgkey => $orgconfig) { $pingreturn = NULL; $pingoutput = NULL; - exec('ping -W 1 -c 1 ' . escapeshellcmd($url['host']), $pingoutput, $pingreturn); + +# echo 'Ping command: ' . $pingcommand; exit; + + exec($pingcommand . ' ' . escapeshellcmd($url['host']), $pingoutput, $pingreturn); # echo $pingreturn; exit;