setLotto($_POST["codice_lotto"])) { $partecipante = $gara->miaPartecipazione(); if (!empty($partecipante)) { $busta = $gara->getEmendamento($partecipante["codice"],$_POST["codice_richiesta"],true); if (!empty($busta)) { if ($busta["open"]=="S") { $content = $busta["content"]; } else { if (!empty($_SESSION["gareamends"][$partecipante["codice"]][$busta["codice_richiesta"]])) { $_decrypSalt = $_SESSION["gareamends"][$partecipante["codice"]][$busta["codice_richiesta"]]; } else if (!empty($_POST["salt"])) { $_decrypSalt = $_POST["salt"]; } if (isset($_decrypSalt)) { $imported = explode(".",$busta["nomeFile"]); $addSalt = $config["simple_encrypt"]["offer"]; if (is_array($imported)) { $imported = end($imported); if ($imported == "imported-offer") { $imported = true; } } else { $imported = false; } $content = openssl_decrypt($busta["content"],"AES128",$_decrypSalt,OPENSSL_RAW_DATA,$addSalt); } } } } } } if ($content !== false) { if ($imported === true) { $fileInfo = getTypeAndExtension($busta["content"],true); $busta["mime"] = $fileInfo["type"]; $busta["nomeFile"] = str_replace(".imported-offer","",$busta["nomeFile"]) . $fileInfo["ext"]; } if (!empty($_POST["salt"])) { $_SESSION["gareamends"][$partecipante["codice"]][$busta["codice_richiesta"]] = $_POST["salt"]; } if (P7Manager::bustaEstensioneSoloP7M($busta["nomeFile"])) { $ext = getTypeAndExtension($file_content,true); $busta["nomeFile"] = str_replace(".p7m", "{$ext["ext"]}", $busta["nomeFile"]); } header('Content-Type: ' . $busta["mime"]); header('Content-Disposition: attachment; filename='.str_replace("-",".",$busta["nomeFile"])); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); echo $content; } else { header('HTTP/1.0 403 Forbidden'); echo __("Errore nella richiesta"); die(); } } ?>