Update createArticle-controller.php

This commit is contained in:
2026-06-01 23:33:20 +02:00
parent 5703c0a6dd
commit da9ea4f413
+12 -12
View File
@@ -13,18 +13,6 @@ if (!isset($_SESSION["user"])) {
try {
$user = $dao->findUser($_SESSION["user_email"] ?? "");
} catch (Exception $e) {
$_SESSION["message"] = "internal_error";
exit();
}
if (!$user) {
$_SESSION = [];
session_destroy();
header("Location: ../../index.php?pfad=login");
exit();
}
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$_SESSION["old_title"] = $_POST["title"] ?? '';
@@ -104,5 +92,17 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
exit();
}
}
} catch (Exception $e) {
$_SESSION["message"] = "internal_error";
exit();
}
if (!$user) {
$_SESSION = [];
session_destroy();
header("Location: ../../index.php?pfad=login");
exit();
}
?>