2019-02-08 13:44:52 -05:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* This script deletes the session variable 'tree', which will result in re-querying
|
|
|
|
* the LDAP server to grab the contents of all LDAP entries starting from the base.
|
|
|
|
*
|
|
|
|
* @package phpLDAPadmin
|
|
|
|
* @subpackage Page
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
*/
|
|
|
|
|
|
|
|
require './common.php';
|
|
|
|
|
|
|
|
if (get_request('purge','REQUEST')) {
|
|
|
|
$tree = get_cached_item($app['server']->getIndex(),'tree');
|
|
|
|
del_cached_item($app['server']->getIndex(),'tree');
|
|
|
|
|
|
|
|
if ($tree)
|
2019-02-12 14:57:50 -05:00
|
|
|
{
|
2019-02-08 13:44:52 -05:00
|
|
|
$openDNs = $tree->listOpenItems();
|
2019-02-12 14:57:50 -05:00
|
|
|
}
|
2019-02-08 13:44:52 -05:00
|
|
|
else
|
2019-02-12 14:57:50 -05:00
|
|
|
{
|
2019-02-08 13:44:52 -05:00
|
|
|
$openDNs = array();
|
2019-02-12 14:57:50 -05:00
|
|
|
}
|
2019-02-08 13:44:52 -05:00
|
|
|
|
|
|
|
$tree = Tree::getInstance($app['server']->getIndex());
|
|
|
|
|
|
|
|
foreach ($openDNs as $value) {
|
|
|
|
$entry = $tree->getEntry($value);
|
|
|
|
if (! $entry) {
|
|
|
|
$tree->addEntry($value);
|
|
|
|
$entry = $tree->getEntry($value);
|
|
|
|
}
|
|
|
|
|
|
|
|
$tree->readChildren($value,true);
|
|
|
|
$entry->open();
|
|
|
|
}
|
|
|
|
|
|
|
|
set_cached_item($app['server']->getIndex(),'tree','null',$tree);
|
|
|
|
}
|
|
|
|
|
2019-02-12 14:57:50 -05:00
|
|
|
if (get_request('meth','REQUEST') == 'ajax')
|
|
|
|
{
|
|
|
|
header(sprintf('Location: cmd.php?cmd=draw_tree_node&noheader=%s&server_id=%s&meth=ajax&frame=TREE', get_request('noheader', 'REQUEST', FALSE, 0), $app['server']->getIndex()));
|
|
|
|
}
|
2019-02-08 13:44:52 -05:00
|
|
|
else
|
2019-02-12 14:57:50 -05:00
|
|
|
{
|
|
|
|
header(sprintf('Location: cmd.php?server_id=%s', $app['server']->getIndex()));
|
|
|
|
}
|
2019-02-08 13:44:52 -05:00
|
|
|
|
|
|
|
die();
|
2019-02-12 14:52:01 -05:00
|
|
|
|