Merge "Revert "Adding sanity check to Title::isRedirect().""
[lhc/web/wiklou.git] / includes / api / ApiQueryUsers.php
index 76f815c..83872a5 100644 (file)
  * @file
  */
 
-if ( !defined( 'MEDIAWIKI' ) ) {
-       // Eclipse helper - will be ignored in production
-       require_once( 'ApiQueryBase.php' );
-}
-
 /**
  * Query module to get information about a list of users
  *
@@ -66,10 +61,10 @@ class ApiQueryUsers extends ApiQueryBase {
                return $this->tokenFunctions;
        }
 
-        /**
-         * @param $user User
-         * @return String
-         */
+       /**
+        * @param $user User
+        * @return String
+        */
        public static function getUserrightsToken( $user ) {
                global $wgUser;
                // Since the permissions check for userrights is non-trivial,
@@ -112,7 +107,7 @@ class ApiQueryUsers extends ApiQueryBase {
 
                if ( count( $goodNames ) ) {
                        $this->addTables( 'user' );
-                       $this->addFields( '*' );
+                       $this->addFields( User::selectFields() );
                        $this->addWhereFld( 'user_name', $goodNames );
 
                        if ( isset( $this->prop['groups'] ) || isset( $this->prop['rights'] ) ) {
@@ -170,7 +165,9 @@ class ApiQueryUsers extends ApiQueryBase {
                                        $data[$name]['hidden'] = '';
                                }
                                if ( isset( $this->prop['blockinfo'] ) && !is_null( $row->ipb_by_text ) ) {
+                                       $data[$name]['blockid'] = $row->ipb_id;
                                        $data[$name]['blockedby'] = $row->ipb_by_text;
+                                       $data[$name]['blockedbyid'] = $row->ipb_by;
                                        $data[$name]['blockreason'] = $row->ipb_reason;
                                        $data[$name]['blockexpiry'] = $row->ipb_expiry;
                                }
@@ -327,7 +324,7 @@ class ApiQueryUsers extends ApiQueryBase {
        }
 
        public function getHelpUrls() {
-               return 'http://www.mediawiki.org/wiki/API:Users';
+               return 'https://www.mediawiki.org/wiki/API:Users';
        }
 
        public function getVersion() {