From d01be7d84c448a338a81b932f91c2f00e36baf61 Mon Sep 17 00:00:00 2001 From: NOrtmann1 Date: Mon, 1 Jun 2026 23:18:52 +0200 Subject: [PATCH] Update profile-controller.php --- php/controller/profile-controller.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/php/controller/profile-controller.php b/php/controller/profile-controller.php index 7b0af19..27832c4 100644 --- a/php/controller/profile-controller.php +++ b/php/controller/profile-controller.php @@ -11,17 +11,16 @@ if (!isset($_SESSION["user"])) { exit(); } -$user = $dao->findUser($_SESSION["user_email"] ?? ""); -/*try { - $author = $user->getAuthor(); +try { + $user = $dao->findUser($_SESSION["user_email"] ?? ""); $articleManager = ArticleManager::getInstance(); - $userArticles = $articleManager->getArticlesByAuthor($author); + $userArticles = $articleManager->getArticlesByAuthor($user); if(!isset($userArticles)) { $_SESSION["message"] = "user_has_no_articles"; } } catch (Exception $e) { $_SESSION["message"] = "internal_error"; -}*/ +} if (!$user) { $_SESSION = [];