r79433 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79432‎ | r79433 | r79434 >
Date:17:38, 1 January 2011
Author:dantman
Status:ok (Comments)
Tags:
Comment:
Add a realname option to query=userinfo in the api.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryUserInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryUserInfo.php
@@ -117,6 +117,10 @@
118118 $vals['ratelimits'] = $this->getRateLimits();
119119 }
120120
 121+ if ( isset( $this->prop['realname'] ) ) {
 122+ $vals['realname'] = $wgUser->getRealName();
 123+ }
 124+
121125 if ( isset( $this->prop['email'] ) ) {
122126 $vals['email'] = $wgUser->getEmail();
123127 $auth = $wgUser->getEmailAuthenticationTimestamp();
@@ -189,6 +193,7 @@
190194 'editcount',
191195 'ratelimits',
192196 'email',
 197+ 'realname',
193198 'acceptlang',
194199 )
195200 )
@@ -207,6 +212,7 @@
208213 ' options - Lists all preferences the current user has set',
209214 ' editcount - Adds the current user\'s edit count',
210215 ' ratelimits - Lists all rate limits applying to the current user',
 216+ ' realname - Adds the user\'s real name',
211217 ' email - Adds the user\'s email address and email authentication date',
212218 ' acceptlang - Echoes the Accept-Language header sent by the client in a structured format',
213219 )
Index: trunk/phase3/RELEASE-NOTES
@@ -56,6 +56,7 @@
5757 * (bug 14869) Add API module for accessing QueryPage-based special pages
5858 * (bug 14020) API for Special:Unwatchedpages
5959 * (bug 24287) Wrap API Help output at 100 characters
 60+* Add a realname uiprop option to query=userinfo so a user's realname can be extracted
6061
6162 === Languages updated in 1.18 ===
6263

Follow-up revisions

RevisionCommit summaryAuthorDate
r84893Followup r79433, hide realname from output when realnames are a hidden pref.dantman03:25, 28 March 2011

Comments

#Comment by Hashar (talk | contribs)   20:59, 25 March 2011

realname should be hidden if it is in $wgHiddenPrefs

Maybe User->getRealName() should be changed to take care of $wgHiddenPrefs.

#Comment by Dantman (talk | contribs)   03:27, 28 March 2011

Done in r84893. However it was too much hassle to make the api not list the realname uiprop when disabled. It would have made a real mess of the api module.

Status & tagging log