X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fspecials%2FSpecialActiveusers.php;h=e7c9423c7f3d7b5ebe2d0e6c05774590940034cf;hb=203cedd029e42bd3c55e50a9cff6f14373d8aa67;hp=531c3303280c85f6c02145760f707e6391feb2bd;hpb=1f83b424294a6fd78cb73cf43db3464ca7481774;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() )