From: Kaldari Date: Thu, 18 Oct 2012 00:25:52 +0000 (-0700) Subject: reinstating Change Ifb1f6125... X-Git-Tag: 1.31.0-rc.0~21972^2 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/supprimer.php?a=commitdiff_plain;h=18fabfaa3e6a34b7d8a2b53deed0e4c637b203f8;p=lhc%2Fweb%2Fwiklou.git 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 --- 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' ) );