Newer
Older
<?php
$this->data['header'] = 'LDAP status page';
$this->includeAtTemplateBase('includes/header.php');
?>
<div id="content">
<h2>LDAP test</h2>
Andreas Åkre Solberg
committed
<table class="attributes" style="font-size: small; width: 100%; border: 1px solid #aaa">
<tr>
Andreas Åkre Solberg
committed
<th>Name of institusion</th>
<th>Conf</th>
<th>Ping</th>
<th>Admin bind()</th>
Andreas Åkre Solberg
committed
<th>S=bogus</th>
Andreas Åkre Solberg
committed
<th>test</th>
Andreas Åkre Solberg
committed
<th>S=test</th>
<th>test bind()</th>
<th>attributes</th>
<th>Meta</th>
</tr>
<?php
function showRes($key, $res, $template) {
echo('<td>');
if (array_key_exists($key, $res)) {
if ($res[$key][0]) {
echo '<img src="/' . $template->data['baseurlpath'] . 'resources/icons/accept.png" ' .
'alt="' . htmlspecialchars($res[$key][1]) . '"
title="' . htmlspecialchars($res[$key][1]) . '"
/>';
} else {
echo '<img src="/' . $template->data['baseurlpath'] . 'resources/icons/delete.png" ' .
'alt="' . htmlspecialchars($res[$key][1]) . '"
title="' . htmlspecialchars($res[$key][1]) . '"
/>';
}
} else {
Andreas Åkre Solberg
committed
echo('<span style="color: #b4b4b4; font-size: x-small">NA</span>');
}
echo('</td>');
}
Andreas Åkre Solberg
committed
Andreas Åkre Solberg
committed
$i = 0;
$classes = array('odd', 'even');
Andreas Åkre Solberg
committed
# $this->data['results']
foreach($this->data['sortedOrgIndex'] as $orgkey) {
$res = $this->data['results'][$orgkey];
Andreas Åkre Solberg
committed
echo('<tr class="' . ($classes[($i++ % 2)]) . '">');
if (array_key_exists('description', $this->data['orgconfig'][$orgkey])) {
echo('<td>' . htmlspecialchars($this->getTranslation($this->data['orgconfig'][$orgkey]['description'])) . '</td>');
} else {
echo('<td><span style="color: #b4b4b4; font-size: x-small">NA</span> <tt>' . $orgkey . '</tt></td>');
showRes('config', $res, $this);
showRes('ping', $res, $this);
Andreas Åkre Solberg
committed
showRes('adminBind', $res, $this);
showRes('ldapSearchBogus', $res, $this);
Andreas Åkre Solberg
committed
showRes('configTest', $res, $this);
Andreas Åkre Solberg
committed
showRes('ldapSearchTestUser', $res, $this);
showRes('ldapBindTestUser', $res, $this);
showRes('ldapGetAttributesTestUser', $res, $this);
Andreas Åkre Solberg
committed
showRes('configMeta', $res, $this);
echo('</tr>');
}
?>
</table>
<?php $this->includeAtTemplateBase('includes/footer.php'); ?>