diff options
author | nobody <nobody@localhost> | 2004-06-27 00:05:32 +0000 |
---|---|---|
committer | nobody <nobody@localhost> | 2004-06-27 00:05:32 +0000 |
commit | 0c1d741ff4792d486258b390cf50cf3f9e229511 (patch) | |
tree | 55961c46b433ade0739763bee2ba3c4843d13751 /includes/SpecialListusers.php | |
parent | d5c8171a3157337557bc54ecb730d7dd35778ca3 (diff) | |
parent | 1aaed5fd7c7f4d7ea7abbfc7915bab5954d60a30 (diff) | |
download | mediawikicore-1.3.0beta4a.tar.gz mediawikicore-1.3.0beta4a.zip |
This commit was manufactured by cvs2svn to create tag1.3.0beta4a
'REL1_3_0beta4a'.
Diffstat (limited to 'includes/SpecialListusers.php')
-rw-r--r-- | includes/SpecialListusers.php | 62 |
1 files changed, 36 insertions, 26 deletions
diff --git a/includes/SpecialListusers.php b/includes/SpecialListusers.php index f87852f48297..e74f2a23a920 100644 --- a/includes/SpecialListusers.php +++ b/includes/SpecialListusers.php @@ -1,38 +1,48 @@ <?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. -function wfSpecialListusers() -{ - global $wgUser, $wgOut, $wgLang; +require_once("QueryPage.php"); - list( $limit, $offset ) = wfCheckLimits(); +class ListUsersPage extends QueryPage { - $top = wfShowingResults( $offset, $limit ); - $wgOut->addHTML( "<p>{$top}\n" ); + function getName() { + return "Listusers"; + } - $sl = wfViewPrevNext( $offset, $limit, - $wgLang->specialPage( "Listusers" ) ); - $wgOut->addHTML( "<br />{$sl}</p>\n<ol start='" . ( $offset + 1 ) . "'>" ); + function getSQL() { + global $wgIsPg; + $usertable = $wgIsPg?'"user"':'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; + } - $sql = "SELECT user_name,user_rights FROM user ORDER BY " . - "user_name LIMIT {$offset}, {$limit}"; - $res = wfQuery( $sql, DB_READ, "wfSpecialListusers" ); + 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; + } +} - $sk = $wgUser->getSkin(); - while ( $s = wfFetchObject( $res ) ) { - $n = $s->user_name; - $r = $s->user_rights; +function wfSpecialListusers() { + global $wgUser, $wgOut, $wgLang, $wgIsPg; - $l = $sk->makeLink( $wgLang->getNsText( - Namespace::getUser() ) . ":{$n}", $n ); + list( $limit, $offset ) = wfCheckLimits(); - if ( "" != $r ) { - $link = $sk->makeKnownLink( wfMsg( "administrators" ), $r ); - $l .= " ({$link})"; - } - $wgOut->addHTML( "<li>{$l}</li>\n" ); - } - wfFreeResult( $res ); - $wgOut->addHTML( "</ol>\n<p>{$sl}</p>\n" ); + $slu = new ListUsersPage(); + + return $slu->doQuery( $offset, $limit ); } ?> |