phpldapadmin/htdocs/draw_tree_node.php

43 lines
865 B
PHP
Raw Normal View History

2009-06-30 10:46:00 +00:00
<?php
2009-06-30 11:52:55 +00:00
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/draw_tree_node.php,v 1.2.2.2 2008/12/12 12:20:22 wurley Exp $
2009-06-30 10:46:41 +00:00
/**
* @package phpLDAPadmin
*/
2009-06-30 11:52:55 +00:00
$entry = array();
$entry['dn'] = get_request('dn','REQUEST');
$entry['server_id'] = get_request('server_id','REQUEST');
$entry['code'] = get_request('code','REQUEST');
$entry['action'] = get_request('action','REQUEST');
2009-06-30 10:46:00 +00:00
2009-06-30 11:52:55 +00:00
$tree = Tree::getInstance($entry['server_id']);
if (! $tree)
die();
2009-06-30 10:46:00 +00:00
2009-06-30 11:52:55 +00:00
$dnentry = $tree->getEntry($entry['dn']);
if (! $dnentry) {
$tree->addEntry($entry['dn']);
$dnentry = $this->getEntry($entry['dn']);
}
2009-06-30 10:46:00 +00:00
2009-06-30 11:52:55 +00:00
if (! $dnentry)
die();
2009-06-30 10:46:00 +00:00
2009-06-30 11:52:55 +00:00
if ($entry['action'] == 0) {
$dnentry->close();
2009-06-30 10:46:00 +00:00
2009-06-30 11:52:55 +00:00
} elseif ($entry['action'] == 2) {
$dnentry->open();
2009-06-30 10:46:00 +00:00
2009-06-30 11:52:55 +00:00
} else {
$dnentry->open();
if ($entry['dn']) {
echo $tree->draw_children($dnentry,$entry['code']);
2009-06-30 10:46:00 +00:00
} else {
2009-06-30 11:52:55 +00:00
$tree->draw(true);
2009-06-30 10:46:00 +00:00
}
2009-06-30 11:52:55 +00:00
}
die();
2009-06-30 10:46:00 +00:00
?>