' . pretty_print_dn( $dn ) . '' ) );
$ds = pla_ldap_connect( $server_id );
pla_ldap_connection_is_error( $ds );
// Check the user-defined custom callback first.
if( true === preEntryDelete( $server_id, $dn ) ) {
$del_result = @ldap_delete( $ds, $dn );
} else {
exit;
}
if( $del_result )
{
// Custom callback
postEntryDelete( $server_id, $dn );
// kill the DN from the tree browser session variable and
// refresh the tree viewer frame (left_frame)
if( array_key_exists( 'tree', $_SESSION ) )
{
$tree = $_SESSION['tree'];
if( isset( $tree[$server_id] ) && is_array( $tree[$server_id] ) ) {
// does it have children? (it shouldn't, but hey, you never know)
if( isset( $tree[$server_id][$dn] ) )
unset( $tree[$server_id][$dn] );
// search and destroy
foreach( $tree[$server_id] as $tree_dn => $subtree )
foreach( $subtree as $key => $sub_tree_dn )
if( 0 == strcasecmp( $sub_tree_dn, $dn ) )
unset( $tree[$server_id][$tree_dn][$key] );
$_SESSION['tree'] = $tree;
}
session_write_close();
}
include './header.php';
?>