( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
require_once __DIR__ . '/auth.php';
$cfg = require __DIR__ . '/config.php';
clear_sso_cookie();
$redirect = isset($_GET['redirect']) ? trim($_GET['redirect']) : '/connect/index.php';
?>
<!doctype html>
<html lang="en" class="light-style layout-wide customizer-hide" data-theme="theme-default" data-assets-path="/brandcreator/dashboard/assets/" data-template="vertical-menu-template" data-style="light">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0" />
<title>Signing You Out…</title>
<link rel="stylesheet" href="/brandcreator/dashboard/assets/vendor/css/rtl/core.css" />
<link rel="stylesheet" href="/brandcreator/dashboard/assets/vendor/css/rtl/theme-default.css" />
<link rel="stylesheet" href="/brandcreator/dashboard/assets/css/demo.css" />
<link rel="stylesheet" href="/brandcreator/dashboard/assets/vendor/css/pages/page-auth.css" />
<style>
#bgX { background-image:url('/brandcreator/dashboard/assets/img/illustrations/business-meeting-over-coffee.png');background-size:cover;background-repeat:no-repeat;background-position:bottom;background-color:#9fccde;height:100vh;margin:0 }
.status{font-size:13px}
.ok{color:#0a7f28}
.err{color:#b00020}
</style>
<script>
// Proactively clear common cookies client-side across apps
(function clearCookies(){
const names = ['euserid','uid','admini','mid','user_id','u_em','u_ps'];
names.forEach(function(n){
document.cookie = n + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/';
});
})();
</script>
</head>
<body>
<div class="authentication-wrapper authentication-cover">
<a href="/connect/index.php" class="app-brand auth-cover-brand gap-2">
<span class="app-brand-logo demo"><img src="/brandcreator/files/assets/logo-white3.png" style="max-height:60px"></span>
</a>
<div class="authentication-inner row m-0">
<div class="d-none d-lg-flex col-lg-7 col-xl-8 align-items-center p-5" id="bgX"></div>
<div class="d-flex col-12 col-lg-5 col-xl-4 align-items-center authentication-bg p-sm-12 p-6">
<div class="w-px-520 mx-auto mt-12 pt-5">
<h4 class="mb-1">Signing you out across apps…</h4>
<div class="list-group mb-4" style="display: none;">
<div class="d-flex justify-content-between py-2"><span class="fw-bold">Insights</span><span id="st-insights" class="status">Pending…</span></div>
<div class="d-flex justify-content-between py-2"><span class="fw-bold">Sites</span><span id="st-sites" class="status">Pending…</span></div>
<div class="d-flex justify-content-between py-2"><span class="fw-bold">Design Templates</span><span id="st-i" class="status">Pending…</span></div>
</div>
<button id="continueBtn" class="btn btn-primary w-100" disabled>Continue</button>
<a class="btn btn-outline-secondary w-100 mt-2" href="/connect/index.php">Back</a>
</div>
</div>
</div>
</div>
<script>
(function(){
const statuses = {
insights: document.getElementById('st-insights'),
sites: document.getElementById('st-sites'),
i: document.getElementById('st-i')
};
const results = { insights: false, sites: false, i: false };
function mark(id, ok, msg){
results[id] = !!ok;
statuses[id].className = 'status ' + (ok ? 'ok' : 'err');
statuses[id].textContent = (ok ? 'Signed out' : ('Failed: ' + (msg || 'Error')));
const allDone = Object.values(results).every(Boolean);
document.getElementById('continueBtn').disabled = !allDone;
}
async function logoutInsights(){
try {
const resp = await fetch('/insights/auth-logout.php', { method: 'GET', credentials: 'include' });
return mark('insights', resp.ok);
} catch (e) { return mark('insights', false, e.message); }
}
async function logoutSites(){
try {
const resp = await fetch('/sites/index.php/logout', { method: 'GET', credentials: 'include' });
return mark('sites', resp.ok);
} catch (e) { return mark('sites', false, e.message); }
}
async function logoutI(){
try {
const resp = await fetch('/i/logout', { method: 'GET', credentials: 'include' });
return mark('i', resp.ok);
} catch (e) { return mark('i', false, e.message); }
}
Promise.all([logoutInsights(), logoutSites(), logoutI()]).then(function(){
// After signing out across apps, wait 5 seconds then return to Connect
setTimeout(function(){ window.location.href = '/connect/index.php'; }, 5000);
});
document.getElementById('continueBtn').addEventListener('click', function(){
window.location.href = <?php echo json_encode($redirect); ?>;
});
})();
</script>
</body>
</html>