5a317f2a020b45ce17b72e38027fdf60a2e232cc
[lhc/web/wiklou.git] / includes / SpecialListusers.php
1 <?php
2 #
3 # This class is used to get a list of user. The ones with specials
4 # rights (sysop, bureaucrat, developer) will have them displayed
5 # next to their names.
6
7 require_once("QueryPage.php");
8
9 class ListUsersPage extends QueryPage {
10
11 function getName() {
12 return "Listusers";
13 }
14
15 function getSQL() {
16 $usertable = wfTableName( 'user', DB_READ );
17 $userspace = Namespace::getUser();
18 return "SELECT user_rights as type, $userspace as namespace, user_name as title, user_name as value FROM $usertable";
19 }
20
21 function sortDescending() {
22 return false;
23 }
24
25 function formatResult( $skin, $result ) {
26 global $wgLang;
27 $name = $skin->makeKnownLink( $wgLang->getNsText($result->namespace) . ':' . $result->title, $result->title );
28 if( '' != $result->type ) {
29 $name .= ' (' .
30 $skin->makeKnownLink( wfMsg( "administrators" ), $result->type) .
31 ')';
32 }
33 return $name;
34 }
35 }
36
37 function wfSpecialListusers() {
38 global $wgUser, $wgOut, $wgLang;
39
40 list( $limit, $offset ) = wfCheckLimits();
41
42 $slu = new ListUsersPage();
43
44 return $slu->doQuery( $offset, $limit );
45 }
46
47 ?>