X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiPatrol.php;h=45d19d0d3319135f875309c8bd8f9f2e8fdf0f65;hb=48523016ef0d4a3d15e7417dfb3048d34cac69f7;hp=461c2cdeebc03a008d3fd300ae920fa1acd7444d;hpb=1afd723c5bf8075e47b4e815fd4bc63023d9e5ea;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiPatrol.php b/includes/api/ApiPatrol.php index 461c2cdeeb..45d19d0d33 100644 --- a/includes/api/ApiPatrol.php +++ b/includes/api/ApiPatrol.php @@ -1,10 +1,9 @@ dieUsageMsg( array( 'nosuchrcid', $params['rcid'] ) ); } - $retval = RecentChange::markPatrolled( $params['rcid'] ); + $retval = $rc->doMarkPatrolled( $this->getUser() ); if ( $retval ) { $this->dieUsageMsg( reset( $retval ) ); @@ -58,6 +55,10 @@ class ApiPatrol extends ApiBase { $this->getResult()->addValue( null, $this->getModuleName(), $result ); } + public function mustBePosted() { + return true; + } + public function isWriteMode() { return true; } @@ -79,27 +80,44 @@ class ApiPatrol extends ApiBase { ); } + public function getResultProperties() { + return array( + '' => array( + 'rcid' => 'integer', + 'ns' => 'namespace', + 'title' => 'string' + ) + ); + } + public function getDescription() { return 'Patrol a page or revision'; } public function getPossibleErrors() { return array_merge( parent::getPossibleErrors(), array( - array( 'missingparam', 'rcid' ), array( 'nosuchrcid', 'rcid' ), ) ); } + public function needsToken() { + return true; + } + public function getTokenSalt() { - return ''; + return 'patrol'; } - protected function getExamples() { + public function getExamples() { return array( 'api.php?action=patrol&token=123abc&rcid=230672766' ); } + public function getHelpUrls() { + return 'https://www.mediawiki.org/wiki/API:Patrol'; + } + public function getVersion() { return __CLASS__ . ': $Id$'; }