Do not allow a user to delete a page they can't edit
[lhc/web/wiklou.git] / includes / api / ApiSetNotificationTimestamp.php
index d5741d9..0433bc9 100644 (file)
@@ -46,6 +46,8 @@ class ApiSetNotificationTimestamp extends ApiBase {
                $params = $this->extractRequestParams();
                $this->requireMaxOneParameter( $params, 'timestamp', 'torevid', 'newerthanrevid' );
 
+               $this->getResult()->beginContinuation( $params['continue'], array(), array() );
+
                $pageSet = $this->getPageSet();
                if ( $params['entirewatchlist'] && $pageSet->getDataSource() !== null ) {
                        $this->dieUsage(
@@ -175,6 +177,8 @@ class ApiSetNotificationTimestamp extends ApiBase {
                        $apiResult->setIndexedTagName( $result, 'page' );
                }
                $apiResult->addValue( null, $this->getModuleName(), $result );
+
+               $apiResult->endContinuation();
        }
 
        /**
@@ -220,6 +224,7 @@ class ApiSetNotificationTimestamp extends ApiBase {
                        'newerthanrevid' => array(
                                ApiBase::PARAM_TYPE => 'integer'
                        ),
+                       'continue' => '',
                );
                if ( $flags ) {
                        $result += $this->getPageSet()->getFinalParams( $flags );
@@ -235,43 +240,7 @@ class ApiSetNotificationTimestamp extends ApiBase {
                        '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',
-               );
-       }
-
-       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
-                               )
-                       )
+                       'continue' => 'When more results are available, use this to continue',
                );
        }
 
@@ -283,25 +252,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'