From aea7a5a482b9e0ff84ca21acbe2f31f5ceea2cea Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 6 Mar 2011 20:51:31 +0000 Subject: [PATCH] Followup r83390 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 | 3 +++ includes/api/ApiQueryBase.php | 2 ++ includes/api/ApiQueryUsers.php | 4 +++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/api/ApiQueryAllUsers.php b/includes/api/ApiQueryAllUsers.php index 60a2d2cc59..6906aa260a 100644 --- a/includes/api/ApiQueryAllUsers.php +++ b/includes/api/ApiQueryAllUsers.php @@ -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 ); } diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index 72b109c425..a6469ab5ab 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -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' ) ); } diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php index 5b68c8dfc9..11378047e3 100644 --- a/includes/api/ApiQueryUsers.php +++ b/includes/api/ApiQueryUsers.php @@ -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; -- 2.20.1