mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-01 06:20:46 +02:00
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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user