From 5f0d32b5e77fee07791309eb467c268c3d9ba6ae Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 9 Oct 2006 08:13:48 +0000 Subject: [PATCH] * (bug 7526) Make $wgDefaultUserOptions work again 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 | 1 + includes/DefaultSettings.php | 45 +++++++++++++++++++++++++++++++++++ includes/User.php | 46 ++---------------------------------- 3 files changed, 48 insertions(+), 44 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b74b2bf0d8..aa3a5841c9 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 7233a24b76..aa73ade84a 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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; diff --git a/includes/User.php b/includes/User.php index f6567b9494..aa964d227b 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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 -- 2.20.1