576e31b53b2dc8ce707240c2d58b6618a3307b57
[lhc/web/wiklou.git] / includes / SpecialListusers.php
1 <?php
2 /**
3 *
4 */
5
6 /**
7 *
8 */
9 require_once("QueryPage.php");
10
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.
15 *
16 */
17 class ListUsersPage extends QueryPage {
18
19 function getName() {
20 return "Listusers";
21 }
22
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";
30 }
31
32 function sortDescending() {
33 return false;
34 }
35
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 ')';
43 }
44 return $name;
45 }
46 }
47
48 /**
49 * constructor
50 */
51 function wfSpecialListusers() {
52 global $wgUser, $wgOut, $wgLang;
53
54 list( $limit, $offset ) = wfCheckLimits();
55
56 $slu = new ListUsersPage();
57
58 return $slu->doQuery( $offset, $limit );
59 }
60
61 ?>