diff --git a/app/controllers/course/forum/index.php b/app/controllers/course/forum/index.php index c3b665ead1b53455d36134e2087e202a5693b30e..cc2f6b024ab82381df2a8b49b764bd0f85eede5b 100644 --- a/app/controllers/course/forum/index.php +++ b/app/controllers/course/forum/index.php @@ -177,6 +177,8 @@ class Course_Forum_IndexController extends ForumController */ function newest_action($page = null) { + ForumPerm::check('fav_entry', $this->getId()); + $nav = Navigation::getItem('course/forum2'); $nav->setImage(Icon::create('forum', 'info')); Navigation::activateItem('course/forum2/newest'); @@ -211,6 +213,8 @@ class Course_Forum_IndexController extends ForumController */ function latest_action($page = null) { + ForumPerm::check('fav_entry', $this->getId()); + $nav = Navigation::getItem('course/forum2'); $nav->setImage(Icon::create('forum', 'info')); Navigation::activateItem('course/forum2/latest'); @@ -245,6 +249,8 @@ class Course_Forum_IndexController extends ForumController */ function favorites_action($page = null) { + ForumPerm::check('fav_entry', $this->getId()); + $nav = Navigation::getItem('course/forum2'); $nav->setImage(Icon::create('forum', 'info')); Navigation::activateItem('course/forum2/favorites'); @@ -832,4 +838,13 @@ class Course_Forum_IndexController extends ForumController ForumHelpers::createPDF($this->getId(), $parent_id); } + + public function rescue($exception) + { + if ($exception instanceof AccessDeniedException) { + $GLOBALS['auth']->login_if($GLOBALS['user']->id === 'nobody'); + } + + parent::rescue($exception); + } }