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