From db45168a0da074f1ca1550dd6cab40876e26ee4b Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 20 Mar 2011 00:19:29 +0000 Subject: [PATCH] * (bug 27469) label implicit groups in list=allusers&auprop=groups/list=users&usprop=groups --- RELEASE-NOTES | 2 ++ includes/api/ApiQueryUsers.php | 14 +++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) 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 ) { -- 2.20.1