From 3774a2caee8065da4f9e3050efd97917e40d1d34 Mon Sep 17 00:00:00 2001 From: NOrtmann1 Date: Mon, 1 Jun 2026 23:14:25 +0200 Subject: [PATCH] merging --- content/profile.php | 1 - php/controller/profile-controller.php | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/content/profile.php b/content/profile.php index 0cc0ae0..2c7ec5a 100644 --- a/content/profile.php +++ b/content/profile.php @@ -1,6 +1,5 @@ diff --git a/php/controller/profile-controller.php b/php/controller/profile-controller.php index c731942..5f35fa8 100644 --- a/php/controller/profile-controller.php +++ b/php/controller/profile-controller.php @@ -1,6 +1,8 @@ findUser($_SESSION["user_email"] ?? ""); +try { + $author = $user->getAuthor(); + $articleManager = ArticleManager::getInstance(); + $userArticles = $articleManager->getArticlesByAuthor($author); + if(!isset($userArticles)) { + $_SESSION["message"] = "user_has_no_articles"; + } +} catch (Exception $e) { + $_SESSION["message"] = "internal_error"; +} if (!$user) { $_SESSION = [];