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.
36 righe
1.5 KiB
36 righe
1.5 KiB
<? |
|
$error = true; |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$id_modulo = "contratto"; |
|
if (isset($_GET["codice_sottoscrittore"])) { $id_modulo = "remoto"; } |
|
$cmd_info = stipula::getInfoModulo($id_modulo); |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"]) && $_SESSION["utente"]->permission($radice,$_GET["codice_contratto"],$id_modulo)) { |
|
$contratto = stipula::init($_GET["codice_contratto"]); |
|
if (!empty($contratto)) { |
|
$record = $contratto->info; |
|
if (isset($_GET["codice_sottoscrittore"])) { |
|
$sottoscritto = $contratto->getContrattoSottoscritto(true, $_GET["codice_sottoscrittore"]); |
|
} else if (isset($_GET["last"])) { |
|
$sottoscritto = $contratto->getLastContratto(true); |
|
} else if (isset($_GET["finale"])) { |
|
$sottoscritto = $contratto->getContrattoFinale(true); |
|
} |
|
if (! empty($sottoscritto["content"])) { |
|
$error = false; |
|
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(); |
|
} |
|
?>
|
|
|