From: Roan Kattouw Date: Thu, 4 Dec 2008 15:59:26 +0000 (+0000) Subject: API: (bug 16541) Adding block expiry timestamp to list=logevents output (calculated... X-Git-Tag: 1.31.0-rc.0~44124 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/?a=commitdiff_plain;h=8fc3724a4ac144e113beb70f18f25f2c2d56a610;p=lhc%2Fweb%2Fwiklou.git API: (bug 16541) Adding block expiry timestamp to list=logevents output (calculated from the block's timestamp and its duration) --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 2804408f4b..29e06410df 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -483,6 +483,7 @@ The following extensions are migrated into MediaWiki 1.14: * (bug 16526) Added usprop=emailable to list=users * (bug 16548) list=search threw errors with an invalid error code * (bug 16515) Added pst and onlypst parameters to action=parse +* (bug 16541) Added block expiry timestamp to list=logevents output === Languages updated in 1.14 === diff --git a/includes/api/ApiQueryLogEvents.php b/includes/api/ApiQueryLogEvents.php index 84bd15d6ec..beb2963e86 100644 --- a/includes/api/ApiQueryLogEvents.php +++ b/includes/api/ApiQueryLogEvents.php @@ -140,7 +140,7 @@ class ApiQueryLogEvents extends ApiQueryBase { $this->getResult()->addValue('query', $this->getModuleName(), $data); } - public static function addLogParams($result, &$vals, $params, $type) { + public static function addLogParams($result, &$vals, $params, $type, $ts) { $params = explode("\n", $params); switch ($type) { case 'move': @@ -169,6 +169,8 @@ class ApiQueryLogEvents extends ApiQueryBase { case 'block': $vals2 = array(); list( $vals2['duration'], $vals2['flags'] ) = $params; + $vals2['expiry'] = wfTimestamp(TS_ISO_8601, + strtotime($params[0], wfTimestamp(TS_UNIX, $ts))); $vals[$type] = $vals2; $params = null; break; @@ -200,7 +202,8 @@ class ApiQueryLogEvents extends ApiQueryBase { if ($this->fld_details && $row->log_params !== '') { self::addLogParams($this->getResult(), $vals, - $row->log_params, $row->log_type); + $row->log_params, $row->log_type, + $row->log_timestamp); } if ($this->fld_user) {