From 00f05947366b95a41aa9cd44a2b2131cbe32197a Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 10 Apr 2011 12:27:32 +0000 Subject: [PATCH] * (bug 28364) add registration date to meta=userinfo --- RELEASE-NOTES | 1 + includes/api/ApiQueryUserInfo.php | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 3d77893249..b4aca3eeec 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -328,6 +328,7 @@ PHP if you have not done so prior to upgrading MediaWiki. * (bug 28368) add hint for multipart/form-data to api information of action=import&xml= * (bug 28391) action=feedwatchlist&allrev should be a bool +* (bug 28364) add registration date to meta=userinfo === Languages updated in 1.18 === diff --git a/includes/api/ApiQueryUserInfo.php b/includes/api/ApiQueryUserInfo.php index f6e9bad530..452a0f6882 100644 --- a/includes/api/ApiQueryUserInfo.php +++ b/includes/api/ApiQueryUserInfo.php @@ -127,6 +127,13 @@ class ApiQueryUserInfo extends ApiQueryBase { } } + if ( isset( $this->prop['registrationdate'] ) ) { + $regDate = $wgUser->getRegistration(); + if ( $regDate !== false ) { + $vals['registrationdate'] = wfTimestamp( TS_ISO_8601, $regDate ); + } + } + if ( isset( $this->prop['acceptlang'] ) ) { $langs = $wgRequest->getAcceptLang(); $acceptLang = array(); @@ -193,6 +200,7 @@ class ApiQueryUserInfo extends ApiQueryBase { 'email', 'realname', 'acceptlang', + 'registrationdate' ) ) ); @@ -214,6 +222,7 @@ class ApiQueryUserInfo extends ApiQueryBase { ' realname - Adds the user\'s real name', ' email - Adds the user\'s email address and email authentication date', ' acceptlang - Echoes the Accept-Language header sent by the client in a structured format', + ' registrationdate - Adds the user\'s registration date', ) ); } -- 2.20.1