r109671 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109670‎ | r109671 | r109672 >
Date:01:38, 21 January 2012
Author:bsitu
Status:ok
Tags:interfaceconcurrency 
Comment:
adding meta data for checkout
Modified paths:
  • /trunk/extensions/InterfaceConcurrency/ApiConcurrency.php (modified) (history)

Diff [purge]

Index: trunk/extensions/InterfaceConcurrency/ApiConcurrency.php
@@ -27,6 +27,24 @@
2828 } else {
2929 $res['result'] = 'failure';
3030 }
 31+
 32+ // data to be utilized by the caller for checkout
 33+ if ( $params['ccaction'] === 'checkout' ) {
 34+ $lastCheckout = $concurrencyCheck->checkoutResult();
 35+
 36+ if ( $res['result'] === 'success' ) {
 37+ $user = $wgUser;
 38+ }
 39+ else {
 40+ $user = User::newFromId( intval( $lastCheckout['userId'] ) );
 41+ }
 42+ if ( !$user->isAnon() ) {
 43+ $res['userid'] = $user->getId();
 44+ $res['username'] = $user->getName();
 45+ }
 46+
 47+ $res['expiration'] = $lastCheckout['expiration'];
 48+ }
3149 break;
3250
3351 default:

Status & tagging log