r44213 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44212‎ | r44213 | r44214 >
Date:01:39, 4 December 2008
Author:pinky
Status:ok
Tags:
Comment:
Update on r44048:
Removing SpecialListusersGetGroups hook completely, and changing the
UsersPager::getGroups function to use User::getEffectiveGroups instead
of directly making a DB query itself.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/specials/SpecialListusers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -1206,10 +1206,6 @@
12071207 $item: HTML to be returned. Will be wrapped in <li></li> after the hook finishes
12081208 $row: Database row object
12091209
1210 -'SpecialListusersGetGroups': called right before the end of UsersPager::getGroups()
1211 -&$groups: array of groups the user is in
1212 -$uid: User identifier
1213 -
12141210 'SpecialListusersHeader': called before closing the <fieldset> in UsersPager::getPageHeader()
12151211 $pager: The UsersPager instance
12161212 $out: The header HTML
Index: trunk/phase3/includes/specials/SpecialListusers.php
@@ -215,15 +215,8 @@
216216 * @return array
217217 */
218218 protected static function getGroups( $uid ) {
219 - $dbr = wfGetDB( DB_SLAVE );
220 - $groups = array();
221 - $res = $dbr->select( 'user_groups', 'ug_group', array( 'ug_user' => $uid ), __METHOD__ );
222 - if( $res && $dbr->numRows( $res ) > 0 ) {
223 - while( $row = $dbr->fetchObject( $res ) )
224 - $groups[] = $row->ug_group;
225 - $dbr->freeResult( $res );
226 - }
227 - wfRunHooks( 'SpecialListusersGetGroups', array( &$groups, $uid ) );
 219+ $user = User::newFromId( $uid );
 220+ $groups = array_diff( $user->getEffectiveGroups(), $user->getImplicitGroups() );
228221 return $groups;
229222 }
230223
Index: trunk/phase3/RELEASE-NOTES
@@ -216,8 +216,6 @@
217217 * Moved password reset form from Special:Preferences to Special:ResetPass
218218 * Added Special:ChangePassword as a special page alias for Special:ResetPass
219219 * Added complimentary function for addHandler() called removeHandler() for removing events
220 -* Added hook SpecialListusersGetGroups which is called right before the end of UsersPager::getGroups()
221 - and can be used by extensions to add to the user's groups.
222220
223221 === Bug fixes in 1.14 ===
224222

Follow-up revisions

RevisionCommit summaryAuthorDate
r44824adding Nathaniel Herman into CREDITS (r44084, r44213)ashley02:02, 20 December 2008

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r44048* Added hook SpecialListusersGetGroups which is called right before the...pinky19:45, 29 November 2008

Status & tagging log