VPN-Management-GUI 2.0.3 porting start

This commit is contained in:
2012-07-16 19:30:19 +00:00
commit d3b0130655
545 changed files with 19128 additions and 0 deletions

32
Modules/Forum/getattachment.php Executable file
View File

@@ -0,0 +1,32 @@
<?php
$download = $_GET['download'];
// Dieses Verzeichnis liegt außerhalb des Document Root und
// ist nicht per URL erreichbar.
$basedir = $_SERVER["DOCUMENT_ROOT"]."/Modules/Forum/uploads";
if(strpos($download, "/") === false && strpos($download, "..") === false && $download != "")
{
$filename = $basedir."/".$download;
if(file_exists($filename))
{
// Passenden Dateinamen im Download-Requester vorgeben,
// z. B. den Original-Dateinamen
$save_as_name = basename($filename);
header("Content-Disposition: attachment; filename=\"$save_as_name\"");
// Passenden Datentyp erzeugen.
header("Content-Type: application/octet-stream");
// Datei ausgeben.
readfile($filename);
}
else
{
die("NO SUCH FILE: ".$filename);
}
}
else
{
die("INCORRECT PARAMETER: ".$download);
}
?>