diff --git a/.idea/dataSources/data_sources_history.xml b/.idea/dataSources/data_sources_history.xml index b45f982..3f0c640 100644 --- a/.idea/dataSources/data_sources_history.xml +++ b/.idea/dataSources/data_sources_history.xml @@ -19,7 +19,7 @@ $ProjectFileDir$ - + " diff --git a/content/createArticle.php b/content/createArticle.php index db52c4d..a1a2d20 100644 --- a/content/createArticle.php +++ b/content/createArticle.php @@ -53,9 +53,8 @@ if (!isset($_SESSION["user"])) { - + + diff --git a/content/updateArticle.php b/content/updateArticle.php index 36f6a67..aa260b5 100644 --- a/content/updateArticle.php +++ b/content/updateArticle.php @@ -68,23 +68,17 @@ include_once 'php/controller/showArticle-controller.php'; ?> - + + @@ -143,10 +137,11 @@ include_once 'php/controller/showArticle-controller.php'; diff --git a/php/controller/updateArticle-controller.php b/php/controller/updateArticle-controller.php index d5ccc77..0e0bfd1 100644 --- a/php/controller/updateArticle-controller.php +++ b/php/controller/updateArticle-controller.php @@ -21,7 +21,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") { if (!isset($_POST["title"]) ||!isset($_POST["content"]) || !isset($_POST["category"])){ $_SESSION["message"] = "missing_parameters"; - header("location: ../../index.php?pfad=updateArticle"); + header("location: ../../index.php?pfad=updateArticle&id=$id"); exit(); }else{ $title = $_POST["title"]; @@ -33,31 +33,31 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") { // -------------------------------- Validierung der Daten: ------------------------- if (!articleAuthorValidator($author)) { $_SESSION["message"] = "author_not_valid"; - header("location: ../../index.php?pfad=updateArticle"); + header("location: ../../index.php?pfad=updateArticle&id=$id"); exit(); } if (!articleTitleValidator($title)) { $_SESSION["message"] = "invalid_title"; - header("location: ../../index.php?pfad=updateArticle"); + header("location: ../../index.php?pfad=updateArticle&id=$id"); exit(); } if (!articleContentValidator($content)) { $_SESSION["message"] = "invalid_content"; - header("location: ../../index.php?pfad=updateArticle"); + header("location: ../../index.php?pfad=updateArticle&id=$id"); exit(); } if (!articleCategoryValidator($category)) { $_SESSION["message"] = "invalid_category"; - header("location: ../../index.php?pfad=updateArticle"); + header("location: ../../index.php?pfad=updateArticle&id=$id"); exit(); } if (!articleTagValidator($tags)) { $_SESSION["message"] = "invalid_tags"; - header("location: ../../index.php?pfad=updateArticle"); + header("location: ../../index.php?pfad=updateArticle&id=$id"); exit(); } else { $cleanedTags = []; @@ -83,7 +83,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") { $articleManager->updateArticle($id ,$article, $author); } catch (Exception $e){ $_SESSION["message"] = $e->getMessage(); - header("location: ../../index.php?pfad=updateArticle"); + header("location: ../../index.php?pfad=updateArticle&id=$id"); exit(); } $_SESSION["message"] = "article_updated";