PHP Classes

File: htdocs/draw_tree_node.php

Recommend this page to a friend!
  Classes of ask sa sa   PHP LDAP admin   htdocs/draw_tree_node.php   Download  
File: htdocs/draw_tree_node.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP LDAP admin
Perform operations to administer a LDAP server
Author: By
Last change:
Date: 1 year ago
Size: 1,132 bytes
 

Contents

Class file image Download
<?php
/**
 * Draw a portion of the LDAP tree.
 *
 * @package phpLDAPadmin
 * @subpackage Tree
 */

/**
 */

$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);

$tree = Tree::getInstance($request['server_id']);
if (!
$tree)
    die();

$treesave = false;

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;

        case
2:
        default:
            if (
$dnentry->isSizeLimited()) {
               
$tree->readChildren($request['dn'],true);

               
$treesave = true;
            }

           
$dnentry->open();
    }
}

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']);

die();
?>