* (bug 7526) Make $wgDefaultUserOptions work again
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 9 Oct 2006 08:13:48 +0000 (08:13 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 9 Oct 2006 08:13:48 +0000 (08:13 +0000)
The globals for preference default overrides was removed in r15823,
when the defaults were moved from Language to User. Moved the settings
out to the global where they arguably belong, restoring compatibility
for site-specific overrides.

RELEASE-NOTES
includes/DefaultSettings.php
includes/User.php

index b74b2bf..aa3a584 100644 (file)
@@ -276,6 +276,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Fix regression in Special:Watchlist text header
 * (bug 7510) Update article counts etc on undelete
 * (bug 7520) Update article counts on XML import
+* (bug 7526) Make $wgDefaultUserOptions work again
 
 
 == Languages updated ==
index 7233a24..aa73ade 100644 (file)
@@ -1564,6 +1564,51 @@ $wgTidyInternal = function_exists( 'tidy_load_config' );
 /** See list of skins and their symbolic names in languages/Language.php */
 $wgDefaultSkin = 'monobook';
 
+/**
+ * Settings added to this array will override the default globals for the user
+ * preferences used by anonymous visitors and newly created accounts.
+ * For instance, to disable section editing links:
+ *  $wgDefaultUserOptions ['editsection'] = 0;
+ *
+ */
+$wgDefaultUserOptions = array( 
+       'quickbar'              => 1,
+       'underline'             => 2,
+       'cols'                  => 80,
+       'rows'                  => 25,
+       'searchlimit'           => 20,
+       'contextlines'          => 5,
+       'contextchars'          => 50,
+       'skin'                  => false,
+       'math'                  => 1,
+       'rcdays'                => 7,
+       'rclimit'               => 50,
+       'wllimit'               => 250,
+       'highlightbroken'       => 1,
+       'stubthreshold'         => 0,
+       'previewontop'          => 1,
+       'editsection'           => 1,
+       'editsectiononrightclick'=> 0,
+       'showtoc'               => 1,
+       'showtoolbar'           => 1,
+       'date'                  => 'default',
+       'imagesize'             => 2,
+       'thumbsize'             => 2,
+       'rememberpassword'      => 0,
+       'enotifwatchlistpages'  => 0,
+       'enotifusertalkpages'   => 1,
+       'enotifminoredits'      => 0,
+       'enotifrevealaddr'      => 0,
+       'shownumberswatching'   => 1,
+       'fancysig'              => 0,
+       'externaleditor'        => 0,
+       'externaldiff'          => 0,
+       'showjumplinks'         => 1,
+       'numberheadings'        => 0,
+       'uselivepreview'        => 0,
+       'watchlistdays'         => 3.0,
+);
+
 /** Whether or not to allow and use real name fields. Defaults to true. */
 $wgAllowRealName = true;
 
index f6567b9..aa964d2 100644 (file)
@@ -46,48 +46,6 @@ class User {
        var $mVersion;          //!< serialized version
        /**@}} */
 
-       /**
-        * Default user options
-        * To change this array at runtime, use a UserDefaultOptions hook
-        */
-       static public $mDefaultOptions = array( 
-               'quickbar'              => 1,
-               'underline'             => 2,
-               'cols'                  => 80,
-               'rows'                  => 25,
-               'searchlimit'           => 20,
-               'contextlines'          => 5,
-               'contextchars'          => 50,
-               'skin'                  => false,
-               'math'                  => 1,
-               'rcdays'                => 7,
-               'rclimit'               => 50,
-               'wllimit'               => 250,
-               'highlightbroken'       => 1,
-               'stubthreshold'         => 0,
-               'previewontop'          => 1,
-               'editsection'           => 1,
-               'editsectiononrightclick'=> 0,
-               'showtoc'               => 1,
-               'showtoolbar'           => 1,
-               'date'                  => 'default',
-               'imagesize'             => 2,
-               'thumbsize'             => 2,
-               'rememberpassword'      => 0,
-               'enotifwatchlistpages'  => 0,
-               'enotifusertalkpages'   => 1,
-               'enotifminoredits'      => 0,
-               'enotifrevealaddr'      => 0,
-               'shownumberswatching'   => 1,
-               'fancysig'              => 0,
-               'externaleditor'        => 0,
-               'externaldiff'          => 0,
-               'showjumplinks'         => 1,
-               'numberheadings'        => 0,
-               'uselivepreview'        => 0,
-               'watchlistdays'         => 3.0,
-       );
-
        static public $mToggles = array(
                'highlightbroken',
                'justify',
@@ -502,8 +460,8 @@ class User {
                /**
                 * Site defaults will override the global/language defaults
                 */
-               global $wgContLang;
-               $defOpt = self::$mDefaultOptions + $wgContLang->getDefaultUserOptionOverrides();
+               global $wgDefaultUserOptions, $wgContLang;
+               $defOpt = $wgDefaultUserOptions + $wgContLang->getDefaultUserOptionOverrides();
 
                /**
                 * default language setting