Non puoi selezionare più di 25 argomenti
Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
40 righe
1.5 KiB
40 righe
1.5 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
if (!empty($_SESSION["utente"])) { |
|
$manager = new richiesteOE($_GET["modulo"],$_GET["codice_elemento"],$_GET["sub"]); |
|
if ($manager->checkAdminPermission("OPEN")) { |
|
if (!empty($_GET["codice_richiesta"])) { |
|
$richiesta = $manager->getRichieste("S",["codice"=>$_GET["codice_richiesta"]]); |
|
if (!empty($richiesta)) { |
|
$richiesta = $richiesta[0]; |
|
if (empty($richiesta["apertura"]) || (strtotime($richiesta["apertura"]) < time())) { |
|
$integrazione = $manager->getContent($_GET["codice_richiesta"],$_GET["codice"],true); |
|
if (!empty($integrazione["content"])) { |
|
adaptMemoryLimitToFile($integrazione["file"]); |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if ($integrazione["content"] !== false) { |
|
if (strpos($integrazione["nomeFile"],".") === false) { |
|
$ext = getTypeAndExtension($integrazione["content"],true); |
|
$integrazione["nomeFile"] = "Risposta{$integrazione["codice"]}.{$ext["ext"]}"; |
|
} |
|
header('Content-Description: File Transfer'); |
|
header('Content-Type: ' . $integrazione["mime"]); |
|
header('Content-Disposition: attachment; filename='.str_replace("-",".",$integrazione["nomeFile"])); |
|
header('Content-Transfer-Encoding: binary'); |
|
header('Expires: 0'); |
|
header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
|
header('Pragma: public'); |
|
echo $integrazione["content"]; |
|
} else { |
|
header('HTTP/1.0 403 Forbidden'); |
|
echo "<h1>FORBIDDEN</h1>"; |
|
die(); |
|
} |
|
?>
|
|
|