reinstating Change Ifb1f6125...
authorKaldari <rkaldari@wikimedia.org>
Thu, 18 Oct 2012 00:25:52 +0000 (17:25 -0700)
committerKaldari <rkaldari@wikimedia.org>
Thu, 18 Oct 2012 00:25:52 +0000 (17:25 -0700)
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
includes/specials/SpecialUpload.php

index 2e1e82f..23e12f3 100644 (file)
@@ -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
index a15fdd2..19e5362 100644 (file)
@@ -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' ) );