phpldapadmin/htdocs/refresh.php

47 lines
1.1 KiB
PHP
Raw Normal View History

2009-06-30 09:22:30 +00:00
<?php
2009-06-30 09:29:51 +00:00
/**
* 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.
2009-06-30 08:05:37 +00:00
*
2009-06-30 09:29:51 +00:00
* @package phpLDAPadmin
* @subpackage Page
2009-06-30 09:29:51 +00:00
*/
2009-06-30 09:29:51 +00:00
/**
2009-06-30 08:05:37 +00:00
*/
2009-06-30 09:22:30 +00:00
require './common.php';
2009-06-30 08:05:37 +00:00
if (get_request('purge','REQUEST')) {
$tree = get_cached_item($app['server']->getIndex(),'tree');
del_cached_item($app['server']->getIndex(),'tree');
if ($tree)
$openDNs = $tree->listOpenItems();
else
$openDNs = array();
$tree = Tree::getInstance($app['server']->getIndex());
foreach ($openDNs as $value) {
$entry = $tree->getEntry($value);
if (! $entry) {
$tree->addEntry($value);
$entry = $tree->getEntry($value);
}
2009-08-28 10:07:56 +00:00
$tree->readChildren($value,true);
$entry->open();
}
set_cached_item($app['server']->getIndex(),$tree,'tree','null');
}
2009-06-30 08:05:37 +00: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()));
else
header(sprintf('Location: cmd.php?server_id=%s',$app['server']->getIndex()));
2009-06-30 08:05:37 +00:00
2009-06-30 10:46:00 +00:00
die();
2009-06-30 08:05:37 +00:00
?>