From: Matthew Britton Date: Fri, 24 Sep 2010 13:00:46 +0000 (+0000) Subject: API: sinumberingroup now gives correct size of 'user' group, and omits size of implic... X-Git-Tag: 1.31.0-rc.0~34812 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/journal.php?a=commitdiff_plain;h=5ea75e43959fe4b46418acec6237257ac133b112;p=lhc%2Fweb%2Fwiklou.git API: sinumberingroup now gives correct size of 'user' group, and omits size of implicit groups rather than showing 0. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 886810505f..4c4e024314 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/api/ApiQuerySiteinfo.php b/includes/api/ApiQuerySiteinfo.php index d2a4c18cc8..61a2b7b6eb 100644 --- a/includes/api/ApiQuerySiteinfo.php +++ b/includes/api/ApiQuerySiteinfo.php @@ -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(