r44048 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44047‎ | r44048 | r44049 >
Date:19:45, 29 November 2008
Author:pinky
Status:resolved (Comments)
Tags:
Comment:
* Added hook SpecialListusersGetGroups which is called right before the
end of UsersPager::getGroups() and can be used to add to the user's
groups.
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/RELEASE-NOTES
@@ -217,6 +217,8 @@
218218 * Moved password reset form from Special:Preferences to Special:ResetPass
219219 * Added Special:ChangePassword as a special page alias for Special:ResetPass
220220 * Added complimentary function for addHandler() called removeHandler() for removing events
 221+* Added hook SpecialListusersGetGroups which is called right before the end of UsersPager::getGroups()
 222+ and can be used by extensions to add to the user's groups.
221223
222224 === Bug fixes in 1.14 ===
223225
Index: trunk/phase3/includes/specials/SpecialListusers.php
@@ -223,6 +223,7 @@
224224 $groups[] = $row->ug_group;
225225 $dbr->freeResult( $res );
226226 }
 227+ wfRunHooks( 'SpecialListusersGetGroups', array( &$groups, $uid ) );
227228 return $groups;
228229 }
229230
Index: trunk/phase3/docs/hooks.txt
@@ -1206,6 +1206,10 @@
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+
12101214 'SpecialListusersHeader': called before closing the <fieldset> in UsersPager::getPageHeader()
12111215 $pager: The UsersPager instance
12121216 $out: The header HTML

Follow-up revisions

RevisionCommit summaryAuthorDate
r44213Update on r44048:...pinky01:39, 4 December 2008

Comments

#Comment by Aaron Schulz (talk | contribs)   06:02, 3 December 2008

Looks like the wrong way of doing whatever it's used for :/

#Comment by Skizzerz (talk | contribs)   21:57, 3 December 2008

Um, how about listing those who belong to global groups in Special:ListUsers? Seems like a perfect hook and use case for that. An extra special page simply to list users belonging to global groups is counterintuitive, especially when such groups do not exist locally.

#Comment by Brion VIBBER (talk | contribs)   00:41, 4 December 2008

Well,

1) Perhaps there will be multiple places that would want a list of available groups; hardocding it to a hook for one special page means that others wouldn't get it. Should we have a more general list here?

2) Do non-default groups actually get usefully used here? The actual query won't include memberships from external databases.

#Comment by Pinky (talk | contribs)   01:42, 4 December 2008

Hook removed in r44213 and SpecialListusers.php redone to do it a different way.

Status & tagging log