X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryWatchlist.php;h=efbe05ee65482e2d334882ded8c491918b78d396;hb=f85ae83503058a8fdc7b69bd256fe14fe3821eea;hp=506fb591bd865ea25161e84c95b374ade10c318e;hpb=f69f2bc993bd6b735d4c5bebc977114a6b6ffff2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryWatchlist.php b/includes/api/ApiQueryWatchlist.php index 506fb591bd..efbe05ee65 100644 --- a/includes/api/ApiQueryWatchlist.php +++ b/includes/api/ApiQueryWatchlist.php @@ -224,7 +224,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { if ( !is_null( $params['user'] ) || !is_null( $params['excludeuser'] ) ) { if ( !$user->isAllowed( 'deletedhistory' ) ) { $bitmask = Revision::DELETED_USER; - } elseif ( !$user->isAllowed( 'suppressrevision' ) ) { + } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) { $bitmask = Revision::DELETED_USER | Revision::DELETED_RESTRICTED; } else { $bitmask = 0; @@ -238,7 +238,7 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { // entirely from the watchlist, or someone could guess the title. if ( !$user->isAllowed( 'deletedhistory' ) ) { $bitmask = LogPage::DELETED_ACTION; - } elseif ( !$user->isAllowed( 'suppressrevision' ) ) { + } elseif ( !$user->isAllowedAny( 'suppressrevision', 'viewsuppressed' ) ) { $bitmask = LogPage::DELETED_ACTION | LogPage::DELETED_RESTRICTED; } else { $bitmask = 0; @@ -561,109 +561,10 @@ class ApiQueryWatchlist extends ApiQueryGeneratorBase { ); } - public function getResultProperties() { - return array( - '' => array( - 'type' => array( - ApiBase::PROP_TYPE => array( - 'edit', - 'new', - 'move', - 'log', - 'move over redirect' - ) - ) - ), - 'ids' => array( - 'pageid' => 'integer', - 'revid' => 'integer', - 'old_revid' => 'integer' - ), - 'title' => array( - 'ns' => 'namespace', - 'title' => 'string' - ), - 'user' => array( - 'user' => 'string', - 'anon' => 'boolean' - ), - 'userid' => array( - 'userid' => 'integer', - 'anon' => 'boolean' - ), - 'flags' => array( - 'new' => 'boolean', - 'minor' => 'boolean', - 'bot' => 'boolean' - ), - 'patrol' => array( - 'patrolled' => 'boolean' - ), - 'timestamp' => array( - 'timestamp' => 'timestamp' - ), - 'sizes' => array( - 'oldlen' => 'integer', - 'newlen' => 'integer' - ), - 'notificationtimestamp' => array( - 'notificationtimestamp' => array( - ApiBase::PROP_TYPE => 'timestamp', - ApiBase::PROP_NULLABLE => true - ) - ), - 'comment' => array( - 'comment' => array( - ApiBase::PROP_TYPE => 'string', - ApiBase::PROP_NULLABLE => true - ) - ), - 'parsedcomment' => array( - 'parsedcomment' => array( - ApiBase::PROP_TYPE => 'string', - ApiBase::PROP_NULLABLE => true - ) - ), - 'loginfo' => array( - 'logid' => array( - ApiBase::PROP_TYPE => 'integer', - ApiBase::PROP_NULLABLE => true - ), - 'logtype' => array( - ApiBase::PROP_TYPE => $this->getConfig()->get( 'LogTypes' ), - ApiBase::PROP_NULLABLE => true - ), - 'logaction' => array( - ApiBase::PROP_TYPE => 'string', - ApiBase::PROP_NULLABLE => true - ) - ) - ); - } - public function getDescription() { return "Get all recent changes to pages in the logged in user's watchlist."; } - public function getPossibleErrors() { - return array_merge( parent::getPossibleErrors(), array( - array( 'code' => 'bad_wlowner', 'info' => 'Specified user does not exist' ), - array( - 'code' => 'bad_wltoken', - 'info' => 'Incorrect watchlist token provided -- ' . - 'please set a correct token in Special:Preferences' - ), - array( 'code' => 'notloggedin', 'info' => 'You must be logged-in to have a watchlist' ), - array( 'code' => 'patrol', 'info' => 'patrol property is not available' ), - array( 'show' ), - array( - 'code' => 'permissiondenied', - 'info' => 'You need the patrol right to request the patrolled flag' - ), - array( 'code' => 'user-excludeuser', 'info' => 'user and excludeuser cannot be used together' ), - ) ); - } - public function getExamples() { return array( 'api.php?action=query&list=watchlist',