From: Sam Reed Date: Sun, 20 Mar 2011 00:19:29 +0000 (+0000) Subject: * (bug 27469) label implicit groups in list=allusers&auprop=groups/list=users&usprop... X-Git-Tag: 1.31.0-rc.0~31307 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=db45168a0da074f1ca1550dd6cab40876e26ee4b;p=lhc%2Fweb%2Fwiklou.git * (bug 27469) label implicit groups in list=allusers&auprop=groups/list=users&usprop=groups --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index aecd3bd494..78c8d67c24 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php index c01302d103..114708f6b1 100644 --- a/includes/api/ApiQueryUsers.php +++ b/includes/api/ApiQueryUsers.php @@ -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 ) {