Selaa lähdekoodia

loading default configuration before config.php in order to make sure
that all variables are loaded.

tokul 19 vuotta sitten
vanhempi
commit
3ab0b5eb63
5 muutettua tiedostoa jossa 23 lisäystä ja 11 poistoa
  1. 3 0
      ChangeLog
  2. 0 2
      config/conf.pl
  3. 1 7
      config/config_default.php
  4. 19 0
      include/init.php
  5. 0 2
      plugins/administrator/options.php

+ 3 - 0
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)
 --------------------------------------

+ 0 - 2
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";

+ 1 - 7
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';
-

+ 19 - 0
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');

+ 0 - 2
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 );