r87206 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87205‎ | r87206 | r87207 >
Date:18:56, 1 May 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 26664) Add 'url' to meta=globaluserinfo and/or 'database' to action=sitematrix

Added URL parameter to output of meta=globaluserinfo
Modified paths:
  • /trunk/extensions/CentralAuth/ApiQueryGlobalUserInfo.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/ApiQueryGlobalUserInfo.php
@@ -78,8 +78,11 @@
7979 if ( $userExists && isset( $prop['merged'] ) ) {
8080 $accounts = $user->queryAttached();
8181 foreach ( $accounts as $account ) {
 82+ $dbname = $account['wiki'];
 83+
8284 $a = array(
83 - 'wiki' => $account['wiki'],
 85+ 'wiki' => $dbname,
 86+ 'url' => $this->getUrl( $dbname ),
8487 'timestamp' => wfTimestamp( TS_ISO_8601, $account['attachedTimestamp'] ),
8588 'method' => $account['attachedMethod'],
8689 'editcount' => $account['editCount']
@@ -113,6 +116,15 @@
114117 }
115118 }
116119
 120+ public function getUrl( $dbname ){
 121+ global $wgConf;
 122+
 123+ list( $major, $minor ) = $wgConf->siteFromDB( $dbname );
 124+ $minor = str_replace( '_', '-', $minor );
 125+ return $wgConf->get( 'wgServer', $dbname, $major,
 126+ array( 'lang' => $minor, 'site' => $major ) );
 127+ }
 128+
117129 public function getCacheMode( $params ) {
118130 if ( !is_null( $params['user'] ) ) {
119131 // URL determines user, public caching is fine

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87201* (bug 26664) Add 'url' to meta=globaluserinfo and/or 'database' to action=si...reedy18:24, 1 May 2011

Status & tagging log