From a0287a62c105df121c46f827c71d8c3808f67964 Mon Sep 17 00:00:00 2001 From: brunoais Date: Sat, 13 Dec 2014 18:36:14 +0000 Subject: [ticket/13160] Viewtopic; before viewing permissions event An event before the f_Read permissions check in viewtopic PHPBB3-13160 --- phpBB/viewtopic.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'phpBB/viewtopic.php') 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)) { -- cgit v1.2.1