debugging

This commit is contained in:
2026-06-01 23:42:56 +02:00
parent 6958e71bfb
commit e88f741fa7
2 changed files with 9 additions and 7 deletions
+4 -5
View File
@@ -4,14 +4,13 @@ require_once '../model/ArticleManager.php';
require_once '../validator/article-validator.php';
require_once "../model/LocalUserDAO.php";
$dao = new LocalUserDAO();
if (!isset($_SESSION["user"])) {
header("Location: ../../index.php?pfad=login");
exit();
}
try {
$dao = new LocalUserDAO();
$user = $dao->findUser($_SESSION["user_email"] ?? "");
if ($_SERVER["REQUEST_METHOD"] === "POST") {
@@ -27,7 +26,7 @@ try {
} else {
$title = $_POST["title"];
$content = $_POST["content"];
$author = $user;
$author = $user["email"];
$category = $_POST["category"];
$tags = $_POST['tags'] ?? '';
@@ -96,13 +95,13 @@ try {
$_SESSION["message"] = "internal_error";
exit();
}
/*
if (!$user) {
$_SESSION = [];
session_destroy();
header("Location: ../../index.php?pfad=login");
exit();
}*/
}
?>