private function searchUserposts($user) { // Data will be displayed only if the current user is Logged $profileVisitor = $this->_model->getLoggedInMember(); if ($profileVisitor) { $userId = APP_User::memberId($user); $membersForumPostsPagePublic = $this->_model->isMembersForumPostsPagePublic($userId); if ($membersForumPostsPagePublic || $profileVisitor->getPKValue() == $userId || $this->BW_Right->HasRight("Admin") || $this->BW_Right->HasRight("ForumModerator") || $this->BW_Right->HasRight("SafetyTeam")) { $posts = $this->_model->searchUserposts($user); } else { $posts = array(); //TODO: post something that says that the user has not enabled that page } } else { $posts = array(); } $this->_view->displaySearchResultPosts($posts); // TODO: post something suggesting to LogIn or to register to maybe see posts by this user }