From e774395b544788147b9bd089accb0c6e3da84fe4 Mon Sep 17 00:00:00 2001 From: X! Date: Tue, 31 Mar 2009 03:48:08 +0000 Subject: [PATCH] Added usprop=gender to list=users --- RELEASE-NOTES | 1 + includes/api/ApiQueryUsers.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d369ac0c3e..7494d12cb7 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -364,6 +364,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 18099) Using appendtext to edit a non-existent page causes an interface message to be included in the page text * Added uiprop=changeablegroups to meta=userinfo +* Added usprop=gender to list=users === Languages updated in 1.15 === diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php index 9f51c75705..23d0ae73c9 100644 --- a/includes/api/ApiQueryUsers.php +++ b/includes/api/ApiQueryUsers.php @@ -145,6 +145,8 @@ if (!defined('MEDIAWIKI')) { } if(isset($this->prop['emailable']) && $user->canReceiveEmail()) $data[$name]['emailable'] = ''; + if(isset($this->prop['gender'])) + $data[$name]['gender'] = $user->getOption( 'gender' ); if(!is_null($params['token'])) { $tokenFunctions = $this->getTokenFunctions(); @@ -191,6 +193,7 @@ if (!defined('MEDIAWIKI')) { 'editcount', 'registration', 'emailable', + 'gender', ) ), 'users' => array( @@ -212,6 +215,7 @@ if (!defined('MEDIAWIKI')) { ' editcount - adds the user\'s edit count', ' registration - adds the user\'s registration timestamp', ' emailable - tags if the user can and wants to receive e-mail through [[Special:Emailuser]]', + ' gender - tags the gender of the user. Returns "male", "female", or "unknown"', ), 'users' => 'A list of users to obtain the same information for', 'token' => 'Which tokens to obtain for each user', @@ -223,7 +227,7 @@ if (!defined('MEDIAWIKI')) { } protected function getExamples() { - return 'api.php?action=query&list=users&ususers=brion|TimStarling&usprop=groups|editcount'; + return 'api.php?action=query&list=users&ususers=brion|TimStarling&usprop=groups|editcount|gender'; } public function getVersion() { -- 2.20.1