Index: trunk/extensions/InterfaceConcurrency/ApiConcurrency.php |
— | — | @@ -27,6 +27,24 @@ |
28 | 28 | } else { |
29 | 29 | $res['result'] = 'failure'; |
30 | 30 | } |
| 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 | + } |
31 | 49 | break; |
32 | 50 | |
33 | 51 | default: |