API: (bug 17626) Added uiprop=email to meta=userinfo
authorRoan Kattouw <catrope@users.mediawiki.org>
Mon, 23 Feb 2009 13:34:29 +0000 (13:34 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Mon, 23 Feb 2009 13:34:29 +0000 (13:34 +0000)
RELEASE-NOTES
includes/api/ApiQueryUserInfo.php

index a9d613f..4378242 100644 (file)
@@ -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 ===
 
index 6a02f6c..9ab8874 100644 (file)
@@ -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',
                                )
                        )
                );