From 77653c7df3f19641b558d4edf45fb42f3b9101af Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 21 Nov 2004 07:51:41 +0000 Subject: [PATCH] (bug 924) $wgDefaultUserOptions to set the preference defaults from LocalSettings --- includes/DefaultSettings.php | 11 ++++++++++- includes/User.php | 5 ++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 1d5c0fb7fe..70643b7f3e 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -694,9 +694,18 @@ $wgTidyBin = 'tidy'; $wgTidyConf = $IP.'/extensions/tidy/tidy.conf'; $wgTidyOpts = ''; -# See list of skins and their symbolic names in language/Language.php +# See list of skins and their symbolic names in languagel/Language.php $wgDefaultSkin = 'monobook'; +# Settings added to this array will override the language globals for +# the user preferences used by anonymous visitors and newly created +# accounts. (See names and sample values in languages/Language.php) +# +# For instance, to disable section editing links: +# $wgDefaultUserOptions['editsection'] = 0; +# +$wgDefaultUserOptions = array(); + # Whether or not to allow real name fields. Defaults to true. $wgAllowRealName = true; diff --git a/includes/User.php b/includes/User.php index b6f4238f1a..6402b576f6 100644 --- a/includes/User.php +++ b/includes/User.php @@ -169,7 +169,10 @@ class User { */ function loadDefaultFromLanguage(){ global $wgContLang; - $defOpt = $wgContLang->getDefaultUserOptions() ; + global $wgDefaultUserOptions; + + # Site defaults will override the global/language defaults + $defOpt = $wgDefaultUserOptions + $wgContLang->getDefaultUserOptions(); foreach ( $defOpt as $oname => $val ) { $this->mOptions[$oname] = $val; } -- 2.20.1