aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2015-01-10 22:00:07 +0100
committerJoas Schilling <nickvergessen@gmx.de>2015-01-10 22:00:07 +0100
commitbfba52781b00ae778b5c4ca6daa35525de47e914 (patch)
treebcd9e13478c88ae2fa2f3f55b529c7bbe285ee1e /phpBB
parenta415a4ec2b732d4bb88ab4da8f4709fe748592f6 (diff)
parente0733ae435afed03a05bbfd6ebf88de534d549d2 (diff)
downloadforums-bfba52781b00ae778b5c4ca6daa35525de47e914.tar
forums-bfba52781b00ae778b5c4ca6daa35525de47e914.tar.gz
forums-bfba52781b00ae778b5c4ca6daa35525de47e914.tar.bz2
forums-bfba52781b00ae778b5c4ca6daa35525de47e914.tar.xz
forums-bfba52781b00ae778b5c4ca6daa35525de47e914.zip
Merge pull request #3210 from brunoais/ticket/13147
[ticket/13147] Change get_global_visibility_sql()'s results
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/phpbb/content_visibility.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php
index de0e389dd1..c8516d6c85 100644
--- a/phpBB/phpbb/content_visibility.php
+++ b/phpBB/phpbb/content_visibility.php
@@ -244,6 +244,35 @@ class content_visibility
$approve_forums = array_diff(array_keys($this->auth->acl_getf('m_approve', true)), $exclude_forum_ids);
+ $visibility_sql_overwrite = null;
+
+ /**
+ * 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
+ * @var string visibility_sql_overwrite Forces the function to return an implosion of where_sqls (joined by "OR")
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'where_sqls',
+ 'mode',
+ 'forum_ids',
+ 'table_alias',
+ 'approve_forums',
+ 'visibility_sql_overwrite',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_global_visibility_before', compact($vars)));
+
+ if ($visibility_sql_overwrite)
+ {
+ return $visibility_sql_overwrite;
+ }
+
if (sizeof($exclude_forum_ids))
{
$where_sqls[] = '(' . $this->db->sql_in_set($table_alias . 'forum_id', $exclude_forum_ids, true) . '