r84808 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84807‎ | r84808 | r84809 >
Date:18:39, 26 March 2011
Author:reedy
Status:ok
Tags:
Comment:
Followup r84363

Looks like I made a complete hash of that commit. Commit correct version from vm working copy
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryAllUsers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryAllUsers.php
@@ -216,23 +216,26 @@
217217 }
218218
219219 // Add user's group info
220 - if ( $fld_groups && !is_null( $row->ug_group2 ) ) {
 220+ if ( $fld_groups ) {
221221 if ( !isset( $lastUserData['groups'] ) ) {
222222 $lastUserData['groups'] = ApiQueryUsers::getAutoGroups( User::newFromName( $lastUser ) );
223223 }
224224
225 - $lastUserData['groups'][] = $row->ug_group2;
 225+ if ( !is_null( $row->ug_group2 ) ) {
 226+ $lastUserData['groups'][] = $row->ug_group2;
 227+ }
226228 $result->setIndexedTagName( $lastUserData['groups'], 'g' );
227229 }
228230
229 - if ( $fld_groups ) {
230 - if ( !isset( $lastUserData['groups'] ) ) {
231 - $lastUserData['groups'] = ApiQueryUsers::getAutoGroups( User::newFromName( $lastUser ) );
 231+ if ( $fld_rights ) {
 232+ if ( !isset( $lastUserData['rights'] ) ) {
 233+ $lastUserData['rights'] = User::getGroupPermissions( User::getImplicitGroups() );
232234 }
233235 if ( !is_null( $row->ug_group2 ) ) {
234 - $lastUserData['groups'][] = $row->ug_group2;
 236+ $lastUserData['rights'] = array_unique( array_merge( $lastUserData['rights'],
 237+ User::getGroupPermissions( array( $row->ug_group2 ) ) ) );
235238 }
236 - $result->setIndexedTagName( $lastUserData['groups'], 'g' );
 239+ $result->setIndexedTagName( $lastUserData['rights'], 'r' );
237240 }
238241 }
239242

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84363Actually list implicit groups in allusers....reedy00:23, 20 March 2011

Status & tagging log