Ejemplo n.º 1
0
            $loc = $url .= "managefile.php?action=showproject&id={$id}&mode=folderdel";
            header("Location: {$loc}");
        }
    }
} elseif ($action == "movefile") {
    if (!$userpermissions["files"]["edit"]) {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "<h2>{$errtxt}</h2><br>{$noperm}");
        $template->display("error.tpl");
        die;
    }
    $file = $_GET["file"];
    $file = substr($file, 4, strlen($file) - 4);
    $target = $_GET["target"];
    $myfile->moveFile($file, $target);
} elseif ($action == "downloadfile") {
    if (!$userpermissions["files"]["view"]) {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "{$errtxt}<br>{$noperm}");
        $template->display("error.tpl");
        die;
    }
    //get the file ID.
    $fileId = getArrayVal($_GET, "file");
    $thefile = $myfile->getFile($fileId);
    //getFile path and filesize
    $filePath = $thefile["datei"];
    //Send HTTP headers for dowonload
    header('Content-Description: File Transfer');