SPQRobin has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/136520

Change subject: Require MediaWiki:Licenses to enable uploads (WMF)
......................................................................

Require MediaWiki:Licenses to enable uploads (WMF)

This change checks whether MediaWiki:Licenses has any text.
By default it does not, which means by default uploading is disabled.
To enable, the page needs to be simply created.

The advantage is that some or many small WMF wikis still do not have
license options, which is really needed for our copyright requirements.

A previous attempt in core was unwanted, see 
I465daaff4aed4b484a1f4707fe57d45c0e9ce6cd

Change-Id: I364f48f387d5987ba2b93e90ea6b2a3c5de1461d
---
M WikimediaMessages.php
M i18n/wikimedia/en.json
M i18n/wikimedia/qqq.json
3 files changed, 16 insertions(+), 2 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/WikimediaMessages 
refs/changes/20/136520/1

diff --git a/WikimediaMessages.php b/WikimediaMessages.php
index 26a78ed..7af66a6 100644
--- a/WikimediaMessages.php
+++ b/WikimediaMessages.php
@@ -126,3 +126,15 @@
        }
        return true;
 };
+
+/**
+ * Require the creation of MediaWiki:Licenses to enable uploading.
+ * This should prevent a lot of uploading without licenses on small wikis;
+ * some or many of the small WMF wikis do not have any license options,
+ * which is really needed for our copyright policy.
+ */
+$wgHooks['UploadForm:initial'][] = function() {
+       if ( wfMessage( 'licenses' )->isDisabled() ) {
+               throw new ErrorPageError( 'uploaddisabled', 
'wikimedia-upload-nolicenses' );
+       }
+}
diff --git a/i18n/wikimedia/en.json b/i18n/wikimedia/en.json
index de43fa4..cebae93 100644
--- a/i18n/wikimedia/en.json
+++ b/i18n/wikimedia/en.json
@@ -193,5 +193,6 @@
     "mwoauth-grant-checkuser": "Access checkuser data",
     "wikimedia-flow-terms-of-use-new-topic": "By clicking 
\"{{int:flow-newtopic-save}}\", you agree to our 
[//wikimediafoundation.org/wiki/Terms_of_use Terms of Use] and agree to 
irrevocably release your text under the 
[//creativecommons.org/licenses/by-sa/3.0 CC BY-SA 3.0 License] and 
[//en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License 
GFDL]",
     "wikimedia-flow-terms-of-use-reply": "By clicking 
\"{{int:flow-reply-submit}}\", you agree to our 
[//wikimediafoundation.org/wiki/Terms_of_use Terms of Use] and agree to 
irrevocably release your text under the 
[//creativecommons.org/licenses/by-sa/3.0 CC BY-SA 3.0 License] and 
[//en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License 
GFDL]",
-    "wikimedia-flow-terms-of-use-edit": "By saving changes, you agree to our 
[//wikimediafoundation.org/wiki/Terms_of_use Terms of Use] and agree to 
irrevocably release your text under the 
[//creativecommons.org/licenses/by-sa/3.0 CC BY-SA 3.0 License] and 
[//en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License 
GFDL]"
+    "wikimedia-flow-terms-of-use-edit": "By saving changes, you agree to our 
[//wikimediafoundation.org/wiki/Terms_of_use Terms of Use] and agree to 
irrevocably release your text under the 
[//creativecommons.org/licenses/by-sa/3.0 CC BY-SA 3.0 License] and 
[//en.wikipedia.org/wiki/Wikipedia:Text_of_the_GNU_Free_Documentation_License 
GFDL]",
+    "wikimedia-upload-nolicenses": "To be able to upload files through this 
special page, an administrator needs to add one or more license options to the 
page [[MediaWiki:Licenses]].\n\nUse the following format: <code>* Template 
name|Label</code>. Use any text to enable uploading without license options."
 }
diff --git a/i18n/wikimedia/qqq.json b/i18n/wikimedia/qqq.json
index 3c1a1c3..099515e 100644
--- a/i18n/wikimedia/qqq.json
+++ b/i18n/wikimedia/qqq.json
@@ -213,5 +213,6 @@
        "mwoauth-grant-checkuser": "Name for OAuth grant 
\"checkuser\".\n{{Related|Mwoauth-grant}}",
        "wikimedia-flow-terms-of-use-new-topic": "Terms of use and copyright 
warning shown when adding a new topic to a Flow board\n\nRefers to 
{{msg-mw|Flow-newtopic-save}}.",
        "wikimedia-flow-terms-of-use-reply": "Terms of use and copyright 
warning shown when adding a reply at a Flow board.\n\nRefers to 
{{msg-mw|Flow-reply-submit}}.",
-       "wikimedia-flow-terms-of-use-edit": "Terms of use and copyright warning 
shown when editing the header or an existing topic or message at a Flow board"
+       "wikimedia-flow-terms-of-use-edit": "Terms of use and copyright warning 
shown when editing the header or an existing topic or message at a Flow board",
+       "upload-nolicenses": "This error is shown on [[Special:Upload]] when no 
license options are configured on [[MediaWiki:Licenses]].\n\nSee also 
[[mw:Manual:Image administration]]."
 }

-- 
To view, visit https://gerrit.wikimedia.org/r/136520
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I364f48f387d5987ba2b93e90ea6b2a3c5de1461d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/WikimediaMessages
Gerrit-Branch: master
Gerrit-Owner: SPQRobin <robinp.1...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to