mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/Vector.git
synced 2024-11-23 23:33:54 +00:00
Don't set a user preference on new accounts by default
Make it possible for Vector to be a non-default skin. Only set a user preference on newly created accounts if that has been explicitly requested in config. This should have no effect on WMF production. Change-Id: I52f62cf7eb78d2be4c59821a3cf29da9619602d9
This commit is contained in:
parent
607f3279bd
commit
254ffbb55a
|
@ -449,6 +449,7 @@ class Hooks {
|
|||
*/
|
||||
public static function onLocalUserCreated( User $user, $isAutoCreated ) {
|
||||
$default = self::getConfig( Constants::CONFIG_KEY_DEFAULT_SKIN_VERSION_FOR_NEW_ACCOUNTS );
|
||||
if ( $default ) {
|
||||
$optionsManager = MediaWikiServices::getInstance()->getUserOptionsManager();
|
||||
$optionsManager->setOption(
|
||||
$user,
|
||||
|
@ -457,6 +458,7 @@ class Hooks {
|
|||
Constants::SKIN_NAME_LEGACY : Constants::SKIN_NAME_MODERN
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when OutputPage::headElement is creating the body tag to allow skins
|
||||
|
|
|
@ -411,8 +411,8 @@
|
|||
"description": "@var string:['2'|'1'] The version ('2' for latest, '1' for legacy) of the Vector skin to use when an existing user has not specified a preference. This configuration is not used for new accounts (see VectorDefaultSkinVersionForNewAccounts) and is impermanent. In the future, this field may contains versions such as \"beta\" which when specified and the BetaFeatures extension is installed, and the user is enrolled, the latest version is used otherwise legacy. The value is _not_ persisted."
|
||||
},
|
||||
"VectorDefaultSkinVersionForNewAccounts": {
|
||||
"value": "1",
|
||||
"description": "@var string:['2'|'1'] The version ('2' for latest, '1' for legacy) of the Vector skin to **set** for newly created user accounts. **The value is persisted as a user preference.** This configuration is not used for preexisting accounts (see VectorDefaultSkinVersionForExistingAccounts) and only ever executed once at new account creation time."
|
||||
"value": null,
|
||||
"description": "@var string|null The version ('2' for latest, '1' for legacy) of the Vector skin to **set** for newly created user accounts. **The value is persisted as a user preference.** This configuration is not used for preexisting accounts (see VectorDefaultSkinVersionForExistingAccounts) and only ever executed once at new account creation time. If it is null, no user preference will be set."
|
||||
},
|
||||
"VectorWvuiSearchOptions": {
|
||||
"value": {
|
||||
|
|
Loading…
Reference in a new issue