Latest SANDPIT - MERGE from CVS (MERGE-GIT)

This commit is contained in:
Deon George
2009-07-01 16:09:17 +10:00
parent 388783fc84
commit ea17aadef4
210 changed files with 37284 additions and 52716 deletions

View File

@@ -1,87 +1,46 @@
<?php
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/server_info.php,v 1.27.2.4 2008/12/12 12:20:22 wurley Exp $
// $Header$
/**
* Fetches and displays all information that it can from the specified server
*
* Variables that come in via common.php
* - server_id
*
* @package phpLDAPadmin
* @subpackage Page
*/
/**
*/
if (! $_SESSION[APPCONFIG]->isCommandAvailable('server_info'))
error(sprintf('%s%s %s',_('This operation is not permitted by the configuration'),_(':'),_('view server information')),'error','index.php');
# 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',
'+',
'*'
);
require './common.php';
# Fetch basic RootDSE attributes using the + and *.
$attrs = $ldapserver->search(null,'','objectClass=*',array('+','*'),'base');
$attrs = array_pop($attrs);
$query = array();
$query['base'] = '';
$query['scope'] = 'base';
$query['attrs'] = $app['server']->getValue('server','root_dse_attributes');
$query['baseok'] = true;
$results = $app['server']->query($query,null);
$attrs = array_pop($results);
/* 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. */
$attrs2 = $ldapserver->search(null,'','objectClass=*',$root_dse_attributes,'base');
$attrs2 = array_pop($attrs2);
if (is_array($attrs2))
foreach ($attrs2 as $attr => $values)
if (! isset($attrs[$attr]))
$attrs[$attr] = $attrs2[$attr];
printf('<h3 class="title">%s%s</h3>',_('Server info for: '),htmlspecialchars($ldapserver->name));
printf('<h3 class="title">%s%s</h3>',_('Server info for: '),$app['server']->getName());
printf('<h3 class="subtitle">%s</h3>',_('Server reports the following information about itself'));
if (count($attrs) == 0) {
if (! count($attrs)) {
echo '<br /><br />';
printf('<center>%s</center>',_('This server has nothing to report.'));
return;
}
echo '<table class="result" border=0>';
foreach ($attrs as $attr => $values) {
if ($attr == 'dn')
foreach ($attrs as $key => $values) {
if ($key == 'dn')
continue;
$schema_href = sprintf('cmd.php?cmd=schema&amp;server_id=%s&amp;view=attributes&amp;viewvalue=%s',$ldapserver->server_id,$attr);
$href = sprintf('cmd.php?cmd=schema&amp;server_id=%s&amp;view=attributes&amp;viewvalue=%s',$app['server']->getIndex(),$key);
echo '<tr class="list_item"><td class="heading" rowspan=2>';
printf('<a title="'._('Click to view the schema definition for attribute type \'%s\'').'" href="%s">%s</a>',
$attr,$schema_href,htmlspecialchars($attr));
printf('<a href="%s" title="%s: %s" >%s</a>',
$href,_('Click to view the schema definition for attribute type'),$key,$key);
echo '</td></tr>';
echo '<tr class="list_item"><td class="blank">&nbsp;</td><td class="value">';
@@ -89,36 +48,41 @@ foreach ($attrs as $attr => $values) {
if (is_array($values))
foreach ($values as $value) {
$oidtext = '';
print '<tr>';
$oidtext = '';
print '<tr>';
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));
if (preg_match('/^[0-9]+\.[0-9]+/',$value)) {
printf('<td width=5%%><img src="%s/rfc.png" title="%s" alt="%s" /></td>',
IMGDIR,htmlspecialchars($value), htmlspecialchars($value));
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']);
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']);
if (strlen($value) > 0)
printf('<td><small>%s</small></td>',$value);
} else {
printf('<td rowspan=2 colspan=2>%s</td>',$value);
}
print '</tr>';
if (isset($oidtext['desc']) && trim($oidtext['desc']))
printf('<tr><td><small>%s</small></td></tr>',$oidtext['desc']);
else
if (strlen($value) > 0)
printf('<td><small>%s</small></td>',$value);
echo '<tr><td>&nbsp;</td></tr>';
} else {
printf('<td>%s</td>',htmlspecialchars($value));
}
print '</tr>';
if (isset($oidtext['desc']) && trim($oidtext['desc']))
printf('<tr><td colspan=2><small>%s</small></td></tr>',$oidtext['desc']);
if ($oidtext)
echo '<tr><td colspan=2>&nbsp;</td></tr>';
}
else
printf('<tr><td>%s&nbsp;</td></tr>',htmlspecialchars($values));
printf('<tr><td colspan=2>%s&nbsp;</td></tr>',$values);
echo '</table>';
echo '</td></tr>';