Some documentation. Let's talk about it in wikitech-l.
[mediawiki.git] / includes / SpecialListusers.php
blob576e31b53b2dc8ce707240c2d58b6618a3307b57
1 <?php
2 /**
4 */
6 /**
8 */
9 require_once("QueryPage.php");
11 /**
12 * This class is used to get a list of user. The ones with specials
13 * rights (sysop, bureaucrat, developer) will have them displayed
14 * next to their names.
17 class ListUsersPage extends QueryPage {
19 function getName() {
20 return "Listusers";
23 function getSQL() {
24 $dbr =& wfGetDB( DB_SLAVE );
25 $user = $dbr->tableName( 'user' );
26 $user_rights = $dbr->tableName( 'user_rights' );
27 $userspace = Namespace::getUser();
28 return "SELECT r.user_rights as type, $userspace as namespace, u.user_name as title, " .
29 "u.user_name as value FROM $user u LEFT JOIN $user_rights r ON u.user_id = r.user_id";
32 function sortDescending() {
33 return false;
36 function formatResult( $skin, $result ) {
37 global $wgLang;
38 $name = $skin->makeLink( $wgLang->getNsText($result->namespace) . ':' . $result->title, $result->title );
39 if( '' != $result->type ) {
40 $name .= ' (' .
41 $skin->makeLink( wfMsg( "administrators" ), $result->type) .
42 ')';
44 return $name;
48 /**
49 * constructor
51 function wfSpecialListusers() {
52 global $wgUser, $wgOut, $wgLang;
54 list( $limit, $offset ) = wfCheckLimits();
56 $slu = new ListUsersPage();
58 return $slu->doQuery( $offset, $limit );