| | |
| | | <div class="grid"> |
| | | |
| | | <h1 class="vfa-red-title">Standalone FakeSSO Server</h1> |
| | | <div class="c-box" id="status-info"> |
| | | @if (isset($loggedInfo["logged"]) && $loggedInfo["logged"] == "1") |
| | | <p>Loggato: {{$loggedInfo["username"]}}</p> |
| | | <p>Profilo numero: {{$loggedInfo["token"]}}</p> |
| | | @endif |
| | | <p>Controllo cookie: {{(isset($loggedInfo["message"])) ? $loggedInfo["message"] : 'OK'}}</p> |
| | | </div> |
| | | |
| | | <form id="fakesso" name="fakesso" action="" method="POST"> |
| | | @csrf |
| | |
| | | document.getElementById("btnAttiva").onclick = setCookies; |
| | | document.getElementById("btnReset").onclick = delCookies; |
| | | |
| | | function callAjax(url) { |
| | | function callAjax(url, isSet) { |
| | | document.getElementById('vola-loading').style.display = 'block'; |
| | | let profile = document.getElementById('sel_attiva').value; |
| | | $.ajax({ |
| | |
| | | data: JSON.stringify({prof: profile}), |
| | | }).done(function (msg) { |
| | | document.getElementById('vola-loading').style.display = 'none'; |
| | | if (isSet) document.getElementById('status-info').innerHTML = 'Creati cookie per profilo xno:' + profile; |
| | | }).fail(function() { |
| | | document.getElementById('vola-loading').style.display = 'none'; |
| | | }); |
| | |
| | | |
| | | function setCookies() { |
| | | let setUri = location.origin + "{{$setUrl}}"; |
| | | callAjax(setUri); |
| | | callAjax(setUri, true); |
| | | } |
| | | |
| | | function delCookies() { |
| | | let logoutUri = location.origin + "{{$clearUrl}}"; |
| | | callAjax(logoutUri); |
| | | callAjax(logoutUri, false); |
| | | } |
| | | |
| | | }); |