Followup r83390
authorSam Reed <reedy@users.mediawiki.org>
Sun, 6 Mar 2011 20:51:31 +0000 (20:51 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 6 Mar 2011 20:51:31 +0000 (20:51 +0000)
If the user is allowed to view hidden users, put a missing property on all users.

For list=users, do the same, but we can't easily distinguish to other people the difference between "hidden", or "missing", so no reason to do it

includes/api/ApiQueryAllUsers.php
includes/api/ApiQueryBase.php
includes/api/ApiQueryUsers.php

index 60a2d2c..6906aa2 100644 (file)
@@ -177,6 +177,9 @@ class ApiQueryAllUsers extends ApiQueryBase {
                                        $lastUserData['blockreason'] = $row->ipb_reason;
                                        $lastUserData['blockexpiry'] = $row->ipb_expiry;
                                }
+                               if ( $row->ipb_deleted ) {
+                                       $lastUserData['hidden'] = '';
+                               }
                                if ( $fld_editcount ) {
                                        $lastUserData['editcount'] = intval( $row->user_editcount );
                                }
index 72b109c..a6469ab 100644 (file)
@@ -483,6 +483,8 @@ abstract class ApiQueryBase extends ApiBase {
                                'ipblocks' => array( 'LEFT JOIN', 'ipb_user=user_id' ),
                        ) );
 
+                       $this->addFields( 'ipb_deleted' );
+
                        if ( $showBlockInfo ) {
                                $this->addFields( array( 'ipb_reason', 'ipb_by_text', 'ipb_expiry' ) );
                        }
index 5b68c8d..1137804 100644 (file)
@@ -161,7 +161,9 @@ class ApiQueryUsers extends ApiQueryBase {
                                                User::getGroupPermissions( array( $row->ug_group ) ) ) );
                                        $result->setIndexedTagName( $data[$name]['rights'], 'r' );
                                }
-
+                               if ( $row->ipb_deleted ) {
+                                       $data[$name]['hidden'] = '';
+                               }
                                if ( isset( $this->prop['blockinfo'] ) && !is_null( $row->ipb_by_text ) ) {
                                        $data[$name]['blockedby'] = $row->ipb_by_text;
                                        $data[$name]['blockreason'] = $row->ipb_reason;