DSP Project first push, date: 29/01/2026

This commit is contained in:
Sok Ponlork
2026-01-29 14:31:48 +07:00
parent 951262afb3
commit 644b624d2d
1857 changed files with 163516 additions and 0 deletions

25
logout.php Normal file
View File

@@ -0,0 +1,25 @@
<?php
// logout.php
session_start();
session_unset(); // Unset all session variables
session_destroy(); // Destroy the session
require_once 'includes/auth.php'; // For set_message function
set_message("You have been logged out.", "info");
$scheme = (!empty($_SERVER['HTTPS']) && strtolower((string) $_SERVER['HTTPS']) !== 'off') ? 'https' : 'http';
$host = $_SERVER['HTTP_HOST'] ?? '';
$homeUrl = $scheme . '://' . $host . '/index.php';
$redirectUrl = $homeUrl;
$jupyterBase = getenv('JUPYTER_EXTERNAL_URL');
if (!empty($jupyterBase)) {
$hubLogout = rtrim($jupyterBase, '/') . '/hub/logout';
$redirectUrl = $hubLogout . '?next=' . urlencode($homeUrl);
}
header("Location: " . $redirectUrl);
exit();
?>