wiki.techinc.nl/includes/SpecialListusers.php
Tim Starling ac549401d4 * Support for table name prefixes throughout the code. No support yet for converting static SQL, which also means no installation. But it has been tested by creating the tables in the ordinary way and then renaming them
* DB_WRITE now called DB_MASTER, DB_READ now called DB_SLAVE
* Converted to use SQL wrapper functions instead of direct SQL in various places
* Experimental method for preserving the chronological order of events when slave servers are used. Untested.
* Fixes to the new post-parse existence test feature
* Some.. other stuff
2004-07-18 08:48:43 +00:00

49 lines
1.1 KiB
PHP

<?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() {
$dbr =& wfGetDB( DB_SLAVE );
$usertable = $dbr->tableName( '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;
list( $limit, $offset ) = wfCheckLimits();
$slu = new ListUsersPage();
return $slu->doQuery( $offset, $limit );
}
?>