diff options
author | Nicofuma <github@nicofuma.fr> | 2015-02-22 23:36:27 +0100 |
---|---|---|
committer | Tristan Darricau <tristan.darricau@sensiolabs.com> | 2015-08-23 22:36:10 +0200 |
commit | 8e5e954438b232f4ce7aec6a5db3d52b974c07a8 (patch) | |
tree | 26eb33e968d8b7a48f40bb092b751a1a708a8f59 /phpBB/phpbb/feed/topic.php | |
parent | f56fe0ba8da2211d3947369e79952f294cffe7d6 (diff) | |
download | forums-8e5e954438b232f4ce7aec6a5db3d52b974c07a8.tar forums-8e5e954438b232f4ce7aec6a5db3d52b974c07a8.tar.gz forums-8e5e954438b232f4ce7aec6a5db3d52b974c07a8.tar.bz2 forums-8e5e954438b232f4ce7aec6a5db3d52b974c07a8.tar.xz forums-8e5e954438b232f4ce7aec6a5db3d52b974c07a8.zip |
[ticket/13645] Move the feeds to controllers
PHPBB3-13645
Diffstat (limited to 'phpBB/phpbb/feed/topic.php')
-rw-r--r-- | phpBB/phpbb/feed/topic.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/phpBB/phpbb/feed/topic.php b/phpBB/phpbb/feed/topic.php index 66c49e55cf..c916d3bccc 100644 --- a/phpBB/phpbb/feed/topic.php +++ b/phpBB/phpbb/feed/topic.php @@ -13,6 +13,11 @@ namespace phpbb\feed; +use phpbb\feed\exception\no_feed_exception; +use phpbb\feed\exception\no_topic_exception; +use phpbb\feed\exception\unauthorized_forum_exception; +use phpbb\feed\exception\unauthorized_topic_exception; + /** * Topic feed for a specific topic * @@ -50,7 +55,7 @@ class topic extends \phpbb\feed\post_base if (empty($this->topic_data)) { - trigger_error('NO_TOPIC'); + throw new no_topic_exception($this->topic_id); } $this->forum_id = (int) $this->topic_data['forum_id']; @@ -58,19 +63,19 @@ class topic extends \phpbb\feed\post_base // Make sure topic is either approved or user authed if ($this->topic_data['topic_visibility'] != ITEM_APPROVED && !$this->auth->acl_get('m_approve', $this->forum_id)) { - trigger_error('SORRY_AUTH_READ'); + throw new unauthorized_topic_exception($this->topic_id); } // Make sure forum is not excluded from feed if (phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $this->topic_data['forum_options'])) { - trigger_error('NO_FEED'); + throw new no_feed_exception(); } // Make sure we can read this forum if (!$this->auth->acl_get('f_read', $this->forum_id)) { - trigger_error('SORRY_AUTH_READ'); + throw new unauthorized_forum_exception($this->forum_id); } // Make sure forum is not passworded or user is authed @@ -80,7 +85,7 @@ class topic extends \phpbb\feed\post_base if (isset($forum_ids_passworded[$this->forum_id])) { - trigger_error('SORRY_AUTH_READ'); + throw new unauthorized_forum_exception($this->forum_id); } unset($forum_ids_passworded); |