aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2008-09-30 15:49:10 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2008-09-30 15:49:10 +0000
commited4797bb4e495d500790f1b21a5fb58b18e8d27d (patch)
treeaaa1b60944b280ba7af77cbdc3016a4d51f396f1 /phpBB
parenta87d283f7ba5ee6c7a5e11ff0ff36c37c160ee6b (diff)
downloadforums-ed4797bb4e495d500790f1b21a5fb58b18e8d27d.tar
forums-ed4797bb4e495d500790f1b21a5fb58b18e8d27d.tar.gz
forums-ed4797bb4e495d500790f1b21a5fb58b18e8d27d.tar.bz2
forums-ed4797bb4e495d500790f1b21a5fb58b18e8d27d.tar.xz
forums-ed4797bb4e495d500790f1b21a5fb58b18e8d27d.zip
Check users pm preferences for pm's sent to groups. (Bug #33245)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8964 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/docs/CHANGELOG.html1
-rw-r--r--phpBB/includes/functions_privmsgs.php7
2 files changed, 7 insertions, 1 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index c7eeabdaaa..47e158174c 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -128,6 +128,7 @@
<li>[Fix] Better return links when deleting topics through the MCP. (Bug #34655)</li>
<li>[Fix] Add quoting support to PM history when composing a reply. (Bug #34285)</li>
<li>[Fix] Use phpBB 3.1.x method for storing cached data to prevent PHP bug with our usage of var_export(). (Thanks to Techie Micheal and HoL for pointing out possible problems)</li>
+ <li>[Fix] Check users pm preferences for pm's sent to groups. (Bug #33245)</li>
<li>[Change] No longer allow the direct use of MULTI_INSERT in sql_build_array. sql_multi_insert() must be used.</li>
<li>[Change] Display warning in ACP if config.php file is left writable.</li>
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index f816cf0321..cbfa8414aa 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1341,12 +1341,17 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
if (isset($data['address_list']['g']) && sizeof($data['address_list']['g']))
{
+ // We need to check the PM status of group members (do they want to receive PM's?)
+ // Only check if not a moderator or admin, since they are allowed to override this user setting
+ $sql_allow_pm = (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) ? ' AND u.user_allow_pm = 1' : '';
+
$sql = 'SELECT u.user_type, ug.group_id, ug.user_id
FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug
WHERE ' . $db->sql_in_set('ug.group_id', array_keys($data['address_list']['g'])) . '
AND ug.user_pending = 0
AND u.user_id = ug.user_id
- AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')';
+ AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')' .
+ $sql_allow_pm;
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))