diff --git a/includes/alertMessages.php b/includes/alertMessages.php index bb122a7..25064bc 100644 --- a/includes/alertMessages.php +++ b/includes/alertMessages.php @@ -38,6 +38,26 @@ Diese Kategorie ist nicht gültig.

+ +

+ Die Artikel-ID fehlt oder ist ungültig. +

+ + +

+ Der angeforderte Beitrag konnte nicht gefunden werden. +

+ + +

+ Du hast keine Berechtigung, diesen Beitrag zu bearbeiten oder zu löschen. +

+ + +

+ Der Beitrag wurde erfolgreich gelöscht. +

+ diff --git a/php/controller/deleteArticle-controller.php b/php/controller/deleteArticle-controller.php index bbf4428..dd2d105 100644 --- a/php/controller/deleteArticle-controller.php +++ b/php/controller/deleteArticle-controller.php @@ -6,13 +6,6 @@ if (session_status() === PHP_SESSION_NONE) { require_once __DIR__ . "/../model/ArticleManager.php"; if ($_SERVER["REQUEST_METHOD"] === "POST") { - if (isset($_POST["id"]) && !empty($_POST["id"])) { - $id = $_POST["id"]; - } else { - $_SESSION["message"] = "missing_id"; - header("location: ../../index.php?pfad=profile"); - exit(); - } if (isset($_SESSION["user"])){ $user = $_SESSION["user"]; @@ -21,6 +14,14 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") { exit(); } + if (isset($_POST["id"]) && !empty($_POST["id"])) { + $id = $_POST["id"]; + } else { + $_SESSION["message"] = "missing_id"; + header("location: ../../index.php?pfad=profile"); + exit(); + } + try { $articleManager = ArticleManager::getInstance();