From 5e68a08e09d4d2c3b1fe59fcce72cb15dbfcb210 Mon Sep 17 00:00:00 2001 From: tokul Date: Wed, 2 Aug 2006 18:05:33 +0000 Subject: [PATCH] loading default configuration before config.php in order to make sure that all variables are loaded. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11458 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 3 +++ config/conf.pl | 2 -- config/config_default.php | 8 +------- include/init.php | 19 +++++++++++++++++++ plugins/administrator/options.php | 2 -- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index c5a5eb63..812e6322 100644 --- a/ChangeLog +++ b/ChangeLog @@ -108,6 +108,9 @@ Version 1.5.2 - CVS of supported authentication mechanisms is disabled, if IO::Socket is not available. - Removed HTTP Status header from signout page (#1424748). + - config_default.php is loaded before site configuration file. + config_local.php overrides are removed from config.php and loaded by + main initiation script. Version 1.5.1 (branched on 2006-02-12) -------------------------------------- diff --git a/config/conf.pl b/config/conf.pl index c88aadbe..39860396 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -4203,8 +4203,6 @@ sub save_data { print CF "\$allow_remote_configtest = $allow_remote_configtest;\n"; print CF "\n"; - print CF "\@include SM_PATH . 'config/config_local.php';\n"; - close CF; print "Data saved in config.php\n"; diff --git a/config/config_default.php b/config/config_default.php index e3cf9e24..c6580e35 100644 --- a/config/config_default.php +++ b/config/config_default.php @@ -189,7 +189,7 @@ $sendmail_path = '/usr/sbin/sendmail'; * which does not support -t and -i arguments, set variable to empty string * or use arguments suitable for your mailer. * @global string $sendmail_args - * @since 1.5.1 + * @since 1.5.1 and 1.4.8 */ $sendmail_args = '-i -t'; @@ -1218,9 +1218,3 @@ $no_list_for_subscribe = false; * @global integer $config_use_color */ $config_use_color = 2; - -/** - * This option includes special configuration options - */ -@include SM_PATH . 'config/config_local.php'; - diff --git a/include/init.php b/include/init.php index b0331772..9610e493 100644 --- a/include/init.php +++ b/include/init.php @@ -134,7 +134,26 @@ $color[15] = '#002266'; /* (dark blue) Unselectable folders */ $color[16] = '#ff9933'; /* (orange) Highlight color */ require(SM_PATH . 'functions/global.php'); + +/* load default configuration */ +require(SM_PATH . 'config/config_default.php'); +/* reset arrays in default configuration */ +$ldap_server = array(); +$plugins = array(); +$fontsets = array(); +$theme = array(); +$theme[0]['PATH'] = SM_PATH . 'themes/default_theme.php'; +$theme[0]['NAME'] = 'Default'; +$aTemplateSet = array(); +$aTemplateSet[0]['PATH'] = SM_PATH . 'templates/default/'; +$aTemplateSet[0]['NAME'] = 'Default template'; +/* load site configuration */ require(SM_PATH . 'config/config.php'); +/* load local configuration overrides */ +if (file_exists(SM_PATH . 'config/config_local.php')) { + require(SM_PATH . 'config/config_local.php'); +} + require(SM_PATH . 'functions/plugin.php'); require(SM_PATH . 'include/constants.php'); require(SM_PATH . 'include/languages.php'); diff --git a/plugins/administrator/options.php b/plugins/administrator/options.php index 11367110..8e52f54b 100644 --- a/plugins/administrator/options.php +++ b/plugins/administrator/options.php @@ -636,8 +636,6 @@ if ( $fp = @fopen( $cfgfile, 'w' ) ) { fwrite( $fp, "$k = $v;\n" ); } } - // add local config support - fwrite( $fp, "@include SM_PATH . 'config/config_local.php';\n" ); // close php fwrite( $fp, '?>' ); fclose( $fp ); -- 2.25.1