X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiSetNotificationTimestamp.php;h=5d527fc79b1cbd47cb9e3ec0e1b01f7ce6b086b8;hb=50dee21f7a852e2cb4865b9ec83e272a25ab90c3;hp=04be450bb6a9fc98c9208e24bcb9f61e3cc24a9f;hpb=e054e34af8dcda9c454c8cb04caa0d55d0d3c5af;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiSetNotificationTimestamp.php b/includes/api/ApiSetNotificationTimestamp.php index 04be450bb6..5d527fc79b 100644 --- a/includes/api/ApiSetNotificationTimestamp.php +++ b/includes/api/ApiSetNotificationTimestamp.php @@ -202,11 +202,7 @@ class ApiSetNotificationTimestamp extends ApiBase { } public function needsToken() { - return true; - } - - public function getTokenSalt() { - return ''; + return 'csrf'; } public function getAllowedParams( $flags = 0 ) { @@ -214,7 +210,6 @@ class ApiSetNotificationTimestamp extends ApiBase { 'entirewatchlist' => array( ApiBase::PARAM_TYPE => 'boolean' ), - 'token' => null, 'timestamp' => array( ApiBase::PARAM_TYPE => 'timestamp' ), @@ -239,48 +234,10 @@ class ApiSetNotificationTimestamp extends ApiBase { 'timestamp' => 'Timestamp to which to set the notification timestamp', 'torevid' => 'Revision to set the notification timestamp to (one page only)', 'newerthanrevid' => 'Revision to set the notification timestamp newer than (one page only)', - 'token' => 'A token previously acquired via prop=info', 'continue' => 'When more results are available, use this to continue', ); } - public function getResultProperties() { - return array( - ApiBase::PROP_LIST => true, - ApiBase::PROP_ROOT => array( - 'notificationtimestamp' => array( - ApiBase::PROP_TYPE => 'timestamp', - ApiBase::PROP_NULLABLE => true - ) - ), - '' => array( - 'ns' => array( - ApiBase::PROP_TYPE => 'namespace', - ApiBase::PROP_NULLABLE => true - ), - 'title' => array( - ApiBase::PROP_TYPE => 'string', - ApiBase::PROP_NULLABLE => true - ), - 'pageid' => array( - ApiBase::PROP_TYPE => 'integer', - ApiBase::PROP_NULLABLE => true - ), - 'revid' => array( - ApiBase::PROP_TYPE => 'integer', - ApiBase::PROP_NULLABLE => true - ), - 'invalid' => 'boolean', - 'missing' => 'boolean', - 'notwatched' => 'boolean', - 'notificationtimestamp' => array( - ApiBase::PROP_TYPE => 'timestamp', - ApiBase::PROP_NULLABLE => true - ) - ) - ); - } - public function getDescription() { return array( 'Update the notification timestamp for watched pages.', 'This affects the highlighting of changed pages in the watchlist and history,', @@ -289,25 +246,6 @@ class ApiSetNotificationTimestamp extends ApiBase { ); } - public function getPossibleErrors() { - $ps = $this->getPageSet(); - - return array_merge( - parent::getPossibleErrors(), - $ps->getFinalPossibleErrors(), - $this->getRequireMaxOneParameterErrorMessages( - array( 'timestamp', 'torevid', 'newerthanrevid' ) ), - $this->getRequireOnlyOneParameterErrorMessages( - array_merge( array( 'entirewatchlist' ), array_keys( $ps->getFinalParams() ) ) ), - array( - array( 'code' => 'notloggedin', 'info' - => 'Anonymous users cannot use watchlist change notifications' ), - array( 'code' => 'multpages', 'info' => 'torevid may only be used with a single page' ), - array( 'code' => 'multpages', 'info' => 'newerthanrevid may only be used with a single page' ), - ) - ); - } - public function getExamples() { return array( 'api.php?action=setnotificationtimestamp&entirewatchlist=&token=123ABC'