From 5d5df25f758ebec42d5202e97bfa3cc3c026b281 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Sat, 4 Aug 2007 13:53:19 +0000 Subject: [PATCH] #13961 - the fix is not perfect, we now nuke the avatar/rank when leaving a group - no matter what. git-svn-id: file:///svn/phpbb/trunk@8005 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_user.php | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 094ba562fb..274c8bdc2f 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -202,6 +202,7 @@ p a {
  • [Fix] Properly display ban reason if selecting banned entries within the ACP (Bug #13896)
  • [Fix] Properly parse SQL expressions for Oracle (Bug #13916)
  • [Fix] Added label bindings to the custom profile fields in the ACP (Bug #13936) - patch provided by damnian
  • +
  • [Fix] Always remove avatars/ranks when leaving a group. (Bug 13961)
  • diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 2decddb54f..3d6e3d351a 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2710,7 +2710,7 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, { if (isset($sql_where_ary[$gid]) && sizeof($sql_where_ary[$gid])) { - group_set_user_default($gid, $sql_where_ary[$gid], $special_group_data[$gid]); + group_set_user_default($gid, $sql_where_ary[$gid], $special_group_data[$gid], false, true); } } unset($special_group_data); @@ -2892,7 +2892,7 @@ function group_validate_groupname($group_id, $group_name) * * @private */ -function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false, $same_group = false) +function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false, $overwrite = false) { global $db; @@ -2930,7 +2930,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal if (isset($group_attributes[$attribute])) { // If we are about to set an avatar or rank, we will not overwrite with empty, unless we are not actually changing the default group - if (!$same_group && (strpos($attribute, 'group_avatar') === 0 || strpos($attribute, 'group_rank') === 0) && !$group_attributes[$attribute]) + if (!$overwrite && (strpos($attribute, 'group_avatar') === 0 || strpos($attribute, 'group_rank') === 0) && !$group_attributes[$attribute]) { continue; }