From 18fabfaa3e6a34b7d8a2b53deed0e4c637b203f8 Mon Sep 17 00:00:00 2001 From: Kaldari Date: Wed, 17 Oct 2012 17:25:52 -0700 Subject: [PATCH] reinstating Change Ifb1f6125... A setting to have uploading by URL, but not on Special:Upload. Reverted this out when I thought we were going to be able to support more widespread URL uploading, but currently, it is only reliable for some domains, so although we can theoretically support the new Flickr interface in UploadWizard, it probably isn't reliable enough to add general URL uploading from Special:Upload. Change-Id: I66b287bf173a4ea0b23f43180505d4c7de5acb26 --- includes/DefaultSettings.php | 7 +++++++ includes/specials/SpecialUpload.php | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 2e1e82f517..23e12f37f0 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -530,6 +530,13 @@ $wgAllowAsyncCopyUploads = false; */ $wgCopyUploadsDomains = array(); +/** + * Enable copy uploads from Special:Upload. $wgAllowCopyUploads must also be + * true. If $wgAllowCopyUploads is true, but this is false, you will only be + * able to perform copy uploads from the API or extensions (e.g. UploadWizard). + */ +$wgCopyUploadsFromSpecialUpload = false; + /** * Proxy to use for copy upload requests. * @since 1.20 diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index a15fdd20bd..19e536298d 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -790,6 +790,8 @@ class UploadForm extends HTMLForm { * @return Array: descriptor array */ protected function getSourceSection() { + global $wgCopyUploadsFromSpecialUpload; + if ( $this->mSessionKey ) { return array( 'SessionKey' => array( @@ -803,7 +805,9 @@ class UploadForm extends HTMLForm { ); } - $canUploadByUrl = UploadFromUrl::isEnabled() && UploadFromUrl::isAllowed( $this->getUser() ); + $canUploadByUrl = UploadFromUrl::isEnabled() + && UploadFromUrl::isAllowed( $this->getUser() ) + && $wgCopyUploadsFromSpecialUpload; $radio = $canUploadByUrl; $selectedSourceType = strtolower( $this->getRequest()->getText( 'wpSourceType', 'File' ) ); -- 2.20.1