on * [cn=bob,dc=example,dc=com] => on * etc. * - server_id */ require realpath( 'common.php' ); $server_id = $_POST['server_id']; check_server_id( $server_id ) or pla_error( $lang['bad_server_id'] ); if( is_server_read_only( $server_id ) ) pla_error( $lang['no_deletes_in_read_only'] ); have_auth_info( $server_id ) or pla_error( $lang['no_enough_login_info'] ); $ds = pla_ldap_connect( $server_id ); pla_ldap_connection_is_error( $ds ); $confirmed = isset( $_POST['confirmed'] ) ? true : false; isset( $_POST['mass_delete'] ) or pla_error( $lang['error_calling_mass_delete'] ); $mass_delete = $_POST['mass_delete']; is_array( $mass_delete ) or pla_error( $lang['mass_delete_not_array'] ); mass_delete_enabled( $server_id ) or pla_error( $lang['mass_delete_not_enabled'] ); $server_name = $servers[ $server_id ][ 'name' ]; require realpath( 'header.php' ); echo "\n"; echo "

" . $lang['mass_deleting'] . "

\n"; if( $confirmed == true ) { echo "

" . sprintf( $lang['mass_delete_progress'], $server_name ) . "

\n"; echo "
"; echo "\n"; $successfully_delete_dns = array(); $failed_dns = array(); if( ! is_array( $mass_delete ) ) pla_error( $lang['malformed_mass_delete_array'] ); if( count( $mass_delete ) == 0 ) { echo "
"; echo "
" . $lang['no_entries_to_delete'] . "
"; die(); } foreach( $mass_delete as $dn => $junk ) { echo sprintf( $lang['deleting_dn'], htmlspecialchars($dn) ); flush(); if( true === preEntryDelete( $server_id, $dn ) ) { $success = @ldap_delete( $ds, $dn ); if( $success ) { postEntryDelete( $server_id, $dn ); echo " " . $lang['success'] . ".
\n"; $successfully_delete_dns[] = $dn; } else { echo " " . $lang['failed'] . ".\n"; echo "(" . ldap_error( $ds ) . ")
\n"; $failed_dns[] = $dn; } } flush(); } echo "
"; echo "\n"; $failed_count = count( $failed_dns ); $total_count = count( $mass_delete ); if( $failed_count > 0 ) { echo "\n"; echo sprintf( $lang['total_entries_failed'], $failed_count, $total_count ) . "\n"; } else { echo "\n"; echo $lang['all_entries_successful'] . "\n"; } // kill the deleted DNs from the tree browser session variable and // refresh the tree viewer frame (left_frame) if( array_key_exists( 'tree', $_SESSION ) ) { $tree = $_SESSION['tree']; foreach( $successfully_delete_dns as $dn ) { // 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(); ?> " . sprintf( $lang['confirm_mass_delete'], $n, $server_name ) . "\n"; ?>
Do you really want to delete ?
    $foo ) { echo "\n"; echo "
  1. " . htmlspecialchars( $dn ) . "
  2. \n"; } ?>