3 * Implements Special:Listusers
5 * Copyright © 2004 Brion Vibber, lcrocker, Tim Starling,
6 * Domas Mituzas, Antoine Musso, Jens Frank, Zhengzhu,
7 * 2006 Rob Church <robchur@gmail.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 * http://www.gnu.org/copyleft/gpl.html
25 * @ingroup SpecialPage
29 * @ingroup SpecialPage
31 class SpecialListUsers
extends IncludableSpecialPage
{
33 public function __construct() {
34 parent
::__construct( 'Listusers' );
38 * Show the special page
40 * @param string $par (optional) A group to list users from
42 public function execute( $par ) {
44 $this->outputHeader();
46 $up = new UsersPager( $this->getContext(), $par, $this->including() );
48 # getBody() first to check, if empty
49 $usersbody = $up->getBody();
52 if ( !$this->including() ) {
53 $s = $up->getPageHeader();
57 $s .= $up->getNavigationBar();
58 $s .= Html
::rawElement( 'ul', [], $usersbody );
59 $s .= $up->getNavigationBar();
61 $s .= $this->msg( 'listusers-noresult' )->parseAsBlock();
64 $this->getOutput()->addHTML( $s );
68 * Return an array of subpages that this special page will accept.
70 * @return string[] subpages
72 public function getSubpagesForPrefixSearch() {
73 return User
::getAllGroups();
76 protected function getGroupName() {
82 * Redirect page: Special:ListAdmins --> Special:ListUsers/sysop.
84 * @ingroup SpecialPage
86 class SpecialListAdmins
extends SpecialRedirectToSpecial
{
87 function __construct() {
88 parent
::__construct( 'Listadmins', 'Listusers', 'sysop' );
93 * Redirect page: Special:ListBots --> Special:ListUsers/bot.
95 * @ingroup SpecialPage
97 class SpecialListBots
extends SpecialRedirectToSpecial
{
98 function __construct() {
99 parent
::__construct( 'Listbots', 'Listusers', 'bot' );