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.
94 righe
5.0 KiB
94 righe
5.0 KiB
<? |
|
|
|
$configPath = substr(__DIR__, 0, strpos(__DIR__ , "public_html/")) . "config.php"; |
|
include_once $configPath; |
|
|
|
if(! empty($_SESSION["utente"]->codice) && $_SESSION["utente"]->authenticationLevel <= 1) { |
|
?> |
|
<script src="/src/js/extra/spid-sp-access-button.min.js"></script> |
|
<link rel="stylesheet" href="/src/css/extra/spid-sp-access-button.min.css"> |
|
<style> |
|
.spid-idp-button-logo { |
|
height: 25px; |
|
} |
|
ul#spid-get li { |
|
width: 100%; |
|
} |
|
.list-group-item { |
|
border: 1px solid #DFD7CA !important; |
|
} |
|
</style> |
|
<div class="row"> |
|
<div class="col-12 text-center mb-5"> |
|
<strong class="h3">Scegli il tuo provider SPID</strong> |
|
</div> |
|
<form name="spid_idp_access" action="/spid/request.php" method="post" target="_self"> |
|
<div class="col-6 offset-3"> |
|
<div class="row" id="spid-post" data-spid-remote> |
|
<?php if (DEVELOP_ENV) : ?> |
|
<div class="col-sm-6 mb-4"> |
|
<button class="text-center btn btn-sm w-100 py-3 bg-light" value="https://localhost:8443" name="provider" type="submit"> |
|
<span class="spid-sr-only">SPID VALIDATOR</span>SPID VALIDATOR LOCAL</button> |
|
</div> |
|
<?php endif ?> |
|
<?php if (DEMO_ENV) : ?> |
|
<div class="col-sm-6 mb-4"> |
|
<button class="text-center btn btn-sm w-100 py-3 bg-light" value="https://validator.spid.gov.it" name="provider" type="submit"> |
|
<span class="spid-sr-only">SPID VALIDATOR</span>SPID VALIDATOR REMOTE</button> |
|
</div> |
|
<?php endif ?> |
|
</div> |
|
<div class="list-group"> |
|
<a class="list-group-item list-group-item-action" href="https://www.spid.gov.it">Maggiori informazioni</a> |
|
<a class="list-group-item list-group-item-action" href="https://www.spid.gov.it/richiedi-spid">Non hai SPID?</a> |
|
<a class="list-group-item list-group-item-action" href="https://www.spid.gov.it/serve-aiuto">Serve aiuto?</a> |
|
</div> |
|
</div> |
|
</form> |
|
</div> |
|
<script type="text/javascript"> |
|
var queryURL = "https://registry.spid.gov.it/entities-idp?&output=json&custom=info_display_base"; |
|
var idps=[ { "organization_name": "ArubaPEC S.p.A.", "entity_id": "https://loginspid.aruba.it", "logo_uri": "/src/img/spid/spid-idp-arubaid.svg"}, { "organization_name": "InfoCert S.p.A.", "entity_id": "https://identity.infocert.it", "logo_uri": "/src/img/spid/spid-idp-infocertid.svg"}, { "organization_name": "IN.TE.S.A. S.p.A.", "entity_id": "https://spid.intesa.it", "logo_uri": "/src/img/spid/spid-idp-intesaid.svg"}, { "organization_name": "Lepida S.p.A.", "entity_id": "https://id.lepida.it/idp/shibboleth", "logo_uri": "/src/img/spid/spid-idp-lepidaid.svg"}, { "organization_name": "Namirial", "entity_id": "https://idp.namirialtsp.com/idp", "logo_uri": "/src/img/spid/spid-idp-namirialid.svg"}, { "organization_name": "Poste Italiane SpA", "entity_id": "https://posteid.poste.it", "logo_uri": "/src/img/spid/spid-idp-posteid.svg"}, { "organization_name": "Sielte S.p.A.", "entity_id": "https://identity.sieltecloud.it", "logo_uri": "/src/img/spid/spid-idp-sielteid.svg"}, { "organization_name": "Register.it S.p.A.", "entity_id": "https://spid.register.it", "logo_uri": "/src/img/spid/spid-idp-spiditalia.svg"}, { "organization_name": "TI Trust Technologies srl", "entity_id": "https://login.id.tim.it/affwebservices/public/saml2sso", "logo_uri": "/src/img/spid/spid-idp-timid.svg"}, { "organization_name": "TeamSystem s.p.a.", "entity_id": "https://spid.teamsystem.com/idp", "logo_uri": "/src/img/spid/spid-idp-teamsystemid.svg"} ] |
|
|
|
function spid_populate() { |
|
let spid_elements = document.querySelectorAll('div[data-spid-remote]') |
|
if (spid_elements.length > 0) { |
|
fetch(queryURL).then(function (response) { |
|
return response.json(); |
|
}) |
|
.then(function (idps) { |
|
idps = idps.sort(() => Math.random() - 0.5) |
|
for (var u = 0; u < spid_elements.length; u++) { |
|
for (var i = 0; i < idps.length; i++) { |
|
spid_addIdpEntry(idps[i], spid_elements[u]); |
|
} |
|
} |
|
}) |
|
.catch(function (error) { |
|
console.log('Error during fetch: ' + error.message); |
|
idps.sort(() => Math.random() - 0.5) |
|
for (var u = 0; u < spid_elements.length; u++) { |
|
for (var i = 0; i < idps.length; i++) { |
|
spid_addIdpEntry(idps[i], spid_elements[u]); |
|
} |
|
} |
|
}); |
|
} |
|
} |
|
|
|
function spid_addIdpEntry(data, element) { |
|
const att = document.createAttribute("data-idp"); |
|
att.value = data['entity_id']; |
|
let div = document.createElement('div'); |
|
div.className = 'col-sm-6 mb-4'; |
|
div.setAttributeNode(att); |
|
div.innerHTML = `<button class="text-center btn btn-sm w-100 py-3 bg-light" value="${data['entity_id']}" name="provider" type="submit"><span class="spid-sr-only">${data['organization_name']}</span><img class="spid-idp-button-logo" src="${data['logo_uri']}" alt="${data['organization_name']}" /></button>` |
|
element.prepend(div) |
|
} |
|
|
|
spid_populate(); |
|
</script> |
|
<? |
|
} |
|
|
|
?>
|