Scripts and data used for generating ZhConversion.php
[lhc/web/wiklou.git] / includes / SpecialListusers.php
index e74f2a2..c25da6b 100644 (file)
@@ -1,11 +1,23 @@
 <?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.
+/**
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
 
+/**
+ *
+ */
 require_once("QueryPage.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.
+ *
+ * @package MediaWiki
+ * @subpackage SpecialPage
+ */
 class ListUsersPage extends QueryPage {
 
        function getName() {
@@ -13,10 +25,12 @@ class ListUsersPage extends QueryPage {
        }
 
        function getSQL() {
-               global $wgIsPg;
-               $usertable = $wgIsPg?'"user"':'user';
+               $dbr =& wfGetDB( DB_SLAVE );
+               $user = $dbr->tableName( 'user' );
+               $user_rights = $dbr->tableName( 'user_rights' );
                $userspace = Namespace::getUser();
-               return "SELECT user_rights as type, $userspace as namespace, user_name as title, user_name as value FROM $usertable";
+               return "SELECT r.user_rights as type, $userspace as namespace, u.user_name as title, " .
+                       "u.user_name as value FROM $user u LEFT JOIN $user_rights r ON u.user_id = r.user_id";
        }
        
        function sortDescending() {
@@ -24,19 +38,22 @@ class ListUsersPage extends QueryPage {
        }
 
        function formatResult( $skin, $result ) {
-               global $wgLang;
-               $name = $skin->makeKnownLink( $wgLang->getNsText($result->namespace) . ':' . $result->title, $result->title );
+               global $wgContLang;
+               $name = $skin->makeLink( $wgContLang->getNsText($result->namespace) . ':' . $result->title, $result->title );
                if( '' != $result->type ) {
                        $name .= ' (' .
-                       $skin->makeKnownLink( wfMsg( "administrators" ), $result->type) .
+                       $skin->makeLink( wfMsgForContent( "administrators" ), $result->type) .
                        ')';
                }
                return $name;
        }
 }
 
+/**
+ * constructor
+ */
 function wfSpecialListusers() {
-       global $wgUser, $wgOut, $wgLang, $wgIsPg;
+       global $wgUser, $wgOut, $wgLang;
 
        list( $limit, $offset ) = wfCheckLimits();