$fld_token = isset( $prop['token'] );
$fld_tags = isset( $prop['tags'] );
+ if ( isset( $prop['token'] ) ) {
+ $p = $this->getModulePrefix();
+ $this->setWarning(
+ "{$p}prop=token has been deprecated. Please use action=query&meta=tokens instead."
+ );
+ }
+
// If we're in JSON callback mode, no tokens can be obtained
if ( !is_null( $this->getMain()->getRequest()->getVal( 'callback' ) ) ) {
$fld_token = false;
// check it again just in case)
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;
' len - Adds the length (bytes) of the revision',
' sha1 - Adds the SHA-1 (base 16) of the revision',
' content - Adds the content of the revision',
- ' token - Gives the edit token',
+ ' token - DEPRECATED! Gives the edit token',
' tags - Tags for the revision',
),
'namespace' => 'Only list pages in this namespace (3)',
);
}
- public function getResultProperties() {
- return array(
- '' => array(
- 'ns' => 'namespace',
- 'title' => 'string'
- ),
- 'token' => array(
- 'token' => 'string'
- )
- );
- }
-
public function getDescription() {
$p = $this->getModulePrefix();
);
}
- public function getPossibleErrors() {
- return array_merge( parent::getPossibleErrors(), array(
- array(
- 'code' => 'permissiondenied',
- 'info' => 'You don\'t have permission to view deleted revision information'
- ),
- array( 'code' => 'badparams', 'info' => 'user and excludeuser cannot be used together'
- ),
- array(
- 'code' => 'permissiondenied',
- 'info' => 'You don\'t have permission to view deleted revision content'
- ),
- array( 'code' => 'badparams', 'info' => "The 'from' parameter cannot be used in modes 1 or 2" ),
- array( 'code' => 'badparams', 'info' => "The 'to' parameter cannot be used in modes 1 or 2" ),
- array(
- 'code' => 'badparams',
- 'info' => "The 'prefix' parameter cannot be used in modes 1 or 2"
- ),
- array( 'code' => 'badparams', 'info' => "The 'start' parameter cannot be used in mode 3" ),
- array( 'code' => 'badparams', 'info' => "The 'end' parameter cannot be used in mode 3" ),
- ) );
- }
-
public function getExamples() {
return array(
'api.php?action=query&list=deletedrevs&titles=Main%20Page|Talk:Main%20Page&' .