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.
34 righe
1.3 KiB
34 righe
1.3 KiB
<? |
|
$error = true; |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
if (!empty($_SESSION["utente"]->oe)) { |
|
$contratto = publicStipula::init($_GET["codice_contratto"]); |
|
if (!empty($contratto)) { |
|
$record = $contratto->info; |
|
if (isset($_GET["originale"])) { |
|
if ($contratto->canUpload()) { $sottoscritto = $contratto->getContrattoSottoscrivere(); } |
|
} else if (isset($_GET["mio"])) { |
|
$sottoscritto = $contratto->getContrattoSottoscritto(true,$contratto->codice_firmatario); |
|
} else if (isset($_GET["finale"])) { |
|
$sottoscritto = $contratto->getContrattoFinale(true); |
|
} |
|
if (!empty($sottoscritto)) { |
|
if (!empty($sottoscritto["content"])) { |
|
header('Content-Description: File Transfer'); |
|
header('Content-Type: ' . $sottoscritto["mime"]); |
|
header('Content-Disposition: attachment; filename='.str_replace("-",".",$sottoscritto["name"])); |
|
header('Content-Transfer-Encoding: binary'); |
|
header('Expires: 0'); |
|
header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
|
header('Pragma: public'); |
|
echo $sottoscritto["content"]; |
|
} |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|