phpldapadmin/htdocs/draw_tree_node.php

62 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2009-06-30 10:46:00 +00:00
<?php
2009-06-30 10:46:41 +00:00
/**
* Draw a portion of the LDAP tree.
*
2009-06-30 10:46:41 +00:00
* @package phpLDAPadmin
* @subpackage Tree
2009-06-30 10:46:41 +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
$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
$treesave = false;
2009-06-30 10:46:00 +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
case 2:
default:
if ($dnentry->isSizeLimited()) {
$tree->readChildren($request['dn'],true);
2009-06-30 10:46:00 +00:00
$treesave = true;
}
2009-06-30 10:46:00 +00:00
$dnentry->open();
2009-06-30 10:46:00 +00:00
}
2009-06-30 11:52:55 +00:00
}
if ($treesave)
set_cached_item($app['server']->getIndex(),'tree','null',$tree);
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
?>