2009-06-30 09:22:30 +00:00
|
|
|
<?php
|
2009-06-30 11:51:50 +00:00
|
|
|
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/server_info.php,v 1.27.2.2 2008/01/13 05:37:01 wurley Exp $
|
2009-06-30 08:05:37 +00:00
|
|
|
|
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
|
|
|
*
|
|
|
|
* Variables that come in via common.php
|
2009-06-30 08:05:37 +00:00
|
|
|
* - server_id
|
2009-06-30 09:29:51 +00:00
|
|
|
*
|
|
|
|
* @package phpLDAPadmin
|
2009-06-30 08:05:37 +00:00
|
|
|
*/
|
2009-06-30 09:29:51 +00:00
|
|
|
/**
|
|
|
|
*/
|
|
|
|
|
2009-06-30 11:46:44 +00:00
|
|
|
if (! $_SESSION[APPCONFIG]->isCommandAvailable('server_info'))
|
2009-06-30 10:46:00 +00:00
|
|
|
pla_error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('view server informations')));
|
2009-06-30 08:05:37 +00:00
|
|
|
|
2009-06-30 09:29:51 +00:00
|
|
|
# The attributes we'll examine when searching the LDAP server's RootDSE
|
|
|
|
$root_dse_attributes = array(
|
|
|
|
'namingContexts',
|
|
|
|
'subschemaSubentry',
|
|
|
|
'altServer',
|
|
|
|
'supportedExtension',
|
|
|
|
'supportedControl',
|
|
|
|
'supportedSASLMechanisms',
|
|
|
|
'supportedLDAPVersion',
|
|
|
|
'currentTime',
|
|
|
|
'dsServiceName',
|
|
|
|
'defaultNamingContext',
|
|
|
|
'schemaNamingContext',
|
|
|
|
'configurationNamingContext',
|
|
|
|
'rootDomainNamingContext',
|
|
|
|
'supportedLDAPPolicies',
|
|
|
|
'highestCommittedUSN',
|
|
|
|
'dnsHostName',
|
|
|
|
'ldapServiceName',
|
|
|
|
'serverName',
|
|
|
|
'supportedCapabilities',
|
|
|
|
'changeLog',
|
|
|
|
'tlsAvailableCipherSuites',
|
|
|
|
'tlsImplementationVersion',
|
|
|
|
'supportedSASLMechanisms',
|
|
|
|
'dsaVersion',
|
|
|
|
'myAccessPoint',
|
|
|
|
'dseType',
|
|
|
|
'+',
|
|
|
|
'*'
|
|
|
|
);
|
|
|
|
|
|
|
|
# Fetch basic RootDSE attributes using the + and *.
|
2009-06-30 10:41:18 +00:00
|
|
|
$attrs = $ldapserver->search(null,'','objectClass=*',array('+','*'),'base');
|
|
|
|
$attrs = array_pop($attrs);
|
2009-06-30 09:29:51 +00:00
|
|
|
|
|
|
|
/* After fetching the "basic" attributes from the RootDSE, try fetching the
|
|
|
|
more advanced ones (from ths list). Add them to the list of attrs to display
|
|
|
|
if they weren't already fetched. (this was added as a work-around for OpenLDAP
|
|
|
|
on RHEL 3. */
|
2009-06-30 10:41:18 +00:00
|
|
|
$attrs2 = $ldapserver->search(null,'','objectClass=*',$root_dse_attributes,'base');
|
|
|
|
$attrs2 = array_pop($attrs2);
|
2009-06-30 09:22:30 +00:00
|
|
|
|
2009-06-30 10:40:33 +00:00
|
|
|
if (is_array($attrs2))
|
|
|
|
foreach ($attrs2 as $attr => $values)
|
|
|
|
if (! isset($attrs[$attr]))
|
|
|
|
$attrs[$attr] = $attrs2[$attr];
|
2009-06-30 08:05:37 +00:00
|
|
|
|
2009-06-30 10:26:08 +00:00
|
|
|
printf('<h3 class="title">%s%s</h3>',_('Server info for: '),htmlspecialchars($ldapserver->name));
|
|
|
|
printf('<h3 class="subtitle">%s</h3>',_('Server reports the following information about itself'));
|
2009-06-30 08:05:37 +00:00
|
|
|
|
2009-06-30 10:26:08 +00:00
|
|
|
if (count($attrs) == 0) {
|
|
|
|
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>';
|
2009-06-30 10:26:08 +00:00
|
|
|
foreach ($attrs as $attr => $values) {
|
|
|
|
if ($attr == 'dn')
|
|
|
|
continue;
|
2009-06-30 08:05:37 +00:00
|
|
|
|
2009-06-30 11:51:50 +00:00
|
|
|
$schema_href = sprintf('cmd.php?cmd=schema&server_id=%s&view=attributes&viewvalue=%s',$ldapserver->server_id,$attr);
|
2009-06-30 09:29:51 +00:00
|
|
|
|
2009-06-30 11:51:50 +00:00
|
|
|
echo '<tr class="list_item"><td class="heading" rowspan=2>';
|
2009-06-30 10:46:00 +00:00
|
|
|
printf('<a title="'._('Click to view the schema definition for attribute type \'%s\'').'" href="%s">%s</a>',
|
2009-06-30 10:26:08 +00:00
|
|
|
$attr,$schema_href,htmlspecialchars($attr));
|
|
|
|
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"> </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) {
|
2009-06-30 09:29:51 +00:00
|
|
|
|
|
|
|
$oidtext = '';
|
|
|
|
print '<tr>';
|
|
|
|
|
2009-06-30 10:26:08 +00:00
|
|
|
if (preg_match('/^[0-9]+\.[0-9]+/',$value)) {
|
2009-06-30 10:46:00 +00:00
|
|
|
printf('<td width=5%%><img src="images/rfc.png" title="%s" alt="%s" /></td>',
|
|
|
|
htmlspecialchars($value), htmlspecialchars($value));
|
2009-06-30 09:29:51 +00:00
|
|
|
|
2009-06-30 10:26:08 +00:00
|
|
|
if ($oidtext = support_oid_to_text($value))
|
2009-06-30 09:29:51 +00:00
|
|
|
if (isset($oidtext['ref']))
|
|
|
|
printf('<td><acronym title="%s">%s</acronym></td>',$oidtext['ref'],$oidtext['title']);
|
|
|
|
else
|
|
|
|
printf('<td>%s</td>',$oidtext['title']);
|
|
|
|
|
|
|
|
else
|
2009-06-30 10:46:00 +00:00
|
|
|
if (strlen($value) > 0)
|
2009-06-30 10:26:08 +00:00
|
|
|
printf('<td><small>%s</small></td>',$value);
|
2009-06-30 09:29:51 +00:00
|
|
|
|
|
|
|
} else {
|
2009-06-30 10:26:08 +00:00
|
|
|
printf('<td>%s</td>',htmlspecialchars($value));
|
2009-06-30 09:29:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
print '</tr>';
|
|
|
|
|
2009-06-30 10:26:08 +00:00
|
|
|
if (isset($oidtext['desc']) && trim($oidtext['desc']))
|
2009-06-30 09:29:51 +00:00
|
|
|
printf('<tr><td colspan=2><small>%s</small></td></tr>',$oidtext['desc']);
|
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
|
2009-06-30 11:51:50 +00:00
|
|
|
printf('<tr><td>%s </td></tr>',htmlspecialchars($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
|
|
|
?>
|