X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialActiveusers.php;h=7e29be0a295468a71099ff35dd1135f2a0281e6f;hb=12601ff7d2796752404bfb331fccc41083d31f9f;hp=531c3303280c85f6c02145760f707e6391feb2bd;hpb=ea42d90053b36cef47f318a1d50c18dfafc6b7b8;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialActiveusers.php b/includes/specials/SpecialActiveusers.php index 531c330328..e7c9423c7f 100644 --- a/includes/specials/SpecialActiveusers.php +++ b/includes/specials/SpecialActiveusers.php @@ -2,8 +2,6 @@ /** * Implements Special:Activeusers * - * Copyright © 2008 Aaron Schulz - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -52,6 +50,10 @@ class SpecialActiveUsers extends SpecialPage { $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() ); @@ -82,17 +84,26 @@ class SpecialActiveUsers extends SpecialPage { $groups = User::getAllGroups(); foreach ( $groups as $group ) { - $msg = User::getGroupName( $group ); + $msg = htmlspecialchars( UserGroupMembership::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, @@ -101,6 +112,15 @@ class SpecialActiveUsers extends SpecialPage { '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() )