<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="it" lang="it">
|
<head>
|
<script src="{{asset('js/jquery/jquery-3.6.0.min.js')}}"></script>
|
<link href="{{asset('css/login.css?v=4')}}" rel="stylesheet" type="text/css">
|
<style type="text/css">
|
.c-half {
|
width: 50%;
|
float: left;
|
height: auto;
|
}
|
|
.c-box {
|
border: 1px solid black;
|
padding: 20px;
|
margin-bottom: 30px;
|
}
|
|
.grid {
|
padding: 50px 0px;
|
}
|
.vfa-red-title {
|
color: #e60000;
|
font-family: vodafone_ltregular, Arial, Helvetica, sans-serif;
|
font-size: 40px;
|
font-weight: normal;
|
text-align: center;
|
margin-bottom: 26px;
|
margin-top: 26px;
|
line-height: 42px;
|
}
|
|
a {
|
text-decoration:underline;
|
display: block;
|
}
|
|
</style>
|
</head>
|
|
<body class="page_gray">
|
|
<div class="page_centerer">
|
|
<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
|
<div class="c-box">
|
<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}}">{{$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 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>
|
</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>
|
|
<script type="text/javascript">
|
jQuery(document).ready(function () {
|
let authorizationToken = $('input[name="_token"]').val();
|
|
document.getElementById("btnAttiva").onclick = setCookies;
|
document.getElementById("btnReset").onclick = delCookies;
|
|
function callAjax(url, isSet) {
|
document.getElementById('vola-loading').style.display = 'block';
|
let profile = document.getElementById('sel_attiva').value;
|
$.ajax({
|
headers: {
|
'X-CSRF-TOKEN': authorizationToken,
|
},
|
type: "POST",
|
url: url,
|
dataType: "json",
|
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';
|
});
|
}
|
|
function setCookies() {
|
let setUri = location.origin + "{{$setUrl}}";
|
callAjax(setUri, true);
|
}
|
|
function delCookies() {
|
let logoutUri = location.origin + "{{$clearUrl}}";
|
callAjax(logoutUri, false);
|
}
|
|
});
|
</script>
|
|
@include('vola_loading_animation')
|
</body>
|
</html>
|