From decfd47c11129bc5e8d9883da90701e5f27b2428 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 23 Feb 2009 13:34:29 +0000 Subject: [PATCH] API: (bug 17626) Added uiprop=email to meta=userinfo --- RELEASE-NOTES | 1 + includes/api/ApiQueryUserInfo.php | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a9d613fccb..437824214a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -254,6 +254,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 17502) meta=siteinfo&siprop=namespacealiases no longer lists namespace aliases already listed in siprop=namespaces * (bug 17529) rvend ignored when rvstartid is specified +* (bug 17626) Added uiprop=email to list=userinfo === Languages updated in 1.15 === diff --git a/includes/api/ApiQueryUserInfo.php b/includes/api/ApiQueryUserInfo.php index 6a02f6ceb8..9ab88746ba 100644 --- a/includes/api/ApiQueryUserInfo.php +++ b/includes/api/ApiQueryUserInfo.php @@ -92,6 +92,12 @@ class ApiQueryUserInfo extends ApiQueryBase { if (isset($this->prop['ratelimits'])) { $vals['ratelimits'] = $this->getRateLimits(); } + if (isset($this->prop['email'])) { + $vals['email'] = $wgUser->getEmail(); + $auth = $wgUser->getEmailAuthenticationTimestamp(); + if(!is_null($auth)) + $vals['emailauthenticated'] = wfTimestamp(TS_ISO_8601, $auth); + } return $vals; } @@ -141,7 +147,8 @@ class ApiQueryUserInfo extends ApiQueryBase { 'options', 'preferencestoken', 'editcount', - 'ratelimits' + 'ratelimits', + 'email', ) ) ); -- 2.20.1