1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
Oinktube/objects/logoff.php
2022-09-19 15:58:17 -03:00

27 lines
No EOL
738 B
PHP

<?php
global $global, $config;
if (!isset($global['systemRootPath'])) {
require_once '../videos/configuration.php';
}
require_once $global['systemRootPath'] . 'objects/user.php';
if (!empty($advancedCustomUser->afterLogoffGoToMyChannel)) {
$redirectUri = User::getChannelLink();
} elseif (!empty($advancedCustomUser->afterLogoffGoToURL)) {
$redirectUri = $advancedCustomUser->afterLogoffGoToURL;
} else {
$redirectUri = $global['webSiteRootURL'];
}
User::logoff();
Category::clearCacheCount();
header("location: {$redirectUri}");
exit;
?>
<script>
caches.keys().then(cacheNames => {
cacheNames.forEach(cacheName => {
caches.delete(cacheName);
});
document.location = '<?php echo $redirectUri; ?>';
});
</script>