aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenry Sudhof <kellanved@phpbb.com>2007-07-23 11:03:20 +0000
committerHenry Sudhof <kellanved@phpbb.com>2007-07-23 11:03:20 +0000
commit4299475256f7d5b84f3ee9a474bb1c1b714c0bd6 (patch)
tree1fb6f31ed7dc7b0b534a9be65fe848580b4ffb0b
parent2fdb32bc1d3509b9a9f43ac0f0f364a2bd9d93c7 (diff)
downloadforums-4299475256f7d5b84f3ee9a474bb1c1b714c0bd6.tar
forums-4299475256f7d5b84f3ee9a474bb1c1b714c0bd6.tar.gz
forums-4299475256f7d5b84f3ee9a474bb1c1b714c0bd6.tar.bz2
forums-4299475256f7d5b84f3ee9a474bb1c1b714c0bd6.tar.xz
forums-4299475256f7d5b84f3ee9a474bb1c1b714c0bd6.zip
Bugs #13701, #13697
Still not a perfect fix, but it should be better. To illustrate the problem: Whenever the default group is changed, we have to apply group avatars and ranks. The group value is then copied to the user table, where it is not easily decideable whatever or not it is a group value or a special value. If we change the default group of an user, we want that user to lose the group rank/avatar; however, we also have to dispose special ranks etc. in the process. Bottom line: use groups to assign ranks :| git-svn-id: file:///svn/phpbb/trunk@7927 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/docs/CHANGELOG.html2
-rw-r--r--phpBB/includes/functions_user.php8
2 files changed, 5 insertions, 5 deletions
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 8212b0c7f4..3cc2421fd4 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -268,7 +268,7 @@ p a {
<li>[Fix] Allow for polls to work during preview (Bug #13657) - thanks to Thatbitextra</li>
<li>[Fix] Finer error conditions for sending IM messages (Bugs #13681, #13683)</li>
<li>[Fix] Add a confirmation for log deletion in the MCP (Bug #13693)</li>
-
+ <li>[Fix] Do not erase ranks and avatars when changing default groups (Bugs #13701, #13697)</li>
</ul>
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 4de247d33c..35c3ace106 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -2396,7 +2396,7 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
if (sizeof($user_ary))
{
- group_set_user_default($group_id, $user_ary, $sql_ary);
+ group_set_user_default($group_id, $user_ary, $sql_ary, false, true);
}
}
@@ -2893,7 +2893,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)
+function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false, $same_group = false)
{
global $db;
@@ -2930,8 +2930,8 @@ 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, we will not overwrite user avatars if no group avatar is set...
- if (strpos($attribute, 'group_avatar') === 0 && !$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])
{
continue;
}