gestione gare pubbliche
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.
 
 
 
 
 

50 righe
2.1 KiB

<?
$error = true;
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php";
include_once($configPath);
$id_modulo = "partecipanti";
$cmd_info = AlboFornitori::getInfoModulo($id_modulo);
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice,$_GET["codice"],$id_modulo) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"])) {
$elenco = AlboFornitori::init($_GET["codice"]);
if (!empty($elenco)) {
$busta = $elenco->getBusta($_GET["codice_partecipante"],$_GET["codice_richiesta"],true);
if (!empty($busta)) {
if ($_GET["openP7M"] == "S") {
$path = $config["chunk_folder"] . "/" . $_SESSION["utente"]->codice;
if (!is_dir($path)) { mkdir($path); }
$path .= "/" . $busta["nomeFile"];
file_put_contents($path, $busta["content"]);
$busta["content"] = "";
if (file_exists($path)) {
$p7m = new P7Manager($path);
if ($p7m != false) {
$busta["content"] = $p7m->extract(true);
$file_info = new finfo(FILEINFO_MIME_TYPE);
$mime_type = $file_info->buffer($busta["content"]);
$busta["nomeFile"] = str_replace(".p7m", "", $busta["nomeFile"]);
$busta["mime"] = $mime_type;
}
unlink($path);
}
}
if(!empty($busta["content"])) {
$elenco->addToLog("DOWNLOAD","Partecipante #{$_GET["codice_partecipante"]} - Richiesta #{$_GET["codice_richiesta"]} - {$busta["nomeFile"]}");
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename=' . str_replace("-",".",$busta["nomeFile"]));
header('Content-Type: ' . $busta["mime"]);
header('Content-Transfer-Encoding: binary');
header('Connection: Keep-Alive');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
echo $busta["content"];
$error = false;
}
}
}
}
if ($error) {
header('HTTP/1.0 403 Forbidden');
die();
}
?>