Migrated as a QueryPage extension
[mediawiki.git] / includes / SpecialListusers.php
blobad11a78170de4e26a47ce41695a48bad4c87b065
1 <?php
3 require_once("QueryPage.php");
5 class ListUsersPage extends QueryPage {
7 function getName() {
8 return "Listusers";
11 function isExpensive() {
12 return false;
15 function getSQL() {
16 global $wgIsPg;
17 $usertable = $wgIsPg?'"user"':'user';
18 $userspace = Namespace::getUser();
19 return "SELECT user_rights as type, $userspace as namespace, user_name as title, user_name as value FROM $usertable";
22 function sortDescending() {
23 return false;
26 function formatResult( $skin, $result ) {
27 global $wgLang;
28 $name = $skin->makeKnownLink( $wgLang->getNsText($result->namespace) . ':' . $result->title, $result->title );
29 if( '' != $result->type ) {
30 $name .= ' (' .
31 $skin->makeKnownLink( wfMsg( "administrators" ), $result->type) .
32 ')';
34 return $name;
38 function wfSpecialListusers() {
39 global $wgUser, $wgOut, $wgLang, $wgIsPg;
41 list( $limit, $offset ) = wfCheckLimits();
43 $slu = new ListUsersPage();
45 return $slu->doQuery( $offset, $limit );