From: Kaldari Date: Mon, 30 Jul 2012 07:08:49 +0000 (-0700) Subject: Setting up a way to have uploading by URL, but not on Special:Upload X-Git-Tag: 1.31.0-rc.0~22517^2~1 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=8c6c29b3fc5db93c46bdd73b48f1ff5b4edad25c;p=lhc%2Fweb%2Fwiklou.git Setting up a way to have uploading by URL, but not on Special:Upload This is for the new Flickr uploading interface for UploadWizard Change-Id: Ifb1f612596cf83e8cea7204787bfc99e7b89547d --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index abf25dc376..410dc544ad 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -507,7 +507,7 @@ $wgSharedUploadDBprefix = ''; $wgCacheSharedUploads = true; /** - * Allow for upload to be copied from an URL. Requires Special:Upload?source=web + * Allow for upload to be copied from an URL. * The timeout for copy uploads is set by $wgHTTPTimeout. * You have to assign the user right 'upload_by_url' to a user group, to use this. */ @@ -524,6 +524,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; + /** * Max size for uploads, in bytes. If not set to an array, applies to all * uploads. If set to an array, per upload type maximums can be set, using the diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 3072408d3c..b8f150de6e 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -798,6 +798,8 @@ class UploadForm extends HTMLForm { * @return Array: descriptor array */ protected function getSourceSection() { + global $wgCopyUploadsFromSpecialUpload; + if ( $this->mSessionKey ) { return array( 'SessionKey' => array( @@ -811,7 +813,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' ) );