aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-12-27 13:58:49 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-12-27 13:58:49 +0100
commit7b43d5c54e82459925a27efb620980508543e703 (patch)
treef74d9185df4728b3e673fd3e99e4ac8a9364f75b
parent3ba62628dc5077ffdad64832d89c1353421c2ca6 (diff)
parenta8d3cbe53be10bc4414b0034d3cd145a978015fd (diff)
downloadforums-7b43d5c54e82459925a27efb620980508543e703.tar
forums-7b43d5c54e82459925a27efb620980508543e703.tar.gz
forums-7b43d5c54e82459925a27efb620980508543e703.tar.bz2
forums-7b43d5c54e82459925a27efb620980508543e703.tar.xz
forums-7b43d5c54e82459925a27efb620980508543e703.zip
Merge pull request #3214 from brunoais/ticket/13159
[ticket/13159] Allow to do extra auth checks on report posting
-rw-r--r--phpBB/report.php18
1 files changed, 18 insertions, 0 deletions
diff --git a/phpBB/report.php b/phpBB/report.php
index 1b5d3c9d46..3ea6bb40c5 100644
--- a/phpBB/report.php
+++ b/phpBB/report.php
@@ -99,6 +99,24 @@ if ($post_id)
// Check required permissions
$acl_check_ary = array('f_list' => 'POST_NOT_EXIST', 'f_read' => 'USER_CANNOT_READ', 'f_report' => 'USER_CANNOT_REPORT');
+ /**
+ * This event allows you to do extra auth checks and verify if the user
+ * has the required permissions
+ *
+ * @event core.report_post_auth
+ * @var array forum_data All data available from the forums table on this post's forum
+ * @var array report_data All data available from the topics and the posts tables on this post (and its topic)
+ * @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
+ * The key is the ACL name and the value is the language key for the error message.
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'forum_data',
+ 'report_data',
+ 'acl_check_ary',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.report_post_auth', compact($vars)));
+
foreach ($acl_check_ary as $acl => $error)
{
if (!$auth->acl_get($acl, $forum_id))