Ejemplo n.º 1
0
function pte_delete_images()
{
    // Require JSON output
    pte_require_json();
    $id = (int) $_GET['id'];
    if (pte_check_id($id) === false) {
        return pte_json_error("ID invalid: {$id}");
    }
    // Check nonce
    if (!check_ajax_referer("pte-delete-{$id}", 'pte-nonce', false)) {
        return pte_json_error("CSRF Check failed");
    }
    // SETS PTE_TMP_DIR and PTE_TMP_URL
    extract(pte_tmp_dir());
    $PTE_TMP_DIR = $PTE_TMP_DIR . $id . DIRECTORY_SEPARATOR;
    // Delete tmpdir
    PteLogger::debug("Deleting [{$PTE_TMP_DIR}]");
    pte_rmdir($PTE_TMP_DIR);
    return pte_json_encode(array("success" => "Yay!"));
}
Ejemplo n.º 2
0
 public static function getLogFileName()
 {
     // SETS PTE_TMP_DIR and PTE_TMP_URL
     extract(pte_tmp_dir());
     return $PTE_TMP_DIR . 'log.txt';
 }