* (bug 28364) add registration date to meta=userinfo
authorSam Reed <reedy@users.mediawiki.org>
Sun, 10 Apr 2011 12:27:32 +0000 (12:27 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 10 Apr 2011 12:27:32 +0000 (12:27 +0000)
RELEASE-NOTES
includes/api/ApiQueryUserInfo.php

index 3d77893..b4aca3e 100644 (file)
@@ -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 ===
 
index f6e9bad..452a0f6 100644 (file)
@@ -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',
                        )
                );
        }