* Moved password reset form from Special:Preferences to Special:ResetPass
* Added Special:ChangePassword as a special page alias for Special:ResetPass
* Added complimentary function for addHandler() called removeHandler() for removing events
-* Added hook SpecialListusersGetGroups which is called right before the end of UsersPager::getGroups()
- and can be used by extensions to add to the user's groups.
=== Bug fixes in 1.14 ===
$item: HTML to be returned. Will be wrapped in <li></li> after the hook finishes
$row: Database row object
-'SpecialListusersGetGroups': called right before the end of UsersPager::getGroups()
-&$groups: array of groups the user is in
-$uid: User identifier
-
'SpecialListusersHeader': called before closing the <fieldset> in UsersPager::getPageHeader()
$pager: The UsersPager instance
$out: The header HTML
* @return array
*/
protected static function getGroups( $uid ) {
- $dbr = wfGetDB( DB_SLAVE );
- $groups = array();
- $res = $dbr->select( 'user_groups', 'ug_group', array( 'ug_user' => $uid ), __METHOD__ );
- if( $res && $dbr->numRows( $res ) > 0 ) {
- while( $row = $dbr->fetchObject( $res ) )
- $groups[] = $row->ug_group;
- $dbr->freeResult( $res );
- }
- wfRunHooks( 'SpecialListusersGetGroups', array( &$groups, $uid ) );
+ $user = User::newFromId( $uid );
+ $groups = array_diff( $user->getEffectiveGroups(), $user->getImplicitGroups() );
return $groups;
}