From 0991a9fb42afabd45d2b7504b84d6484b241c35d Mon Sep 17 00:00:00 2001 From: Filippo Bertilotti <filippobertilotti@gmail.com> Date: Mon, 22 Jul 2024 12:03:54 +0200 Subject: [PATCH] creazione nuova richiesta relativa al form e controllo sui campi --- resources/views/vodafone_fake_sso/choose_profile.blade.php | 18 ++++++++++++++---- 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/resources/views/vodafone_fake_sso/choose_profile.blade.php b/resources/views/vodafone_fake_sso/choose_profile.blade.php index 7f5fa7a..7d4f042 100644 --- a/resources/views/vodafone_fake_sso/choose_profile.blade.php +++ b/resources/views/vodafone_fake_sso/choose_profile.blade.php @@ -45,6 +45,15 @@ <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><b>Login:</b>Loggato con account {{$loggedInfo["username"]}}</p> + <p><b>Profilo</b> numero: {{str_replace("xno:", "", $loggedInfo["token"])}}</p> + @else + <p><b>Login:</b> Non sei loggato</p> + @endif + <p><b>Controllo cookie:</b> {{(isset($loggedInfo["message"])) ? $loggedInfo["message"] : 'OK'}}</p> + </div> <form id="fakesso" name="fakesso" action="" method="POST"> @csrf @@ -53,7 +62,7 @@ <p>Il login utilizza i cookie a livello di dominio, risulterai loggato su tutti i portali che utilizzano il dominio attuale ({{$domain}}).</p> <select id="sel_attiva"> @foreach (config('devtools.fake_sso_profiles') as $profileIndex => $profileContent) - <option value="{{$profileIndex}}">{{$profileContent['name']}}</option> + <option value="{{$profileIndex}}">{{$profileIndex}} - {{$profileContent['name']}}</option> @endforeach </select> <input type="button" value="Attiva" id="btnAttiva"/> @@ -84,7 +93,7 @@ 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({ @@ -97,6 +106,7 @@ data: JSON.stringify({prof: profile}), }).done(function (msg) { document.getElementById('vola-loading').style.display = 'none'; + if (isSet) document.getElementById('status-info').innerHTML = '<b>Creati cookie per profilo xno:' + profile + '</b>'; }).fail(function() { document.getElementById('vola-loading').style.display = 'none'; }); @@ -104,12 +114,12 @@ function setCookies() { let setUri = location.origin + "{{$setUrl}}"; - callAjax(setUri); + callAjax(setUri, true); } function delCookies() { let logoutUri = location.origin + "{{$clearUrl}}"; - callAjax(logoutUri); + callAjax(logoutUri, false); } }); -- Gitblit v1.8.0