1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-18 22:41:28 +02:00

[ticket/13645] Move the feeds to controllers

PHPBB3-13645
This commit is contained in:
Nicofuma
2015-02-22 23:36:27 +01:00
committed by Tristan Darricau
parent f56fe0ba8d
commit 8e5e954438
34 changed files with 1019 additions and 534 deletions

View File

@@ -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);