aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrunoais <brunoaiss@gmail.com>2014-11-29 15:18:47 +0000
committerbrunoais <brunoaiss@gmail.com>2015-01-10 11:44:52 +0000
commit8f5e3d5efb486a556de3e09a35b1e6b9f527f9cf (patch)
tree9e7cc76b0c6ceae45eea9249ccbb6ffaacd8a6f1
parent67c987f0d06cb0898d2589c7bc12fceb4e142d68 (diff)
downloadforums-8f5e3d5efb486a556de3e09a35b1e6b9f527f9cf.tar
forums-8f5e3d5efb486a556de3e09a35b1e6b9f527f9cf.tar.gz
forums-8f5e3d5efb486a556de3e09a35b1e6b9f527f9cf.tar.bz2
forums-8f5e3d5efb486a556de3e09a35b1e6b9f527f9cf.tar.xz
forums-8f5e3d5efb486a556de3e09a35b1e6b9f527f9cf.zip
[ticket/13147] Allow changing the result of calling get_global_visibility_sql
PHPBB3-13147
-rw-r--r--phpBB/phpbb/content_visibility.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php
index de0e389dd1..9647095f78 100644
--- a/phpBB/phpbb/content_visibility.php
+++ b/phpBB/phpbb/content_visibility.php
@@ -244,6 +244,26 @@ class content_visibility
$approve_forums = array_diff(array_keys($this->auth->acl_getf('m_approve', true)), $exclude_forum_ids);
+ /**
+ * Allow changing the result of calling get_global_visibility_sql
+ *
+ * @event core.phpbb_content_visibility_get_global_visibility_before
+ * @var array where_sqls The action the user tried to execute
+ * @var string mode Either "topic" or "post" depending on the query this is being used in
+ * @var array forum_ids Array of forum ids which the posts/topics are limited to
+ * @var string table_alias Table alias to prefix in SQL queries
+ * @var array approve_forums Array of forums where the user has m_approve permissions
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'where_sqls',
+ 'mode',
+ 'forum_ids',
+ 'table_alias',
+ 'approve_forums',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_global_visibility_before', compact($vars)));
+
if (sizeof($exclude_forum_ids))
{
$where_sqls[] = '(' . $this->db->sql_in_set($table_alias . 'forum_id', $exclude_forum_ids, true) . '