Jforrester has uploaded a new change for review.
https://gerrit.wikimedia.org/r/71259
Change subject: Add ability to disable for anonymous users
......................................................................
Add ability to disable for anonymous users
This adds a new preference, $wgVisualEditorDisableForAnons, defaulted 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, 6 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor
refs/changes/59/71259/1
diff --git a/VisualEditor.hooks.php b/VisualEditor.hooks.php
index 0e5e0f5..80b3092 100644
--- a/VisualEditor.hooks.php
+++ b/VisualEditor.hooks.php
@@ -41,8 +41,11 @@
* @param $skin Skin
*/
public static function onBeforePageDisplay( &$output, &$skin ) {
- global $wgVisualEditorNamespaces,
$wgVisualEditorEnableEventLogging;
+ global $wgVisualEditorNamespaces,
$wgVisualEditorEnableEventLogging, $wgVisualEditorDisableForAnons;
if (
+ // BUG 50000: Disable for anonymous users if
$wgVisualEditorDisableForAnons is set
+ !( $wgVisualEditorDisableForAnons &&
$skin->getUser()->isAnon() ) &&
+
// BUG 47328: Disable on redirect pages until redirects
are editable
!$skin->getTitle()->isRedirect() &&
diff --git a/VisualEditor.php b/VisualEditor.php
index 55a0387..81f3e5e 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -24,6 +24,8 @@
$wgVisualEditorUseChangeTagging = true;
// Whether to log analytic events using EventLogging
$wgVisualEditorEnableEventLogging = false;
+// Whether to disable for not-logged-in users (if set to a site default of on)
+$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: newchange
Gerrit-Change-Id: I7418c7d96a79b17e717abfba1af8c5df3141e591
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits