* (bug 37708) mw.Uri.clone() should make a deep copy.
* (bug 38024) ResourceLoader should not create empty stylesheets for modules
that don't have stylesheets.
+* (bug 36812) Special:ActiveUsers "Hide bots" should hide users from any group
+ having the "bot" user right, instead of just the default "bot" user group.
=== API changes in 1.20 ===
* (bug 34316) Add ability to retrieve maximum upload size from MediaWiki API.
/**
* @var Array
*/
- protected $groups;
+ protected $hideGroups = array();
+
+ /**
+ * @var Array
+ */
+ protected $hideRights = array();
/**
* @param $context IContextSource
$this->opts->fetchValuesFromRequest( $this->getRequest() );
- $this->groups = array();
if ( $this->opts->getValue( 'hidebots' ) == 1 ) {
- $this->groups['bot'] = true;
+ $this->hideRights[] = 'bot';
}
if ( $this->opts->getValue( 'hidesysops' ) == 1 ) {
- $this->groups['sysop'] = true;
+ $this->hideGroups[] = 'sysop';
}
}
$lang = $this->getLanguage();
$list = array();
- foreach( self::getGroups( $row->user_id ) as $group ) {
- if ( isset( $this->groups[$group] ) ) {
+ $user = User::newFromId( $row->user_id );
+
+ // User right filter
+ foreach( $this->hideRights as $right ) {
+ // Calling User::getRights() within the loop so that
+ // if the hideRights() filter is empty, we don't have to
+ // trigger the lazy-init of the big userrights array in the
+ // User object
+ if ( in_array( $right, $user->getRights() ) ) {
+ return '';
+ }
+ }
+
+ // User group filter
+ // Note: This is a different loop than for user rights,
+ // because we're reusing it to build the group links
+ // at the same time
+ foreach( $user->getGroups() as $group ) {
+ if ( in_array( $group, $this->hideGroups ) ) {
return '';
}
$list[] = self::buildGroupLink( $group, $userName );
}
+
$groups = $lang->commaList( $list );
$item = $lang->specialList( $ulinks, $groups );