$_SESSION["user_email"]

This commit is contained in:
2026-06-02 00:16:53 +02:00
parent c9c0de6c3c
commit 6de86c3143
2 changed files with 3 additions and 10 deletions
+2 -9
View File
@@ -5,9 +5,6 @@ require_once '../model/ArticleManager.php';
require_once '../validator/article-validator.php';
require_once "../model/LocalUserDAO.php";
try{
$dao = new LocalUserDAO();
$user = $dao->findUser($_SESSION["user_email"] ?? "");
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$_SESSION["old_title"] = $_POST["title"] ?? '';
$_SESSION["old_content"] = $_POST["content"] ?? '';
@@ -21,7 +18,7 @@ try{
} else {
$title = $_POST["title"];
$content = $_POST["content"];
$author = $user["email"];
$author = $_SESSION["user_email"];
$category = $_POST["category"];
$tags = $_POST['tags'] ?? '';
@@ -86,11 +83,7 @@ try{
exit();
}
}
} catch (Exception $e) {
$_SESSION["message"] = "internal_error";
header("location: ../../index.php?pfad=createArticle");
exit();
}
?>