phpldapadmin/htdocs/collapse.php

43 lines
1.3 KiB
PHP
Raw Normal View History

2009-06-30 09:22:30 +00:00
<?php
2009-06-30 09:40:37 +00:00
// $Header: /cvsroot/phpldapadmin/phpldapadmin/htdocs/collapse.php,v 1.13 2005/07/22 05:55:19 wurley Exp $
2009-06-30 08:05:37 +00:00
2009-06-30 09:29:51 +00:00
/**
2009-06-30 08:05:37 +00:00
* This script alters the session variable 'tree', collapsing it
2009-06-30 09:29:51 +00:00
* at the dn specified in the query string.
2009-06-30 08:05:37 +00:00
*
2009-06-30 09:29:51 +00:00
* Variables that come in via common.php
* - server_id
2009-06-30 08:05:37 +00:00
* Variables that come in as GET vars:
* - dn (rawurlencoded)
*
* Note: this script is equal and opposite to expand.php
2009-06-30 09:29:51 +00:00
* @package phpLDAPadmin
*/
/**
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
2009-06-30 08:07:14 +00:00
$dn = $_GET['dn'];
2009-06-30 09:29:51 +00:00
$encoded_dn = rawurlencode($dn);
2009-06-30 08:05:37 +00:00
2009-06-30 09:22:30 +00:00
initialize_session_tree();
2009-06-30 08:07:14 +00:00
2009-06-30 09:29:51 +00:00
if (array_key_exists($dn,$_SESSION['tree'][$ldapserver->server_id]))
unset($_SESSION['tree'][$ldapserver->server_id][$dn]);
2009-06-30 08:05:37 +00:00
2009-06-30 09:29:51 +00:00
/* This is for Opera. By putting "random junk" in the query string, it thinks
that it does not have a cached version of the page, and will thus
fetch the page rather than display the cached version */
2009-06-30 08:05:37 +00:00
$time = gettimeofday();
2009-06-30 09:29:51 +00:00
$random_junk = md5(strtotime('now') . $time['usec']);
2009-06-30 08:05:37 +00:00
2009-06-30 09:29:51 +00:00
/* If cookies were disabled, build the url parameter for the session id.
It will be append to the url to be redirect */
$id_session_param = "";
if (SID != "")
$id_session_param = "&".session_name()."=".session_id();
2009-06-30 08:05:37 +00:00
2009-06-30 09:29:51 +00:00
header(sprintf('Location:tree.php?foo=%s#%s_%s%s',$random_junk,$ldapserver->server_id,$encoded_dn,$id_session_param));
2009-06-30 08:07:14 +00:00
?>