<?php
-
/**
- * Created on Oct 16, 2006
*
- * API for MediaWiki 1.8+
+ *
+ * Created on Oct 16, 2006
*
* Copyright © 2006 Yuri Astrakhan <Firstname><Lastname>@gmail.com
*
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
*/
if ( !defined( 'MEDIAWIKI' ) ) {
parent::__construct( $query, $moduleName, 'uc' );
}
- private $params, $username;
+ private $params, $prefixMode, $userprefix, $multiUserMode, $usernames;
private $fld_ids = false, $fld_title = false, $fld_timestamp = false,
$fld_comment = false, $fld_parsedcomment = false, $fld_flags = false,
- $fld_patrolled = false, $fld_tags = false;
+ $fld_patrolled = false, $fld_tags = false, $fld_size = false;
public function execute() {
// Parse some parameters
// TODO: if the query is going only against the revision table, should this be done?
$this->selectNamedDB( 'contributions', DB_SLAVE, 'contributions' );
- $db = $this->getDB();
if ( isset( $this->params['userprefix'] ) ) {
$this->prefixMode = true;
);
}
- // Make sure private data (deleted revisions) isn't cached
- $this->getMain()->setVaryCookie();
if ( !$wgUser->isAllowed( 'hideuser' ) ) {
$this->addWhere( $this->getDB()->bitAnd( 'rev_deleted', Revision::DELETED_USER ) . ' = 0' );
}
if ( !is_null( $show ) ) {
$show = array_flip( $show );
if ( ( isset( $show['minor'] ) && isset( $show['!minor'] ) )
- || ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) ) )
- {
+ || ( isset( $show['patrolled'] ) && isset( $show['!patrolled'] ) ) ) {
$this->dieUsageMsg( array( 'show' ) );
}
'rev_timestamp',
'page_namespace',
'page_title',
+ 'rev_user',
'rev_user_text',
'rev_deleted'
) );
if ( isset( $show['patrolled'] ) || isset( $show['!patrolled'] ) ||
- $this->fld_patrolled )
- {
- global $wgUser;
- // Don't cache private data
- $this->getMain()->setVaryCookie();
+ $this->fld_patrolled ) {
if ( !$wgUser->useRCPatrol() && !$wgUser->useNPPatrol() ) {
$this->dieUsage( 'You need the patrol right to request the patrolled flag', 'permissiondenied' );
}
-
+
// Use a redundant join condition on both
// timestamp and ID so we can use the timestamp
// index
private function extractRowInfo( $row ) {
$vals = array();
+ $vals['userid'] = $row->rev_user;
$vals['user'] = $row->rev_user_text;
if ( $row->rev_deleted & Revision::DELETED_USER ) {
$vals['userhidden'] = '';
wfTimestamp( TS_ISO_8601, $row->rev_timestamp );
}
+ public function getCacheMode( $params ) {
+ // This module provides access to deleted revisions and patrol flags if
+ // the requester is logged in
+ return 'anon-public-user-private';
+ }
+
public function getAllowedParams() {
return array(
'limit' => array(
'namespace' => 'Only list contributions in these namespaces',
'prop' => array(
'Include additional pieces of information',
- ' ids - Adds the page id and revision id',
- ' title - Adds the title and namespace id of the page',
+ ' ids - Adds the page ID and revision ID',
+ ' title - Adds the title and namespace ID of the page',
' timestamp - Adds the timestamp of the edit',
' comment - Adds the comment of the edit',
' parsedcomment - Adds the parsed comment of the edit',