jenkins-bot has submitted this change and it was merged.

Change subject: Add ability to disable for anonymous users
......................................................................


Add ability to disable for anonymous users

This adds a new config variable, $wgVisualEditorDisableForAnons,
defaulting to 'false', which disables VisualEditor for not-logged-in
users. This only makes sense where the visualeditor-enable setting is
set to 'on' for all users; it will be used but briefly.

Bug: 50000
Change-Id: I7418c7d96a79b17e717abfba1af8c5df3141e591
---
M VisualEditor.hooks.php
M VisualEditor.php
2 files changed, 12 insertions(+), 2 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index 0e5e0f5..527550b 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -41,9 +41,15 @@
         * @param $skin Skin
         */
        public static function onBeforePageDisplay( &$output, &$skin ) {
-               global $wgVisualEditorNamespaces, 
$wgVisualEditorEnableEventLogging;
+               global $wgVisualEditorNamespaces, 
$wgVisualEditorEnableEventLogging,
+                       $wgVisualEditorDisableForAnons;
+
                if (
-                       // BUG 47328: Disable on redirect pages until redirects 
are editable
+                       // Bug 50000: Allow disabling for anonymous users 
separately from changing
+                       // the default preference
+                       !( $wgVisualEditorDisableForAnons && 
$skin->getUser()->isAnon() ) &&
+
+                       // Bug 47328: Disable on redirect pages until redirects 
are editable
                        !$skin->getTitle()->isRedirect() &&
 
                        // User has the 'visualeditor-enable' preference set
diff --git a/VisualEditor.php b/VisualEditor.php
index 55a0387..f044545 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -24,6 +24,10 @@
 $wgVisualEditorUseChangeTagging = true;
 // Whether to log analytic events using EventLogging
 $wgVisualEditorEnableEventLogging = false;
+// Whether to disable for logged-in users
+// This allows you to enable the 'visualeditor-enable' preference by default
+// but still disable VE for logged-out users (by setting this to false).
+$wgVisualEditorDisableForAnons = false;
 // Whether to enable incomplete experimental code
 $wgVisualEditorEnableExperimentalCode = false;
 // Whether to use the 'add' or 'replace' tabLayout

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7418c7d96a79b17e717abfba1af8c5df3141e591
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to