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 = [];