aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/viewtopic.php
diff options
context:
space:
mode:
authorbrunoais <brunoaiss@gmail.com>2014-12-13 18:36:14 +0000
committerbrunoais <brunoaiss@gmail.com>2015-01-10 17:08:39 +0000
commita0287a62c105df121c46f827c71d8c3808f67964 (patch)
tree696d1edecdbc5b0572460437d2ad65fd6a6049d5 /phpBB/viewtopic.php
parenta415a4ec2b732d4bb88ab4da8f4709fe748592f6 (diff)
downloadforums-a0287a62c105df121c46f827c71d8c3808f67964.tar
forums-a0287a62c105df121c46f827c71d8c3808f67964.tar.gz
forums-a0287a62c105df121c46f827c71d8c3808f67964.tar.bz2
forums-a0287a62c105df121c46f827c71d8c3808f67964.tar.xz
forums-a0287a62c105df121c46f827c71d8c3808f67964.zip
[ticket/13160] Viewtopic; before viewing permissions event
An event before the f_Read permissions check in viewtopic PHPBB3-13160
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r--phpBB/viewtopic.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 5f897e8d94..82f091b1cf 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -336,6 +336,27 @@ if (($topic_data['topic_type'] == POST_STICKY || $topic_data['topic_type'] == PO
// Setup look and feel
$user->setup('viewtopic', $topic_data['forum_style']);
+/**
+* Event to apply extra permissions and to override original phpBB's f_read permission and forum password check
+* on viewtopic access
+*
+* @event core.viewtopic_before_f_read_check
+* @var int forum_id The forum id from where the topic belongs
+* @var int topic_id The id of the topic the user tries to access
+* @var int post_id The id of the post the user tries to start viewing at. It may be 0 for none given.
+* @var string topic_data All the information from the topic and forum tables for this topic
+* It includes posts information if post_id is not 0
+*
+* @since 3.1.3-RC1
+*/
+$vars = array(
+ 'forum_id',
+ 'topic_id',
+ 'post_id',
+ 'topic_data',
+);
+extract($phpbb_dispatcher->trigger_event('core.viewtopic_before_f_read_check', compact($vars)));
+
// Start auth check
if (!$auth->acl_get('f_read', $forum_id))
{