\n";
echo "
Deleting" . htmlspecialchars( $dn) . "
\n";
echo "Recursive delete progress
\n";
echo "
";
echo "\n";
flush();
// prevent script from bailing early on a long delete
@set_time_limit( 0 );
$del_result = pla_rdelete( $server_id, $dn );
echo "
\n";
if( $del_result )
{
// kill the DN from the tree browser session variable and
// refresh the tree viewer frame (left_frame)
if( session_is_registered( 'tree' ) )
{
$tree = $_SESSION['tree'];
// 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();
?>
Object and sub-tree deleted successfully.
Deleting " . htmlspecialchars( utf8_decode( $dn ) ) . "...";
flush();
if( ldap_delete( $ds, $dn ) ) {
echo " Success
\n";
return true;
} else {
pla_error( "Failed to delete dn: " . htmlspecialchars( utf8_decode( $dn ) ),
ldap_error( $ds ), ldap_errno( $ds ) );
}
} else {
foreach( $children as $child_dn ) {
pla_rdelete( $server_id, $child_dn );
}
echo "Deleting " . htmlspecialchars( utf8_decode( $dn ) ) . "...";
flush();
if( ldap_delete( $ds, $dn ) ) {
echo " Success
\n";
return true;
} else {
pla_errror( "Failed to delete dn: " . htmlspecialchars( utf8_decode( $dn ) ),
ldap_error( $ds ), ldap_errno( $ds ) );
}
}
}