r49056 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49055‎ | r49056 | r49057 >
Date:03:48, 31 March 2009
Author:soxred93
Status:resolved (Comments)
Tags:
Comment:
Added usprop=gender to list=users
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryUsers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryUsers.php
@@ -145,6 +145,8 @@
146146 }
147147 if(isset($this->prop['emailable']) && $user->canReceiveEmail())
148148 $data[$name]['emailable'] = '';
 149+ if(isset($this->prop['gender']))
 150+ $data[$name]['gender'] = $user->getOption( 'gender' );
149151 if(!is_null($params['token']))
150152 {
151153 $tokenFunctions = $this->getTokenFunctions();
@@ -191,6 +193,7 @@
192194 'editcount',
193195 'registration',
194196 'emailable',
 197+ 'gender',
195198 )
196199 ),
197200 'users' => array(
@@ -212,6 +215,7 @@
213216 ' editcount - adds the user\'s edit count',
214217 ' registration - adds the user\'s registration timestamp',
215218 ' emailable - tags if the user can and wants to receive e-mail through [[Special:Emailuser]]',
 219+ ' gender - tags the gender of the user. Returns "male", "female", or "unknown"',
216220 ),
217221 'users' => 'A list of users to obtain the same information for',
218222 'token' => 'Which tokens to obtain for each user',
@@ -223,7 +227,7 @@
224228 }
225229
226230 protected function getExamples() {
227 - return 'api.php?action=query&list=users&ususers=brion|TimStarling&usprop=groups|editcount';
 231+ return 'api.php?action=query&list=users&ususers=brion|TimStarling&usprop=groups|editcount|gender';
228232 }
229233
230234 public function getVersion() {
Index: trunk/phase3/RELEASE-NOTES
@@ -364,6 +364,7 @@
365365 * (bug 18099) Using appendtext to edit a non-existent page causes an interface
366366 message to be included in the page text
367367 * Added uiprop=changeablegroups to meta=userinfo
 368+* Added usprop=gender to list=users
368369
369370 === Languages updated in 1.15 ===
370371

Follow-up revisions

RevisionCommit summaryAuthorDate
r51411Followup to r49056: gender property gives "unknown" when gender option is nulltstarling15:36, 3 June 2009

Comments

#Comment by Brion VIBBER (talk | contribs)   20:43, 18 May 2009

This returns "" for accounts which haven't selected a setting. Should it be normalized per the doc?

Status & tagging log