One can disable it by setting `$wgForeignUploadTargets = [];`.
Change-Id: I2489004271078a78a1ce698304fb591196eeb941
is configurable via $wgSessionPbkdf2Iterations.
* Upload dialog's file upload log comment can now be configured separately for
local and foreign uploads.
+* $wgForeignUploadTargets now defaults to `[ 'local' ]`, where `'local'`
+ signifies local uploads. A value of `[]` (empty array) now means that
+ no upload targets are allowed, effectively disabling the upload dialog.
=== New features in 1.28 ===
* User::isBot() method for checking if an account is a bot role account.
* Array of foreign file repo names (set in $wgForeignFileRepos above) that
* are allowable upload targets. These wikis must have some method of
* authentication (i.e. CentralAuth), and be CORS-enabled for this wiki.
+ * The string 'local' signifies the default local file repository.
*
* Example:
* $wgForeignUploadTargets = array( 'shared' );
*/
-$wgForeignUploadTargets = [];
+$wgForeignUploadTargets = [ 'local' ];
/**
* Configuration for file uploads using the embeddable upload dialog
"upload-copy-upload-invalid-domain": "Copy uploads are not available from this domain.",
"upload-foreign-cant-upload": "This wiki is not configured to upload files to the requested foreign file repository.",
"upload-foreign-cant-load-config": "Loading file upload configuration for the foreign file repository failed.",
+ "upload-dialog-disabled": "File uploads using this dialog are disabled on this wiki.",
"upload-dialog-title": "Upload file",
"upload-dialog-button-cancel": "Cancel",
"upload-dialog-button-done": "Done",
"upload-copy-upload-invalid-domain": "Error message shown if a user is trying to upload (i.e. copy) a file from a website that is not in $wgCopyUploadsDomains (if set).\n\nSee also:\n* {{msg-mw|http-invalid-url}}\n* {{msg-mw|tmp-create-error}}\n* {{msg-mw|tmp-write-error}}",
"upload-foreign-cant-upload": "Error message shown when a user is trying to upload a file to foreign repository that is not configured to receive file uploads from current wiki.",
"upload-foreign-cant-load-config": "Error message shown when a user is trying to upload a file to foreign repository and the foreign wiki is down or otherwise unable to respond to API requests.",
+ "upload-dialog-disabled": "Message shown when the upload dialog functionality is disabled. (This doesn't mean that uploads in general are disabled, only this specific method of uploading.)",
"upload-dialog-title": "Title of the upload dialog box\n{{Identical|Upload file}}",
"upload-dialog-button-cancel": "Button to cancel the dialog\n{{Identical|Cancel}}",
"upload-dialog-button-done": "Button to close the dialog once upload is complete\n{{Identical|Done}}",
],
'messages' => [
'uploaddisabledtext',
+ 'upload-dialog-disabled',
'upload-foreign-cant-upload',
]
],
// However, if the target is a remote wiki, we must check the API
// to confirm that the target is one that this site is configured to
// support.
- if ( this.target === 'local' ) {
+ if ( validTargets.length === 0 ) {
+ this.apiPromise = $.Deferred().reject( 'upload-dialog-disabled' );
+ } else if ( this.target === 'local' ) {
// If local uploads were requested, but they are disabled, fail.
if ( !mw.config.get( 'wgEnableUploads' ) ) {
this.apiPromise = $.Deferred().reject( 'uploaddisabledtext' );