2009-06-30 10:46:00 +00:00
|
|
|
<?php
|
2009-06-30 10:46:41 +00:00
|
|
|
/**
|
2009-07-01 06:09:17 +00:00
|
|
|
* Draw a portion of the LDAP tree.
|
|
|
|
*
|
2009-06-30 10:46:41 +00:00
|
|
|
* @package phpLDAPadmin
|
2009-07-01 06:09:17 +00:00
|
|
|
* @subpackage Tree
|
2009-06-30 10:46:41 +00:00
|
|
|
*/
|
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
/**
|
|
|
|
*/
|
|
|
|
|
|
|
|
$request = array();
|
|
|
|
$request['dn'] = get_request('dn','REQUEST');
|
|
|
|
$request['server_id'] = get_request('server_id','REQUEST');
|
|
|
|
$request['code'] = get_request('code','REQUEST');
|
|
|
|
$request['action'] = get_request('action','REQUEST');
|
|
|
|
$request['noheader'] = get_request('noheader','REQUEST',false,0);
|
2009-06-30 10:46:00 +00:00
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
$tree = Tree::getInstance($request['server_id']);
|
2009-06-30 11:52:55 +00:00
|
|
|
if (! $tree)
|
|
|
|
die();
|
2009-06-30 10:46:00 +00:00
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
$treesave = false;
|
2009-06-30 10:46:00 +00:00
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
if ($request['dn']) {
|
|
|
|
$dnentry = $tree->getEntry($request['dn']);
|
|
|
|
|
|
|
|
if (! $dnentry) {
|
|
|
|
$tree->addEntry($request['dn']);
|
|
|
|
$dnentry = $tree->getEntry($request['dn']);
|
|
|
|
$treesave = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch ($request['action']) {
|
|
|
|
case 0:
|
|
|
|
$dnentry->close();
|
|
|
|
|
|
|
|
break;
|
2009-06-30 10:46:00 +00:00
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
case 2:
|
|
|
|
default:
|
|
|
|
if ($dnentry->isSizeLimited()) {
|
|
|
|
$tree->readChildren($request['dn'],true);
|
2009-06-30 10:46:00 +00:00
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
$treesave = true;
|
|
|
|
}
|
2009-06-30 10:46:00 +00:00
|
|
|
|
2009-07-01 06:09:17 +00:00
|
|
|
$dnentry->open();
|
2009-06-30 10:46:00 +00:00
|
|
|
}
|
2009-06-30 11:52:55 +00:00
|
|
|
}
|
2009-07-01 06:09:17 +00:00
|
|
|
|
|
|
|
if ($treesave)
|
2022-01-14 00:41:19 +00:00
|
|
|
set_cached_item($app['server']->getIndex(),$tree,'tree','null');
|
2009-07-01 06:09:17 +00:00
|
|
|
|
|
|
|
if ($request['dn'])
|
|
|
|
echo $tree->draw_children($dnentry,$request['code']);
|
|
|
|
else
|
|
|
|
$tree->draw($request['noheader']);
|
|
|
|
|
2009-06-30 11:52:55 +00:00
|
|
|
die();
|
2009-06-30 10:46:00 +00:00
|
|
|
?>
|