* (bug 27469) label implicit groups in list=allusers&auprop=groups/list=users&usprop...
authorSam Reed <reedy@users.mediawiki.org>
Sun, 20 Mar 2011 00:19:29 +0000 (00:19 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 20 Mar 2011 00:19:29 +0000 (00:19 +0000)
RELEASE-NOTES
includes/api/ApiQueryUsers.php

index aecd3bd..78c8d67 100644 (file)
@@ -269,6 +269,8 @@ PHP if you have not done so prior to upgrading MediaWiki.
 * (bug 28104) Namespace for local pages in interwiki backlinks (iwbacklinks)
   is missing
 * (bug 27343) Add parseddescription to list=filearchive
+* (bug 27469) label implicit groups in list=allusers&auprop=groups/
+  list=users&usprop=groups
 
 === Languages updated in 1.18 ===
 
index c01302d..114708f 100644 (file)
@@ -245,18 +245,26 @@ class ApiQueryUsers extends ApiQueryBase {
        }
 
        /**
-       * Gets all the groups that a user is automatically a member of
+       * Gets all the groups that a user is automatically a member of (implicit groups)
        * @param $user User
        * @return array
        */
        public static function getAutoGroups( $user ) {
-               $groups = array( '*' );
+               $groups = array();
+               $groups[] = '*';
 
                if ( !$user->isAnon() ) {
                        $groups[] = 'user';
                }
 
-               return array_merge( $groups, Autopromote::getAutopromoteGroups( $user ) );
+               $builtGroups = array();
+               $i = 0;
+               foreach( array_merge( $groups, Autopromote::getAutopromoteGroups( $user ) ) as $g ) {
+                       $builtGroups[$i] = array( 'implicit' => '' );
+                       ApiResult::setContent( $builtGroups[$i], $g );
+                       $i++;
+               }
+               return $builtGroups;
        }
 
        public function getCacheMode( $params ) {