}
$this->groups = $opts->getValue( 'groups' );
+ $this->excludegroups = $opts->getValue( 'excludegroups' );
+ // Backwards-compatibility with old URLs
+ if ( $opts->getValue( 'hidebots' ) ) {
+ $this->excludegroups[] = 'bot';
+ }
+ if ( $opts->getValue( 'hidesysops' ) ) {
+ $this->excludegroups[] = 'sysop';
+ }
}
function getIndexField() {
$conds[] = 'ug_user = user_id';
$conds['ug_group'] = $this->groups;
}
+ if ( $this->excludegroups !== [] ) {
+ foreach ( $this->excludegroups as $group ) {
+ $conds[] = 'NOT EXISTS (' . $dbr->selectSQLText(
+ 'user_groups', '1', [ 'ug_user = user_id', 'ug_group' => $group ]
+ ) . ')';
+ }
+ }
if ( !$this->getUser()->isAllowed( 'hideuser' ) ) {
$conds[] = 'NOT EXISTS (' . $dbr->selectSQLText(
'ipblocks', '1', [ 'ipb_user=user_id', 'ipb_deleted' => 1 ]