From: tassium Date: Mon, 11 Nov 2002 16:40:29 +0000 (+0000) Subject: Added support for local override file (config_local.php) which gets appended to the... X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3d01b82385904c8d8f355794b63afd86e47710fb;p=squirrelmail.git Added support for local override file (config_local.php) which gets appended to the end of config.php when conf.pl saves it. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@4135 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/config/conf.pl b/config/conf.pl index f0ee8f82..0cc305ee 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -2657,29 +2657,37 @@ sub save_data { # string print CF "\$prefs_val_field = '$prefs_val_field';\n"; # boolean - print CF "\$no_list_for_subscribe = $no_list_for_subscribe;\n"; + print CF "\$no_list_for_subscribe = $no_list_for_subscribe;\n"; # string - print CF "\$smtp_auth_mech = '$smtp_auth_mech';\n"; - print CF "\$imap_auth_mech = '$imap_auth_mech';\n"; + print CF "\$smtp_auth_mech = '$smtp_auth_mech';\n"; + print CF "\$imap_auth_mech = '$imap_auth_mech';\n"; # boolean - print CF "\$use_imap_tls = $use_imap_tls;\n"; - print CF "\$use_smtp_tls = $use_smtp_tls;\n"; - - print CF "\n"; - - print CF "/**\n"; - print CF " * Make sure there are no characters after the PHP closing\n"; - print CF " * tag below (including newline characters and whitespace).\n"; - print CF " * Otherwise, that character will cause the headers to be\n"; - print CF " * sent and regular output to begin, which will majorly screw\n"; - print CF " * things up when we try to send more headers later.\n"; - print CF " */\n"; - print CF "?>"; - - close CF; + print CF "\$use_imap_tls = $use_imap_tls;\n"; + print CF "\$use_smtp_tls = $use_smtp_tls;\n"; + + print CF "\n"; + + if ( open(LOCAL,"config_local.php") ) { + # A config_local.php file exists - add it to the bottom of config.php + while ( $line = ) { + print CF $line; + } + close LOCAL; + } + + print CF "\n/**\n"; + print CF " * Make sure there are no characters after the PHP closing\n"; + print CF " * tag below (including newline characters and whitespace).\n"; + print CF " * Otherwise, that character will cause the headers to be\n"; + print CF " * sent and regular output to begin, which will majorly screw\n"; + print CF " * things up when we try to send more headers later.\n"; + print CF " */\n"; + print CF "?>"; + + close CF; - print "Data saved in config.php\n"; + print "Data saved in config.php\n"; } else { print "Error saving config.php: $!\n"; }