aboutsummaryrefslogtreecommitdiffstats
path: root/includes/SpecialListusers.php
blob: e74f2a23a920ad2f08c9f4b9cd5dc8945a4fb8bf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
#
# This class is used to get a list of user. The ones with specials
# rights (sysop, bureaucrat, developer) will have them displayed
# next to their names.

require_once("QueryPage.php");

class ListUsersPage extends QueryPage {

	function getName() {
		return "Listusers";
	}

	function getSQL() {
		global $wgIsPg;
		$usertable = $wgIsPg?'"user"':'user';
		$userspace = Namespace::getUser();
		return "SELECT user_rights as type, $userspace as namespace, user_name as title, user_name as value FROM $usertable";
	}
	
	function sortDescending() {
		return false;
	}

	function formatResult( $skin, $result ) {
		global $wgLang;
		$name = $skin->makeKnownLink( $wgLang->getNsText($result->namespace) . ':' . $result->title, $result->title );
		if( '' != $result->type ) {
			$name .= ' (' .
			$skin->makeKnownLink( wfMsg( "administrators" ), $result->type) .
			')';
		}
		return $name;
	}
}

function wfSpecialListusers() {
	global $wgUser, $wgOut, $wgLang, $wgIsPg;

	list( $limit, $offset ) = wfCheckLimits();

	$slu = new ListUsersPage();

	return $slu->doQuery( $offset, $limit );
}

?>