From 1d541e285c2918c9bbd6b1442ba3a3af46740157 Mon Sep 17 00:00:00 2001 From: NOrtmann1 Date: Fri, 17 Jul 2026 15:54:47 +0200 Subject: [PATCH] Update showArticle-controller.php --- php/controller/showArticle-controller.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/php/controller/showArticle-controller.php b/php/controller/showArticle-controller.php index 6e140f9..6c1e929 100644 --- a/php/controller/showArticle-controller.php +++ b/php/controller/showArticle-controller.php @@ -25,6 +25,14 @@ if (isset($_GET["id"]) && !empty($_GET["id"])){ exit(); } + if($_GET["pfad"] == "updateArticle"){ + if($article->getAuthor() != $_SESSION["user"]){ + $_SESSION["message"] = "unauthorized_access"; + header("location: ../../index.php"); + exit(); + } + } + $commentManager = CommentManager::getInstance(); $comments = $commentManager->getCommentsByArticle($_GET["id"]);