diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2012-05-03 13:01:35 +0200 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2012-05-03 13:01:35 +0200 |
commit | d9022f63880ce039446fba8364f68e656b7bf4cb (patch) | |
tree | 16b40fbf17bf7c9ee6f4ead25b16dd192378050a /includes/api/ApiMove.php | |
parent | 27cf83d177256813e2e802241085fce5dd0f3fb9 (diff) |
Update to MediaWiki 1.19.0
Diffstat (limited to 'includes/api/ApiMove.php')
-rw-r--r-- | includes/api/ApiMove.php | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/includes/api/ApiMove.php b/includes/api/ApiMove.php index a0b7bcbe..f0a25e4a 100644 --- a/includes/api/ApiMove.php +++ b/includes/api/ApiMove.php @@ -24,11 +24,6 @@ * @file */ -if ( !defined( 'MEDIAWIKI' ) ) { - // Eclipse helper - will be ignored in production - require_once( "ApiBase.php" ); -} - /** * API Module to move pages * @ingroup API @@ -40,7 +35,7 @@ class ApiMove extends ApiBase { } public function execute() { - global $wgUser; + $user = $this->getUser(); $params = $this->extractRequestParams(); if ( is_null( $params['reason'] ) ) { $params['reason'] = ''; @@ -75,9 +70,9 @@ class ApiMove extends ApiBase { && !RepoGroup::singleton()->getLocalRepo()->findFile( $toTitle ) && wfFindFile( $toTitle ) ) { - if ( !$params['ignorewarnings'] && $wgUser->isAllowed( 'reupload-shared' ) ) { + if ( !$params['ignorewarnings'] && $user->isAllowed( 'reupload-shared' ) ) { $this->dieUsageMsg( 'sharedfile-exists' ); - } elseif ( !$wgUser->isAllowed( 'reupload-shared' ) ) { + } elseif ( !$user->isAllowed( 'reupload-shared' ) ) { $this->dieUsageMsg( 'cantoverwrite-sharedfile' ); } } @@ -89,7 +84,7 @@ class ApiMove extends ApiBase { } $r = array( 'from' => $fromTitle->getPrefixedText(), 'to' => $toTitle->getPrefixedText(), 'reason' => $params['reason'] ); - if ( !$params['noredirect'] || !$wgUser->isAllowed( 'suppressredirect' ) ) { + if ( !$params['noredirect'] || !$user->isAllowed( 'suppressredirect' ) ) { $r['redirectcreated'] = ''; } @@ -254,7 +249,7 @@ class ApiMove extends ApiBase { return ''; } - protected function getExamples() { + public function getExamples() { return array( 'api.php?action=move&from=Exampel&to=Example&token=123ABC&reason=Misspelled%20title&movetalk=&noredirect=' ); |