예제 #1
0
function lc_delete($targ)
{
    if (is_dir($targ)) {
        $files = glob($targ . '*', GLOB_MARK);
        //GLOB_MARK adds a slash to directories returned
        foreach ($files as $file) {
            lc_delete($file);
        }
        rmdir($targ);
    } else {
        unlink($targ);
    }
}
예제 #2
0
    $output["msg"] = _lang('the_folder_name_is_required');
    header("Content-type: text/plain;");
    echo json_encode($output);
    exit;
}
if (!startsWith($folder, LIBRARY_FOLDER_PATH)) {
    $output["success"] = 0;
    $output["msg"] = _lang('you_can_not_delete_folder');
    header("Content-type: text/plain;");
    echo json_encode($output);
    exit;
}
if (!file_exists($folder)) {
    $output["success"] = 0;
    $output["msg"] = _lang('the_folder_does_not_exist');
    header("Content-type: text/plain;");
    echo json_encode($output);
    exit;
}
if (!is_dir($folder)) {
    $output["success"] = 0;
    $output["msg"] = _lang('that_is_not_a_folder');
    header("Content-type: text/plain;");
    echo json_encode($output);
    exit;
}
lc_delete($folder);
include 'contents.php';
header("Content-type: text/plain;");
echo json_encode($output);
exit;