API: Add timestamp of block to blockinfo
This change affects list=allusers, list=users and meta=userinfo. Note: This change also add block expiry to meta=userinfo. Unlike this field in other modules, it formats the timestamp properly, instead of just dumping db contents. Resurrecting from abandoned change Ifdeac5c5f547 Bug: 63326 Change-Id: I4b3e55fe2d07271e1ded89d36d0b98de0e643177
This commit is contained in:
parent
b82a8a080a
commit
d87164e91a
5 changed files with 9 additions and 1 deletions
|
|
@ -256,6 +256,8 @@ production.
|
|||
* New action ClearHasMsg that can be used to clear HasMsg flag.
|
||||
* The cmstartsortkey and cmendsortkey parameters to list=categorymembers are
|
||||
deprecated in favor of cmstarthexsortkey and cmendhexsortkey.
|
||||
* (bug 63326) Add blockedtimestamp field to output of blockinfo property for
|
||||
the list=allusers and list=users modules.
|
||||
|
||||
=== Action API internal changes in 1.24 ===
|
||||
* Methods for handling continuation are added to ApiResult, so actions other
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ class ApiQueryAllUsers extends ApiQueryBase {
|
|||
$lastUserData['blockid'] = $row->ipb_id;
|
||||
$lastUserData['blockedby'] = $row->ipb_by_text;
|
||||
$lastUserData['blockedbyid'] = $row->ipb_by;
|
||||
$lastUserData['blockedtimestamp'] = wfTimestamp( TS_ISO_8601, $row->ipb_timestamp );
|
||||
$lastUserData['blockreason'] = $row->ipb_reason;
|
||||
$lastUserData['blockexpiry'] = $row->ipb_expiry;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -414,7 +414,7 @@ abstract class ApiQueryBase extends ApiBase {
|
|||
$this->addFields( 'ipb_deleted' );
|
||||
|
||||
if ( $showBlockInfo ) {
|
||||
$this->addFields( array( 'ipb_id', 'ipb_by', 'ipb_by_text', 'ipb_reason', 'ipb_expiry' ) );
|
||||
$this->addFields( array( 'ipb_id', 'ipb_by', 'ipb_by_text', 'ipb_reason', 'ipb_expiry', 'ipb_timestamp' ) );
|
||||
}
|
||||
|
||||
// Don't show hidden names
|
||||
|
|
|
|||
|
|
@ -69,6 +69,10 @@ class ApiQueryUserInfo extends ApiQueryBase {
|
|||
$vals['blockedby'] = $block->getByName();
|
||||
$vals['blockedbyid'] = $block->getBy();
|
||||
$vals['blockreason'] = $user->blockedFor();
|
||||
$vals['blockedtimestamp'] = wfTimestamp( TS_ISO_8601, $block->mTimestamp );
|
||||
$vals['blockexpiry'] = $block->getExpiry() === 'infinity'
|
||||
? 'infinite'
|
||||
: wfTimestamp( TS_ISO_8601, $block->getExpiry() );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -195,6 +195,7 @@ class ApiQueryUsers extends ApiQueryBase {
|
|||
$data[$name]['blockid'] = $row->ipb_id;
|
||||
$data[$name]['blockedby'] = $row->ipb_by_text;
|
||||
$data[$name]['blockedbyid'] = $row->ipb_by;
|
||||
$data[$name]['blockedtimestamp'] = wfTimestamp( TS_ISO_8601, $row->ipb_timestamp );
|
||||
$data[$name]['blockreason'] = $row->ipb_reason;
|
||||
$data[$name]['blockexpiry'] = $row->ipb_expiry;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue