wiki.techinc.nl/includes/SpecialListusers.php

66 lines
1.3 KiB
PHP
Raw Normal View History

<?php
/**
*
* @package MediaWiki
* @subpackage SpecialPage
*/
2003-04-14 23:10:40 +00:00
/**
*
*/
require_once("QueryPage.php");
2003-04-14 23:10:40 +00:00
/**
* 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.
*
* @package MediaWiki
* @subpackage SpecialPage
*/
class ListUsersPage extends QueryPage {
2003-04-14 23:10:40 +00:00
function getName() {
return "Listusers";
}
2003-04-14 23:10:40 +00:00
function getSQL() {
$dbr =& wfGetDB( DB_SLAVE );
$user = $dbr->tableName( 'user' );
$user_rights = $dbr->tableName( 'user_rights' );
$userspace = Namespace::getUser();
return "SELECT ur_rights as type, $userspace as namespace, user_name as title, " .
"user_name as value FROM $user LEFT JOIN $user_rights ON user_id = ur_user";
}
function sortDescending() {
return false;
}
2003-04-14 23:10:40 +00:00
function formatResult( $skin, $result ) {
global $wgContLang;
$name = $skin->makeLink( $wgContLang->getNsText($result->namespace) . ':' . $result->title, $result->title );
if( '' != $result->type ) {
$name .= ' (' .
$skin->makeLink( wfMsgForContent( "administrators" ), $result->type) .
')';
2003-04-14 23:10:40 +00:00
}
return $name;
2003-04-14 23:10:40 +00:00
}
}
/**
* constructor
*/
function wfSpecialListusers() {
global $wgUser, $wgOut, $wgLang;
list( $limit, $offset ) = wfCheckLimits();
$slu = new ListUsersPage();
return $slu->doQuery( $offset, $limit );
2003-04-14 23:10:40 +00:00
}
?>