mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-24 10:48:42 +00:00
Hooks: Support auto-enabling for auto-created accounts
Change-Id: Ibe1ba94e4478a637367b303b479586f45e85cfa4
This commit is contained in:
parent
43eb3493a8
commit
2429c5fcb2
|
@ -721,4 +721,23 @@ class VisualEditorHooks {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets user preference to enable the VisualEditor account for new auto-
|
||||
* created ('auth') accounts, if $wgVisualEditorAutoAccountEnable is set.
|
||||
*
|
||||
* To be removed once no longer needed.
|
||||
*/
|
||||
public static function onAuthPluginAutoCreate( $user ) {
|
||||
if (
|
||||
RequestContext::getMain()->getConfig()->get( 'VisualEditorAutoAccountEnable' ) &&
|
||||
$user->isLoggedin()
|
||||
) {
|
||||
$user->setOption( 'visualeditor-enable', 1 );
|
||||
$user->saveSettings();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -96,6 +96,7 @@
|
|||
"VisualEditorParsoidURL": "http://localhost:8000",
|
||||
"VisualEditorEnableSplitTest": false,
|
||||
"VisualEditorEnableTocWidget": false,
|
||||
"VisualEditorAutoAccountEnable": false,
|
||||
"VisualEditorNamespaces": [],
|
||||
"VisualEditorParsoidTimeout": 100
|
||||
},
|
||||
|
@ -170,6 +171,9 @@
|
|||
],
|
||||
"AddNewAccount": [
|
||||
"VisualEditorHooks::onAddNewAccount"
|
||||
],
|
||||
"AuthPluginAutoCreate": [
|
||||
"VisualEditorHooks::onAuthPluginAutoCreate"
|
||||
]
|
||||
},
|
||||
"ResourceModules": {
|
||||
|
|
Loading…
Reference in a new issue