phpldapadmin/htdocs/cmd.php

52 lines
1.2 KiB
PHP
Raw Normal View History

2009-06-30 10:46:00 +00:00
<?php
2009-06-30 11:50:46 +00:00
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/cmd.php,v 1.3.2.3 2008/01/10 12:28:34 wurley Exp $
2009-06-30 10:46:00 +00:00
/**
2009-06-30 10:46:41 +00:00
* @package phpLDAPadmin
2009-06-30 10:46:00 +00:00
*/
require_once './common.php';
2009-06-30 11:46:44 +00:00
$www['cmd'] = get_request('cmd','REQUEST');
$www['meth'] = get_request('meth','REQUEST');
2009-06-30 10:46:00 +00:00
ob_start();
2009-06-30 11:50:46 +00:00
$file = '';
2009-06-30 10:46:00 +00:00
2009-06-30 11:46:44 +00:00
switch ($www['cmd']) {
2009-06-30 10:46:00 +00:00
case '_debug' :
debug_dump($_REQUEST,1);
break;
default :
2009-06-30 11:46:44 +00:00
if (defined('HOOKSDIR') && file_exists(HOOKSDIR.$www['cmd'].'.php'))
$file = HOOKSDIR.$www['cmd'].'.php';
elseif (defined('HTDOCDIR') && file_exists(HTDOCDIR.$www['cmd'].'.php'))
$file = HTDOCDIR.$www['cmd'].'.php';
2009-06-30 11:50:46 +00:00
elseif (file_exists('welcome.php'))
2009-06-30 10:46:00 +00:00
$file = 'welcome.php';
}
2009-06-30 11:46:44 +00:00
if (DEBUG_ENABLED)
debug_log('Ready to render page for command [%s,%s].',128,__FILE__,__LINE__,__METHOD__,$www['cmd'],$file);
2009-06-30 10:46:00 +00:00
2009-06-30 11:46:44 +00:00
# Create page.
$www['page'] = new page($ldapserver->server_id);
2009-06-30 10:46:00 +00:00
2009-06-30 11:46:44 +00:00
if ($file)
include $file;
2009-06-30 10:46:00 +00:00
2009-06-30 11:46:44 +00:00
# Capture the output and put into the body of the page.
$www['body'] = new block();
$www['body']->SetBody(ob_get_contents());
$www['page']->block_add('body',$www['body']);
ob_end_clean();
2009-06-30 10:46:00 +00:00
2009-06-30 11:46:44 +00:00
if ($www['meth'] == 'get_body')
$www['page']->body(true);
2009-06-30 10:46:00 +00:00
else
2009-06-30 11:46:44 +00:00
$www['page']->display();
2009-06-30 10:46:00 +00:00
?>