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/forum.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/forum.php')
| -rw-r--r-- | phpBB/phpbb/feed/forum.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/phpBB/phpbb/feed/forum.php b/phpBB/phpbb/feed/forum.php index 7a2087c1cd..f493c4729a 100644 --- a/phpBB/phpbb/feed/forum.php +++ b/phpBB/phpbb/feed/forum.php @@ -13,6 +13,10 @@ namespace phpbb\feed; +use phpbb\feed\exception\no_feed_exception; +use phpbb\feed\exception\no_forum_exception; +use phpbb\feed\exception\unauthorized_forum_exception; + /** * Forum feed * @@ -49,25 +53,25 @@ class forum extends \phpbb\feed\post_base if (empty($this->forum_data)) { - trigger_error('NO_FORUM'); + throw new no_forum_exception($this->forum_id); } // Forum needs to be postable if ($this->forum_data['forum_type'] != FORUM_POST) { - trigger_error('NO_FEED'); + throw new no_feed_exception(); } // Make sure forum is not excluded from feed if (phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $this->forum_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 @@ -77,7 +81,7 @@ class forum 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); |
