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.
51 righe
1.7 KiB
51 righe
1.7 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
$id_modulo = "pubblica"; |
|
$cmd_info = gara::getInfoModulo($id_modulo); |
|
if (!empty($_POST) && !empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($cmd_info["modulo_riferimento"]) && $_SESSION["utente"]->permission($radice,$_POST["codice_gara"],$id_modulo) && tokenVerify()) { |
|
$test_string = "test-verifica-stringa"; |
|
$bind = array(); |
|
$bind[":codice"] = $_POST["codice_gara"]; |
|
$strsql = "SELECT codice,public_key FROM b_gare WHERE codice = :codice "; |
|
$gara = $pdo->go($strsql,$bind); |
|
if ($gara->rowCount() > 0) { |
|
$gara = $gara->fetch(PDO::FETCH_ASSOC); |
|
$public = openssl_pkey_get_public(trim($gara["public_key"])); |
|
if (openssl_public_encrypt($test_string,$encr,$public)) { |
|
$key = openssl_pkey_get_private($_POST["private_key"]); |
|
if (openssl_private_decrypt($encr,$decr,$key)) { |
|
if (strcmp($decr,$test_string)===0) { |
|
$salva = new salva(); |
|
$salva->debug = FALSE; |
|
|
|
$salva->nome_tabella = "b_gare"; |
|
$salva->operazione = "UPDATE"; |
|
$salva->oggetto = ["codice"=>$gara["codice"],"private_verified"=>"S"]; |
|
if ($salva->save() != false) { |
|
$error = false; |
|
?> |
|
swal({title:js_dict["success-msg"],type:"success"}).then(function(){ window.location.reload(); }); |
|
<? |
|
} |
|
} else { |
|
$error = false; |
|
?> |
|
swal({title:"<?= __("Chiave errata") ?>",type:"error"}); |
|
<? |
|
} |
|
} else { |
|
$error = false; |
|
?> |
|
swal({title:"<?= __("Chiave errata") ?>",type:"error"}); |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|
|
|