Add a realname option to query=userinfo in the api.
authorDaniel Friesen <dantman@users.mediawiki.org>
Sat, 1 Jan 2011 17:38:15 +0000 (17:38 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Sat, 1 Jan 2011 17:38:15 +0000 (17:38 +0000)
RELEASE-NOTES
includes/api/ApiQueryUserInfo.php

index 6a200b5..62a1dca 100644 (file)
@@ -56,6 +56,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 14869) Add API module for accessing QueryPage-based special pages
 * (bug 14020) API for Special:Unwatchedpages
 * (bug 24287) Wrap API Help output at 100 characters
+* Add a realname uiprop option to query=userinfo so a user's realname can be extracted
 
 === Languages updated in 1.18 ===
 
index d2c07e4..112fbb3 100644 (file)
@@ -117,6 +117,10 @@ class ApiQueryUserInfo extends ApiQueryBase {
                        $vals['ratelimits'] = $this->getRateLimits();
                }
 
+               if ( isset( $this->prop['realname'] ) ) {
+                       $vals['realname'] = $wgUser->getRealName();
+               }
+
                if ( isset( $this->prop['email'] ) ) {
                        $vals['email'] = $wgUser->getEmail();
                        $auth = $wgUser->getEmailAuthenticationTimestamp();
@@ -189,6 +193,7 @@ class ApiQueryUserInfo extends ApiQueryBase {
                                        'editcount',
                                        'ratelimits',
                                        'email',
+                                       'realname',
                                        'acceptlang',
                                )
                        )
@@ -207,6 +212,7 @@ class ApiQueryUserInfo extends ApiQueryBase {
                                '  options          - Lists all preferences the current user has set',
                                '  editcount        - Adds the current user\'s edit count',
                                '  ratelimits       - Lists all rate limits applying to the current user',
+                               '  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',
                        )