From 5481f61ce3e2f4e8fc8f71dbde2cbe40248a806d Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 12 Jul 2009 12:28:39 +1000 Subject: [PATCH] Use calls to getRootDSE() --- htdocs/monitor.php | 12 +++--------- htdocs/server_info.php | 9 +-------- lib/HTMLTree.php | 15 ++------------- 3 files changed, 6 insertions(+), 30 deletions(-) diff --git a/htdocs/monitor.php b/htdocs/monitor.php index a47c881..b1293b8 100644 --- a/htdocs/monitor.php +++ b/htdocs/monitor.php @@ -13,18 +13,12 @@ require './common.php'; -# Fetch basic RootDSE attributes using the + and *. +$attrs = $app['server']->getRootDSE(); + $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_change_key_case(array_pop($results)); - $query['base'] = $attrs['monitorcontext']; $query['scope'] = 'sub'; +$query['attrs'] = array('+','*'); $results = $app['server']->query($query,null); if (! isset($attrs['monitorcontext']) || ! count($results)) diff --git a/htdocs/server_info.php b/htdocs/server_info.php index ee13784..efc1ffb 100644 --- a/htdocs/server_info.php +++ b/htdocs/server_info.php @@ -13,14 +13,7 @@ require './common.php'; -# Fetch basic RootDSE attributes using the + and *. -$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); +$attrs = $app['server']->getRootDSE(); printf('

%s%s

',_('Server info for: '),$app['server']->getName()); printf('

%s

',_('Server reports the following information about itself')); diff --git a/lib/HTMLTree.php b/lib/HTMLTree.php index c3f65cc..72c8faa 100644 --- a/lib/HTMLTree.php +++ b/lib/HTMLTree.php @@ -250,19 +250,8 @@ class HTMLTree extends Tree { if (! $_SESSION[APPCONFIG]->isCommandAvailable('script','monitor')) return ''; - # Fetch basic RootDSE attributes using the + and *. - $query = array(); - $query['base'] = ''; - $query['scope'] = 'base'; - $query['attrs'] = $server->getValue('server','root_dse_attributes'); - $query['baseok'] = true; - $results = $server->query($query,null); - if ($results) - $attrs = array_change_key_case(array_pop($results)); - else - return ''; - - if (! isset($attrs['monitorcontext'])) + $attrs = $server->getRootDSE(); + if (! $attrs || ! isset($attrs['monitorcontext'])) return ''; $menu['cmd'] = 'monitor';