From 0ce6f3d3a42e4f5babdb1774a9fed430aff0884a Mon Sep 17 00:00:00 2001 From: Filippo Bertilotti <filippobertilotti@gmail.com> Date: Mon, 30 Sep 2024 10:45:11 +0200 Subject: [PATCH] fixing errors e cambio grafica form --- resources/views/vodafone_fake_sso/choose_profile.blade.php | 50 +++++++++++++++++++++++++++++++------------------- 1 files changed, 31 insertions(+), 19 deletions(-) diff --git a/resources/views/vodafone_fake_sso/choose_profile.blade.php b/resources/views/vodafone_fake_sso/choose_profile.blade.php index 333cc26..7d4f042 100644 --- a/resources/views/vodafone_fake_sso/choose_profile.blade.php +++ b/resources/views/vodafone_fake_sso/choose_profile.blade.php @@ -14,7 +14,6 @@ border: 1px solid black; padding: 20px; margin-bottom: 30px; - height: 80px;; } .grid { @@ -30,6 +29,12 @@ margin-top: 26px; line-height: 42px; } + + a { + text-decoration:underline; + display: block; + } + </style> </head> @@ -39,34 +44,44 @@ <div class="grid"> - <h1 class="vfa-red-title">Laravel FakeSSO</h1> + <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 <div class="c-box"> - <p> - Seleziona la sessione di SSO e attivala - </p> + <h2>Seleziona il profilo SSO su cui vuoi loggarti</h2> + <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"/> <div class="c-half"></div> </div> <div class="c-box"> - <p> - Elimina dalla sessione la FakeSSO. - </p> + <p>Elimina dalla sessione i cookie FakeSSO.</p> <input type="button" value="Reset" id="btnReset"/> </div> </form> <div class="c-box"> - <a href="{{route('create-view')}}"> - Crea nuovo profilo sso - </a> + <a href="{{route('create-view')}}">Crea nuovo profilo sso</a> + </div> + <div class="c-box"> + <h2>Scorciatoie Portali</h2> + @foreach (config('custom.portals_shortcuts',[]) as $websiteName => $websiteUri) + <a href="{{$websiteUri}}" target="_blank">{{$websiteName}}</a> + @endforeach </div> </div> </div> @@ -78,7 +93,7 @@ document.getElementById("btnAttiva").onclick = setCookies; document.getElementById("btnReset").onclick = delCookies; - function callAjax(url, withReload = true) { + function callAjax(url, isSet) { document.getElementById('vola-loading').style.display = 'block'; let profile = document.getElementById('sel_attiva').value; $.ajax({ @@ -91,23 +106,20 @@ data: JSON.stringify({prof: profile}), }).done(function (msg) { document.getElementById('vola-loading').style.display = 'none'; - if (withReload) { - location.href = location.origin + "/get"; - } + if (isSet) document.getElementById('status-info').innerHTML = '<b>Creati cookie per profilo xno:' + profile + '</b>'; }).fail(function() { document.getElementById('vola-loading').style.display = 'none'; - location.href = location.origin + "/get"; }); } 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