(bug 924) $wgDefaultUserOptions to set the preference defaults from LocalSettings
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 21 Nov 2004 07:51:41 +0000 (07:51 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 21 Nov 2004 07:51:41 +0000 (07:51 +0000)
includes/DefaultSettings.php
includes/User.php

index 1d5c0fb..70643b7 100644 (file)
@@ -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;
 
index b6f4238..6402b57 100644 (file)
@@ -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;
                }