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.
96 righe
5.3 KiB
96 righe
5.3 KiB
<? |
|
$configPath = substr(__DIR__,0,strpos(__DIR__,"/public_html"))."/config.php"; |
|
include_once($configPath); |
|
$error = true; |
|
if (!empty($_SESSION["utente"]) && $_SESSION["utente"]->permission($radice) && !empty($_GET["codice"])) { |
|
$ente = Ente::getInfoFromID($_GET["codice"])[0] ?? null; |
|
if (!empty($ente)) { |
|
$error = false; |
|
$tipologie = Modulo::getTipologie(); |
|
if (!empty($tipologie)) { |
|
$col = 6; |
|
?> |
|
<h1><?= __("Gestione permessi") ?></h1> |
|
<?php if (!empty($ente["codice_ipa"])) : ?> |
|
<div class="row mb-2"> |
|
<div class="col-12 col-lg-6"> |
|
<?php if ($ente["spid"] == "N") : ?> |
|
<button class="btn btn-block btn-lg btn-danger" onClick="confirmBeforeSubmit(<?= $ente["codice"] ?>,'/backend/enti/integrazioni/spid/enable.php','token=<?= tokenGen() ?>')"><span class="fa fa-times"></span> SPID <?= __("Disattivo") ?></button> |
|
<?php elseif ($ente["spid"] == "W") : ?> |
|
<button class="btn btn-block btn-lg btn-info" disabled><span class="fa fa-spinner fa-spin"></span> SPID <?= __("In attivazione") ?></button> |
|
<?php else: ?> |
|
<button class="btn btn-block btn-lg btn-success" onClick="elimina(<?= $ente["codice"] ?>,'/backend/enti/integrazioni/spid/delete.php','token=<?= tokenGen() ?>')"><span class="fa fa-check"></span> SPID <?= __("Attivo") ?></button> |
|
<?php endif ?> |
|
</div> |
|
<? if (!empty($config["oidc"])) { ?> |
|
<div class="col-12 col-lg-6"> |
|
<?php if ($ente["oidc"] == "N") : ?> |
|
<button class="btn btn-block btn-lg btn-danger" onClick="confirmBeforeSubmit(<?= $ente["codice"] ?>,'/backend/enti/integrazioni/oidc/enable.php','token=<?= tokenGen() ?>')"><span class="fa fa-times"></span> CIE <?= __("Disattiva") ?></button> |
|
<?php elseif ($ente["oidc"] == "W") : ?> |
|
<button class="btn btn-block btn-lg btn-info" disabled><span class="fa fa-spinner fa-spin"></span> CIE <?= __("In attivazione") ?></button> |
|
<?php else: ?> |
|
<button class="btn btn-block btn-lg btn-success" onClick="elimina(<?= $ente["codice"] ?>,'/backend/enti/integrazioni/oidc/delete.php','token=<?= tokenGen() ?>')"><span class="fa fa-check"></span> CIE <?= __("Attiva") ?></button> |
|
<?php endif ?> |
|
</div> |
|
<? } ?> |
|
</div> |
|
<?php else: ?> |
|
<? alertManager::printInfoCompact(__("SPID e CIE non attivabili per assenza codice IPA")); ?> |
|
<?php endif; ?> |
|
<form rel="validate" method="post" action="/backend/enti/permessi/save.php" id="edit-form"> |
|
<input id="token" type="hidden" name="token" value="<?= tokenGen() ?>"> |
|
<input id="codice" type="hidden" name="codice" value="<?= $ente["codice"] ?>"> |
|
<div class="row"> |
|
<? foreach($tipologie AS $id_tipologia => $tipo) { ?> |
|
<div class="col-12 mb-2 col-lg-<?= $col ?> text-center"> |
|
<div class="pb-2"> |
|
<?if (!empty($tipo["icon"])) { echo "<span class='".$tipo["icon"]." fa-2x'></span>"; } ?><br> |
|
<strong><?= __($tipo["titolo"]) ?></strong> |
|
</div> |
|
<div class="btn-group-toggle" data-toggle="buttons"> |
|
<? |
|
$moduli = Modulo::getModuli(["tipo"=>$id_tipologia,"ente"=>true,"attivo"=>true,"all_ente"=>false]); |
|
if (count($moduli)) { |
|
$count = 0; |
|
$sql = "SELECT * FROM r_moduli_ente WHERE id_modulo = :id_modulo AND cod_ente = :cod_ente"; |
|
$ris_check = $pdo->prepare($sql); |
|
$ris_check->bindValue(":cod_ente",$ente["codice"]); |
|
foreach($moduli AS $id_modulo => $modulo) { |
|
if ($modulo["completed"] != "N") { |
|
$count++; |
|
$modulo["titolo"] = __($modulo["titolo"]); |
|
$modulo["descrizione"] = __($modulo["descrizione"]); |
|
$checked = ""; |
|
$ris_check->bindValue(":id_modulo",$id_modulo); |
|
$ris_check->execute(); |
|
if ($ris_check->rowCount() > 0) { $checked = "checked"; } |
|
?> |
|
<div class="btn btn-block btn-secondary <?= (!empty($checked)) ? "active" : "" ?>"> |
|
<div class="text-left"> |
|
<input autocomplete="off" type="checkbox" <?= $checked ?> id="permission-<?= $count ?>" name="permission[<?= $id_modulo ?>]"> |
|
<? if (!empty($modulo["icon"])) { ?> |
|
<em class="<?= $modulo["icon"] ?>"></em> |
|
<? } ?> |
|
<?= $modulo["titolo"] ?><br> |
|
<small><?= $modulo["descrizione"] ?></small> |
|
</div> |
|
</div> |
|
<? |
|
} |
|
} |
|
} |
|
?> |
|
</div> |
|
</div> |
|
<? } ?> |
|
</div> |
|
<button type="submit" class="btn btn-block btn-success"><em class="fa fa-save mr-2"></em><?= __("Salva") ?></button> |
|
</form> |
|
<? } |
|
} |
|
} |
|
if ($error) { |
|
header('HTTP/1.0 403 Forbidden'); |
|
die(); |
|
} |
|
?>
|