AuthManager: Break AuthPlugin::addUser more explicitly
[mediawiki.git] / includes / specials / SpecialListusers.php
blob1a8dccf4de09262c458e3db5a44b56ae99608803
1 <?php
2 /**
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
24 * @file
25 * @ingroup SpecialPage
28 /**
29 * @ingroup SpecialPage
31 class SpecialListUsers extends IncludableSpecialPage {
32 /**
33 * Constructor
35 public function __construct() {
36 parent::__construct( 'Listusers' );
39 /**
40 * Show the special page
42 * @param string $par (optional) A group to list users from
44 public function execute( $par ) {
45 $this->setHeaders();
46 $this->outputHeader();
48 $up = new UsersPager( $this->getContext(), $par, $this->including() );
50 # getBody() first to check, if empty
51 $usersbody = $up->getBody();
53 $s = '';
54 if ( !$this->including() ) {
55 $s = $up->getPageHeader();
58 if ( $usersbody ) {
59 $s .= $up->getNavigationBar();
60 $s .= Html::rawElement( 'ul', [], $usersbody );
61 $s .= $up->getNavigationBar();
62 } else {
63 $s .= $this->msg( 'listusers-noresult' )->parseAsBlock();
66 $this->getOutput()->addHTML( $s );
69 /**
70 * Return an array of subpages that this special page will accept.
72 * @return string[] subpages
74 public function getSubpagesForPrefixSearch() {
75 return User::getAllGroups();
78 protected function getGroupName() {
79 return 'users';
83 /**
84 * Redirect page: Special:ListAdmins --> Special:ListUsers/sysop.
86 * @ingroup SpecialPage
88 class SpecialListAdmins extends SpecialRedirectToSpecial {
89 function __construct() {
90 parent::__construct( 'Listadmins', 'Listusers', 'sysop' );
94 /**
95 * Redirect page: Special:ListBots --> Special:ListUsers/bot.
97 * @ingroup SpecialPage
99 class SpecialListBots extends SpecialRedirectToSpecial {
100 function __construct() {
101 parent::__construct( 'Listbots', 'Listusers', 'bot' );