Dashboard Fach hinzufügen funktioniert in swe-b1-a-dev

This commit is contained in:
Kelvi Yawo Jules Agbessi Awuklu
2024-12-21 20:08:59 +01:00
committed by Matthias Grief
parent a04936f59e
commit 77e91ae393
119 changed files with 5374 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
<?php
require_once("classes/User.php");
session_start();
if (isset($_SESSION['user']) && $_SESSION['user'] instanceof User) {
$user = $_SESSION['user'];
if ($user->logout()) {
// Logout successful, redirect to homepage
header("Location: index.php");
exit();
} else {
// Logout failed, handle error
echo "<script>alert('Logout failed. Please try again.'); window.location.href='index.php';</script>";
}
} else {
// No user is logged in, redirect to homepage
header("Location: index.php");
exit();
}
?>