X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryUserContributions.php;h=4b167b8b7a5804c7d495d775f29b565405fe5da1;hb=2bd577d312ddfc1c97afd62794f240eb3129ebfb;hp=5f93071fd2d9abf4b39c0c2a9b2b431ff2ff7c6a;hpb=aaeb2033c92a4dc9a675488ee4036da78307d5ac;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 5f93071fd2..4b167b8b7a 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -193,7 +193,7 @@ class ApiQueryContributions extends ApiQueryBase { // see the username. 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; @@ -224,6 +224,7 @@ class ApiQueryContributions extends ApiQueryBase { $show = $this->params['show']; if ( $this->params['toponly'] ) { // deprecated/old param + $this->logFeatureUsage( 'list=usercontribs&uctoponly' ); $show[] = 'top'; } if ( !is_null( $show ) ) { @@ -555,81 +556,10 @@ class ApiQueryContributions extends ApiQueryBase { ); } - public function getResultProperties() { - return array( - '' => array( - 'userid' => 'integer', - 'user' => 'string', - 'userhidden' => 'boolean' - ), - 'ids' => array( - 'pageid' => 'integer', - 'revid' => 'integer', - 'parentid' => array( - ApiBase::PROP_TYPE => 'integer', - ApiBase::PROP_NULLABLE => true - ) - ), - 'title' => array( - 'ns' => 'namespace', - 'title' => 'string' - ), - 'timestamp' => array( - 'timestamp' => 'timestamp' - ), - 'flags' => array( - 'new' => 'boolean', - 'minor' => 'boolean', - 'top' => 'boolean' - ), - 'comment' => array( - 'commenthidden' => 'boolean', - 'comment' => array( - ApiBase::PROP_TYPE => 'string', - ApiBase::PROP_NULLABLE => true - ) - ), - 'parsedcomment' => array( - 'commenthidden' => 'boolean', - 'parsedcomment' => array( - ApiBase::PROP_TYPE => 'string', - ApiBase::PROP_NULLABLE => true - ) - ), - 'patrolled' => array( - 'patrolled' => 'boolean' - ), - 'size' => array( - 'size' => array( - ApiBase::PROP_TYPE => 'integer', - ApiBase::PROP_NULLABLE => true - ) - ), - 'sizediff' => array( - 'sizediff' => array( - ApiBase::PROP_TYPE => 'integer', - ApiBase::PROP_NULLABLE => true - ) - ) - ); - } - public function getDescription() { return 'Get all edits by a user.'; } - public function getPossibleErrors() { - return array_merge( parent::getPossibleErrors(), array( - array( 'code' => 'param_user', 'info' => 'User parameter may not be empty.' ), - array( 'code' => 'param_user', 'info' => 'User name user is not valid' ), - array( 'show' ), - array( - 'code' => 'permissiondenied', - 'info' => 'You need the patrol right to request the patrolled flag' - ), - ) ); - } - public function getExamples() { return array( 'api.php?action=query&list=usercontribs&ucuser=YurikBot',