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.
30 righe
1.1 KiB
30 righe
1.1 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
if (isset($_SESSION["utente"]) && tokenVerify() && !empty($_SESSION["ente"])) { |
|
if ($_SESSION["utente"]->isSupporto() || $_SESSION["utente"]->gerarchia === 1) { |
|
if (!empty($_POST["setting"])) { |
|
$error = false; |
|
$_POST["delete"] = $_POST["delete"] ?? []; |
|
foreach($_POST["setting"] AS $id => $value) { |
|
if (in_array($id,$_POST["delete"])!==false) { |
|
$pdo->go("DELETE FROM b_settings WHERE id = :id AND codice_ente = :codice_ente",[":id"=>$id,":codice_ente"=>$_SESSION["ente"]->codice]); |
|
} else { |
|
$tmp = settingsManager::putValue($id,$value,$_SESSION["ente"]->codice); |
|
if ($tmp == false) { $error = true; } |
|
} |
|
} |
|
if (!$error) { |
|
?> |
|
swal({title:js_dict["success-msg"],type:"success"}).then(function(){ window.location.reload(); }); |
|
<? |
|
} |
|
} |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|