phpldapadmin/htdocs/server_info.php

90 lines
2.3 KiB
PHP
Raw Permalink Normal View History

2009-06-30 09:22:30 +00:00
<?php
2009-06-30 09:29:51 +00:00
/**
2009-06-30 08:05:37 +00:00
* Fetches and displays all information that it can from the specified server
2009-06-30 09:29:51 +00:00
*
* @package phpLDAPadmin
* @subpackage Page
2009-06-30 08:05:37 +00:00
*/
2009-06-30 09:29:51 +00:00
/**
*/
require './common.php';
2009-06-30 09:29:51 +00:00
2009-07-12 02:28:39 +00:00
$attrs = $app['server']->getRootDSE();
printf('<h3 class="title">%s%s</h3>',_('Server info for: '),$app['server']->getName());
2009-06-30 10:26:08 +00:00
printf('<h3 class="subtitle">%s</h3>',_('Server reports the following information about itself'));
2009-06-30 08:05:37 +00:00
if (! count($attrs)) {
2009-06-30 10:26:08 +00:00
echo '<br /><br />';
printf('<center>%s</center>',_('This server has nothing to report.'));
2009-06-30 10:46:00 +00:00
return;
2009-06-30 09:29:51 +00:00
}
2009-06-30 08:05:37 +00:00
2009-06-30 11:51:50 +00:00
echo '<table class="result" border=0>';
foreach ($attrs as $key => $values) {
if ($key == 'dn')
2009-06-30 10:26:08 +00:00
continue;
2009-06-30 08:05:37 +00:00
2009-06-30 11:51:50 +00:00
echo '<tr class="list_item"><td class="heading" rowspan=2>';
$sattr = $app['server']->getSchemaAttribute($key);
if ($sattr) {
$href = sprintf('cmd.php?cmd=schema&amp;server_id=%s&amp;view=attributes&amp;viewvalue=%s',$app['server']->getIndex(),$sattr->getName());
printf('<a href="%s" title="%s: %s" >%s</a>',
$href,_('Click to view the schema definition for attribute type'),$sattr->getName(false),$sattr->getName(false));
} else
echo $key;
2009-06-30 10:26:08 +00:00
echo '</td></tr>';
2009-06-30 09:29:51 +00:00
2009-06-30 11:51:50 +00:00
echo '<tr class="list_item"><td class="blank">&nbsp;</td><td class="value">';
echo '<table class="result" border=0>';
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
if (is_array($values))
foreach ($values as $value) {
$oidtext = '';
print '<tr>';
2009-06-30 09:29:51 +00:00
if (preg_match('/^[0-9]+\.[0-9]+/',$value)) {
printf('<td width=5%% rowspan=2 style="vertical-align: top"><img src="%s/rfc.png" title="%s" alt="%s"/></td>',
IMGDIR,$value,htmlspecialchars($value));
2009-06-30 09:29:51 +00:00
if ($oidtext = support_oid_to_text($value))
if (isset($oidtext['ref']))
printf('<td><acronym title="%s">%s</acronym></td>',$oidtext['ref'],$oidtext['title']);
else
printf('<td>%s</td>',$oidtext['title']);
2009-06-30 09:29:51 +00:00
else
if (strlen($value) > 0)
printf('<td><small>%s</small></td>',$value);
2009-06-30 09:29:51 +00:00
} else {
printf('<td rowspan=2 colspan=2>%s</td>',$value);
}
2009-06-30 09:29:51 +00:00
print '</tr>';
2009-06-30 09:29:51 +00:00
if (isset($oidtext['desc']) && trim($oidtext['desc']))
printf('<tr><td><small>%s</small></td></tr>',$oidtext['desc']);
else
echo '<tr><td>&nbsp;</td></tr>';
2009-06-30 09:29:51 +00:00
if ($oidtext)
echo '<tr><td colspan=2>&nbsp;</td></tr>';
2009-06-30 10:26:08 +00:00
}
2009-06-30 09:29:51 +00:00
2009-06-30 10:26:08 +00:00
else
printf('<tr><td colspan=2>%s&nbsp;</td></tr>',$values);
2009-06-30 08:09:20 +00:00
2009-06-30 10:26:08 +00:00
echo '</table>';
echo '</td></tr>';
}
2009-06-30 10:46:00 +00:00
echo '</table>';
2009-06-30 10:26:08 +00:00
?>