Skip to content

Commit a8d3cbe

Browse files
committed
[ticket/13159] Allow to do extra auth checks on report posting
PHPBB3-13159
1 parent 70483d6 commit a8d3cbe

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

phpBB/report.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,24 @@
9999
// Check required permissions
100100
$acl_check_ary = array('f_list' => 'POST_NOT_EXIST', 'f_read' => 'USER_CANNOT_READ', 'f_report' => 'USER_CANNOT_REPORT');
101101

102+
/**
103+
* This event allows you to do extra auth checks and verify if the user
104+
* has the required permissions
105+
*
106+
* @event core.report_post_auth
107+
* @var array forum_data All data available from the forums table on this post's forum
108+
* @var array report_data All data available from the topics and the posts tables on this post (and its topic)
109+
* @var array acl_check_ary An array with the ACL to be tested. The evaluation is made in the same order as the array is sorted
110+
* The key is the ACL name and the value is the language key for the error message.
111+
* @since 3.1.3-RC1
112+
*/
113+
$vars = array(
114+
'forum_data',
115+
'report_data',
116+
'acl_check_ary',
117+
);
118+
extract($phpbb_dispatcher->trigger_event('core.report_post_auth', compact($vars)));
119+
102120
foreach ($acl_check_ary as $acl => $error)
103121
{
104122
if (!$auth->acl_get($acl, $forum_id))

0 commit comments

Comments
 (0)