@@ -155,10 +155,10 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
Bearbeiten
-
--
2.47.3
From 36f6396148782d095a5f8a560c0a43ac583dd1e6 Mon Sep 17 00:00:00 2001
From: NOrtmann1 <145041949+NOrtmann1@users.noreply.github.com>
Date: Wed, 10 Jun 2026 17:13:49 +0200
Subject: [PATCH 03/10] Update deleteArticle-controller.php
---
php/controller/deleteArticle-controller.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/php/controller/deleteArticle-controller.php b/php/controller/deleteArticle-controller.php
index efae77f..3bd4485 100644
--- a/php/controller/deleteArticle-controller.php
+++ b/php/controller/deleteArticle-controller.php
@@ -3,7 +3,7 @@ if (session_status() === PHP_SESSION_NONE) {
session_start();
}
-require_once "php/model/ArticleManager.php";
+require_once "../model/ArticleManager.php";
if ($_SERVER["REQUEST_METHOD"] === "POST") {
if (isset($_POST["id"]) && !empty($_POST["id"])) {
--
2.47.3
From da9dc0e8fbfc3b119860cb0a70e0308befc91644 Mon Sep 17 00:00:00 2001
From: NOrtmann1 <145041949+NOrtmann1@users.noreply.github.com>
Date: Wed, 10 Jun 2026 17:15:29 +0200
Subject: [PATCH 04/10] Update deleteArticle-controller.php
---
php/controller/deleteArticle-controller.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/php/controller/deleteArticle-controller.php b/php/controller/deleteArticle-controller.php
index 3bd4485..1e71948 100644
--- a/php/controller/deleteArticle-controller.php
+++ b/php/controller/deleteArticle-controller.php
@@ -26,7 +26,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
$articleManager = ArticleManager::getInstance();
$articleManager->deleteArticle($id, $user);
- } catch (Exception $e) {
+ } catch (\Exception $e) {
$_SESSION["message"] = $e->getMessage();
header("location: ../../index.php?pfad=profile");
exit();
--
2.47.3
From 42aa908f1c5611a39743a239fd0b6e910c6bd980 Mon Sep 17 00:00:00 2001
From: NOrtmann1 <145041949+NOrtmann1@users.noreply.github.com>
Date: Wed, 10 Jun 2026 17:20:22 +0200
Subject: [PATCH 05/10] Update deleteArticle-controller.php
---
php/controller/deleteArticle-controller.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/php/controller/deleteArticle-controller.php b/php/controller/deleteArticle-controller.php
index 1e71948..68cc651 100644
--- a/php/controller/deleteArticle-controller.php
+++ b/php/controller/deleteArticle-controller.php
@@ -3,7 +3,7 @@ if (session_status() === PHP_SESSION_NONE) {
session_start();
}
-require_once "../model/ArticleManager.php";
+require_once __DIR__ . "/../model/ArticleManager.php";
if ($_SERVER["REQUEST_METHOD"] === "POST") {
if (isset($_POST["id"]) && !empty($_POST["id"])) {
--
2.47.3
From a0932fed04fc486b605426409e5e9e3106a91e1d Mon Sep 17 00:00:00 2001
From: NOrtmann1 <145041949+NOrtmann1@users.noreply.github.com>
Date: Wed, 10 Jun 2026 17:21:28 +0200
Subject: [PATCH 06/10] debugging
---
php/controller/deleteArticle-controller.php | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/php/controller/deleteArticle-controller.php b/php/controller/deleteArticle-controller.php
index 68cc651..96f0307 100644
--- a/php/controller/deleteArticle-controller.php
+++ b/php/controller/deleteArticle-controller.php
@@ -21,7 +21,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
exit();
}
- try {
+ /*try {
$articleManager = ArticleManager::getInstance();
$articleManager->deleteArticle($id, $user);
@@ -30,9 +30,9 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
$_SESSION["message"] = $e->getMessage();
header("location: ../../index.php?pfad=profile");
exit();
- }
+ }*/
+
$_SESSION["message"] = "article_deleted";
- // Weiterleitung zur Homepage
header("location: ../../index.php?pfad=profile");
exit();
}
--
2.47.3
From e0fbd220f09769557f43f37de33960106b95f821 Mon Sep 17 00:00:00 2001
From: NOrtmann1 <145041949+NOrtmann1@users.noreply.github.com>
Date: Wed, 10 Jun 2026 17:23:36 +0200
Subject: [PATCH 07/10] debugging
---
php/controller/deleteArticle-controller.php | 6 +++---
php/model/DatabaseArticleManager.php | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/php/controller/deleteArticle-controller.php b/php/controller/deleteArticle-controller.php
index 96f0307..bbf4428 100644
--- a/php/controller/deleteArticle-controller.php
+++ b/php/controller/deleteArticle-controller.php
@@ -21,7 +21,7 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
exit();
}
- /*try {
+ try {
$articleManager = ArticleManager::getInstance();
$articleManager->deleteArticle($id, $user);
@@ -30,8 +30,8 @@ if ($_SERVER["REQUEST_METHOD"] === "POST") {
$_SESSION["message"] = $e->getMessage();
header("location: ../../index.php?pfad=profile");
exit();
- }*/
-
+ }
+
$_SESSION["message"] = "article_deleted";
header("location: ../../index.php?pfad=profile");
exit();
diff --git a/php/model/DatabaseArticleManager.php b/php/model/DatabaseArticleManager.php
index 1697071..83b4baa 100644
--- a/php/model/DatabaseArticleManager.php
+++ b/php/model/DatabaseArticleManager.php
@@ -147,7 +147,7 @@ class DatabaseArticleManager implements ArticleManagerDAO {
public function deleteArticle($id, $author)
{
- $article = getArticle($id);
+ $article = $this->getArticle($id);
if (empty($article)) {
throw new NotFoundException("not_found_article");
}
--
2.47.3
From 5f9789a884e72d4f40d90fe6dbae2a27099d68ff Mon Sep 17 00:00:00 2001
From: NOrtmann1 <145041949+NOrtmann1@users.noreply.github.com>
Date: Wed, 10 Jun 2026 17:28:40 +0200
Subject: [PATCH 08/10] alerts
---
includes/alertMessages.php | 20 ++++++++++++++++++++
php/controller/deleteArticle-controller.php | 15 ++++++++-------
2 files changed, 28 insertions(+), 7 deletions(-)
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();
--
2.47.3
From ac2451fe64c8910258deebec53fb3af876937d6d Mon Sep 17 00:00:00 2001
From: NOrtmann1 <145041949+NOrtmann1@users.noreply.github.com>
Date: Wed, 10 Jun 2026 17:34:39 +0200
Subject: [PATCH 09/10] Update deleteArticle-controller.php
---
php/controller/deleteArticle-controller.php | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/php/controller/deleteArticle-controller.php b/php/controller/deleteArticle-controller.php
index dd2d105..27858d4 100644
--- a/php/controller/deleteArticle-controller.php
+++ b/php/controller/deleteArticle-controller.php
@@ -7,10 +7,13 @@ require_once __DIR__ . "/../model/ArticleManager.php";
if ($_SERVER["REQUEST_METHOD"] === "POST") {
- if (isset($_SESSION["user"])){
- $user = $_SESSION["user"];
+ if (isset($_SESSION["user_email"])) {
+ $user = $_SESSION["user_email"];
} else {
- header("location: ../../index.php?pfad=login");
+ $_SESSION = [];
+ session_destroy();
+
+ header("Location: index.php");
exit();
}
--
2.47.3
From a5e1fb4c387813d5ba5da73f483f44e8a69e96e7 Mon Sep 17 00:00:00 2001
From: NOrtmann1 <145041949+NOrtmann1@users.noreply.github.com>
Date: Wed, 10 Jun 2026 17:49:33 +0200
Subject: [PATCH 10/10] css
---
content/profile.php | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/content/profile.php b/content/profile.php
index 5c67936..a404854 100644
--- a/content/profile.php
+++ b/content/profile.php
@@ -158,7 +158,9 @@ $isEditMode = (isset($_GET["edit"]) && $_GET["edit"] === "1") || !empty($error);
--
2.47.3