aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/feed.php
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@phpbb.com>2009-12-11 16:41:37 +0000
committerAndreas Fischer <bantu@phpbb.com>2009-12-11 16:41:37 +0000
commitd3cd9ce01ef27c50226b61ae1e0f9ff2e8c2573d (patch)
tree5295c47aa1f0abd97b4a91d4b8f7df4e7aec7f6f /phpBB/feed.php
parentafa8dcb42a5a264d1f6e1f7a3f4a5889c3b5aa66 (diff)
downloadforums-d3cd9ce01ef27c50226b61ae1e0f9ff2e8c2573d.tar
forums-d3cd9ce01ef27c50226b61ae1e0f9ff2e8c2573d.tar.gz
forums-d3cd9ce01ef27c50226b61ae1e0f9ff2e8c2573d.tar.bz2
forums-d3cd9ce01ef27c50226b61ae1e0f9ff2e8c2573d.tar.xz
forums-d3cd9ce01ef27c50226b61ae1e0f9ff2e8c2573d.zip
#54345 - Passworded forums
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@10318 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/feed.php')
-rw-r--r--phpBB/feed.php30
1 files changed, 27 insertions, 3 deletions
diff --git a/phpBB/feed.php b/phpBB/feed.php
index 98e8e61349..26bfbb0d51 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -545,6 +545,16 @@ class phpbb_feed_base
}
$db->sql_freeresult($result);
+ // Include passworded forums
+ $this->excluded_forums_ary = array_unique(array_merge($this->excluded_forums_ary, $this->get_passworded_forums()));
+
+ return $this->excluded_forums_ary;
+ }
+
+ function get_passworded_forums()
+ {
+ global $db, $user;
+
// Exclude passworded forums
$sql = 'SELECT f.forum_id, fa.user_id
FROM ' . FORUMS_TABLE . ' f
@@ -554,16 +564,19 @@ class phpbb_feed_base
WHERE f.forum_password <> ''";
$result = $db->sql_query($sql);
+ $forum_ids = array();
while ($row = $db->sql_fetchrow($result))
{
+ $forum_id = (int) $row['forum_id'];
+
if ($row['user_id'] != $user->data['user_id'])
{
- $this->excluded_forums_ary[(int) $row['forum_id']] = (int) $row['forum_id'];
+ $forum_ids[$forum_id] = $forum_id;
}
}
$db->sql_freeresult($result);
- return $this->excluded_forums_ary;
+ return $forum_ids;
}
function get_item()
@@ -960,6 +973,9 @@ class phpbb_feed_news extends phpbb_feed_base
{
global $auth, $config, $db;
+ // Get passworded forums
+ $forum_ids_passworded = $this->get_passworded_forums();
+
// Get news forums...
$sql = 'SELECT forum_id
FROM ' . FORUMS_TABLE . '
@@ -969,8 +985,16 @@ class phpbb_feed_news extends phpbb_feed_base
$in_fid_ary = array();
while ($row = $db->sql_fetchrow($result))
{
+ $forum_id = (int) $row['forum_id'];
+
+ // Passworded forum
+ if (isset($forum_ids_passworded[$forum_id]))
+ {
+ continue;
+ }
+
// Make sure we can read this forum
- if (!$auth->acl_get('f_read', (int) $row['forum_id']))
+ if (!$auth->acl_get('f_read', $forum_id))
{
continue;
}