$opts->add( 'username', '' );
$opts->add( 'groups', [] );
+ $opts->add( 'excludegroups', [] );
+ // Backwards-compatibility with old URLs
+ $opts->add( 'hidebots', false, FormOptions::BOOL );
+ $opts->add( 'hidesysops', false, FormOptions::BOOL );
$opts->fetchValuesFromRequest( $this->getRequest() );
$groups = User::getAllGroups();
foreach ( $groups as $group ) {
- $msg = User::getGroupName( $group );
+ $msg = htmlspecialchars( User::getGroupName( $group ) );
$options[$msg] = $group;
}
+ // Backwards-compatibility with old URLs
+ $req = $this->getRequest();
+ $excludeDefault = [];
+ if ( $req->getCheck( 'hidebots' ) ) {
+ $excludeDefault[] = 'bot';
+ }
+ if ( $req->getCheck( 'hidesysops' ) ) {
+ $excludeDefault[] = 'sysop';
+ }
+
$formDescriptor = [
'username' => [
'type' => 'user',
'name' => 'username',
'label-message' => 'activeusers-from',
],
-
'groups' => [
'type' => 'multiselect',
'dropdown' => true,
'label-message' => 'activeusers-groups',
'options' => $options,
],
+ 'excludegroups' => [
+ 'type' => 'multiselect',
+ 'dropdown' => true,
+ 'flatlist' => true,
+ 'name' => 'excludegroups',
+ 'label-message' => 'activeusers-excludegroups',
+ 'options' => $options,
+ 'default' => $excludeDefault,
+ ],
];
HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() )