diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2006-11-26 15:31:12 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-11-26 15:31:12 +0000 |
| commit | 4d6f84c3208c0d941d3b786a1c60682e9c20193f (patch) | |
| tree | 1df8f6dd18fd96a0cf977dac17ca4be3ab416bf3 /phpBB/includes | |
| parent | 9fa4f1f012a70ee2a225b048e6e57bdfeb5734b8 (diff) | |
| download | forums-4d6f84c3208c0d941d3b786a1c60682e9c20193f.tar forums-4d6f84c3208c0d941d3b786a1c60682e9c20193f.tar.gz forums-4d6f84c3208c0d941d3b786a1c60682e9c20193f.tar.bz2 forums-4d6f84c3208c0d941d3b786a1c60682e9c20193f.tar.xz forums-4d6f84c3208c0d941d3b786a1c60682e9c20193f.zip | |
fix for bug #5586
git-svn-id: file:///svn/phpbb/trunk@6662 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
| -rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 52 |
1 files changed, 23 insertions, 29 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index f16b4b0841..c150831f0d 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -943,41 +943,35 @@ function handle_message_list_actions(&$address_list, $remove_u, $remove_g, $add_ $friend_list = (is_array($_REQUEST['add_' . $type])) ? array_map('intval', array_keys($_REQUEST['add_' . $type])) : array(); $user_id_ary = array_merge($user_id_ary, $friend_list); - if (sizeof($user_id_ary)) + foreach ($user_id_ary as $user_id) { - // We need to check their PM status (do they want to receive PM's?) - // Only check if not a moderator or admin, since they are allowed to override this user setting - if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) + if ($user_id == ANONYMOUS) { - $sql = 'SELECT user_id - FROM ' . USERS_TABLE . ' - WHERE ' . $db->sql_in_set('user_id', $user_id_ary) . ' - AND user_allow_pm = 1'; - $result = $db->sql_query($sql); + continue; + } - while ($row = $db->sql_fetchrow($result)) - { - if ($row['user_id'] == ANONYMOUS) - { - continue; - } + $address_list['u'][$user_id] = $type; + } + } - $address_list['u'][$row['user_id']] = $type; - } - $db->sql_freeresult($result); - } - else - { - foreach ($user_id_ary as $user_id) - { - if ($user_id == ANONYMOUS) - { - continue; - } + // Check for disallowed recipients + if (sizeof($address_list['u'])) + { + // We need to check their PM status (do they want to receive PM's?) + // Only check if not a moderator or admin, since they are allowed to override this user setting + if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) + { + $sql = 'SELECT user_id + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', array_keys($address_list['u'])) . ' + AND user_allow_pm = 0'; + $result = $db->sql_query($sql); - $address_list['u'][$user_id] = $type; - } + while ($row = $db->sql_fetchrow($result)) + { + unset($address_list['u'][$row['user_id']]); } + $db->sql_freeresult($result); } } } |
