API: sinumberingroup now gives correct size of 'user' group, and omits size of implic...
authorMatthew Britton <gurch@users.mediawiki.org>
Fri, 24 Sep 2010 13:00:46 +0000 (13:00 +0000)
committerMatthew Britton <gurch@users.mediawiki.org>
Fri, 24 Sep 2010 13:00:46 +0000 (13:00 +0000)
RELEASE-NOTES
includes/api/ApiQuerySiteinfo.php

index 8868105..4c4e024 100644 (file)
@@ -400,6 +400,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 24166) API error when using rvprop=tags
 * Introduced "asynchronous download" mode for upload-by-url. Requires 
   $wgAllowAsyncCopyUploads to be true.
+* sinumberingroup correctly gives size of 'user' group, and omits size of
+  implicit groups rather than showing 0.
 
 === Languages updated in 1.17 ===
 
index d2a4c18..61a2b7b 100644 (file)
@@ -331,8 +331,17 @@ class ApiQuerySiteinfo extends ApiQueryBase {
                                'name' => $group,
                                'rights' => array_keys( $permissions, true ),
                        );
+                       
                        if ( $numberInGroup ) {
-                               $arr['number'] = SiteStats::numberInGroup( $group );
+                               global $wgAutopromote;
+                       
+                               if ($group == 'user') {
+                                       $arr['number'] = SiteStats::users();
+                                       
+                               // '*' and autopromote groups have no size
+                               } elseif (!($group == '*' || in_array($group, array_keys($wgAutopromote)))) {
+                                       $arr['number'] = SiteStats::numberInGroup( $group );
+                               }
                        }
                        
                        $groupArr = array(