Remove call to User::getImplicitGroups() from ApiQueryAllUsers
authorSam Reed <reedy@users.mediawiki.org>
Mon, 18 Jul 2011 16:09:50 +0000 (16:09 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Mon, 18 Jul 2011 16:09:50 +0000 (16:09 +0000)
Per the below, as User::getGroupsWithPermission() will return */autoconfirmed, etc if applicable

> var_dump( User::getGroupsWithPermission( 'createtalk' ) );
array(2) {
  [0]=>
  string(1) "*"
  [1]=>
  string(4) "user"
}

> var_dump( User::getGroupsWithPermission( 'autoconfirmed' ) );
array(5) {
  [0]=>
  string(13) "autoconfirmed"
  [1]=>
  string(3) "bot"
  [2]=>
  string(5) "sysop"
  [3]=>
  string(8) "reviewer"
  [4]=>
  string(9) "confirmed"
}

includes/api/ApiQueryAllUsers.php
includes/specials/SpecialListusers.php

index a5a11f6..22f5626 100644 (file)
@@ -76,7 +76,7 @@ class ApiQueryAllUsers extends ApiQueryBase {
                                $groups = array_merge( $groups, User::getGroupsWithPermission( $r ) );
                        }
 
-                       $groups = array_diff( array_unique( $groups ), User::getImplicitGroups() );
+                       $groups = array_unique( $groups );
 
                        if ( is_null( $params['group'] ) ) {
                                $params['group'] = $groups;
index b8f42f1..0531444 100644 (file)
@@ -256,7 +256,7 @@ class UsersPager extends AlphabeticPager {
         */
        protected static function getGroups( $uid ) {
                $user = User::newFromId( $uid );
-               $groups = array_diff( $user->getEffectiveGroups(), $user->getImplicitGroups() );
+               $groups = array_diff( $user->getEffectiveGroups(), User::getImplicitGroups() );
                return $groups;
        }