Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-7624

viewprofile list of groups (in memberlist.php) wrongly conceals hidden groups of which the viewer is

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 3.0.7
    • 3.0.2
    • None
    • PHP Environment:
      Database:

      I just noticed that when a user looks at the list of member groups in someone's profile, he will generally not see hidden groups even if the user who is doing the looking is a member of the hidden group. I assume the list should actually include hidden groups of which the viewing user is a member, correct?

      The problem is in this code in memberlist.php:

      		// Do the SQL thang
      		$sql = 'SELECT g.group_id, g.group_name, g.group_type
      			FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . " ug
      			WHERE ug.user_id = $user_id
      				AND g.group_id = ug.group_id" . ((!$auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? ' AND g.group_type <> ' . GROUP_HIDDEN : '') . '
      				AND ug.user_pending = 0
      			ORDER BY g.group_type, g.group_name';
      		$result = $db->sql_query($sql);

      This looks like a bug to me, but perhaps you intended it because getting it to list the hidden groups the viewer is a member of might take an extra query or at least a query that takes longer to execute?

            bantu Andreas Fischer [X] (Inactive)
            asinshesq asinshesq [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: