| 1 |
<?php |
| 2 |
|
| 3 |
, |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
namespace MediaWiki\Specials; |
| 26 |
|
| 27 |
use MediaWiki\Block\HideUserUtils; |
| 28 |
use MediaWiki\Cache\LinkBatchFactory; |
| 29 |
use MediaWiki\Html\Html; |
| 30 |
use MediaWiki\Pager\UsersPager; |
| 31 |
use MediaWiki\SpecialPage\IncludableSpecialPage; |
| 32 |
use MediaWiki\User\UserGroupManager; |
| 33 |
use MediaWiki\User\UserIdentityLookup; |
| 34 |
use Wikimedia\Rdbms\IConnectionProvider; |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
class SpecialListUsers extends IncludableSpecialPage { |
| 42 |
|
| 43 |
private LinkBatchFactory $linkBatchFactory; |
| 44 |
private IConnectionProvider $dbProvider; |
| 45 |
private UserGroupManager $userGroupManager; |
| 46 |
private UserIdentityLookup $userIdentityLookup; |
| 47 |
private HideUserUtils $hideUserUtils; |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
public function __construct( |
| 57 |
LinkBatchFactory $linkBatchFactory, |
| 58 |
IConnectionProvider $dbProvider, |
| 59 |
UserGroupManager $userGroupManager, |
| 60 |
UserIdentityLookup $userIdentityLookup, |
| 61 |
HideUserUtils $hideUserUtils |
| 62 |
) { |
| 63 |
parent::__construct( 'Listusers' ); |
| 64 |
$this->linkBatchFactory = $linkBatchFactory; |
| 65 |
$this->dbProvider = $dbProvider; |
| 66 |
$this->userGroupManager = $userGroupManager; |
| 67 |
$this->userIdentityLookup = $userIdentityLookup; |
| 68 |
$this->hideUserUtils = $hideUserUtils; |
| 69 |
} |
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
public function execute( $par ) { |
| 75 |
$this->setHeaders(); |
| 76 |
$this->outputHeader(); |
| 77 |
|
| 78 |
$up = new UsersPager( |
| 79 |
$this->getContext(), |
| 80 |
$this->getHookContainer(), |
| 81 |
$this->linkBatchFactory, |
| 82 |
$this->dbProvider, |
| 83 |
$this->userGroupManager, |
| 84 |
$this->userIdentityLookup, |
| 85 |
$this->hideUserUtils, |
| 86 |
$par, |
| 87 |
$this->including() |
| 88 |
); |
| 89 |
|
| 90 |
|
| 91 |
$usersbody = $up->getBody(); |
| 92 |
|
| 93 |
$s = ''; |
| 94 |
if ( !$this->including() ) { |
| 95 |
$s = $up->getPageHeader(); |
| 96 |
} |
| 97 |
|
| 98 |
if ( $usersbody ) { |
| 99 |
$s .= $up->getNavigationBar(); |
| 100 |
$s .= Html::rawElement( 'ul', [], $usersbody ); |
| 101 |
$s .= $up->getNavigationBar(); |
| 102 |
} else { |
| 103 |
$s .= $this->msg( 'listusers-noresult' )->parseAsBlock(); |
| 104 |
} |
| 105 |
|
| 106 |
$out = $this->getOutput(); |
| 107 |
$out->addHTML( $s ); |
| 108 |
$out->addModuleStyles( 'mediawiki.interface.helpers.styles' ); |
| 109 |
} |
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
public function getSubpagesForPrefixSearch() { |
| 117 |
return $this->userGroupManager->listAllGroups(); |
| 118 |
} |
| 119 |
|
| 120 |
protected function getGroupName() { |
| 121 |
return 'users'; |
| 122 |
} |
| 123 |
} |
| 124 |
|
| 125 |
|
| 126 |
class_alias( SpecialListUsers::class, 'SpecialListUsers' ); |