$v <> '' test disables saving of integers that are = 0 (ex. $theme_default)
[squirrelmail.git] / plugins / administrator / options.php
index 1198c3551212801a4c84f868e5d7b00a91e2e45a..da4e46a105541db96c76c37f511cf5812642af36 100644 (file)
@@ -3,14 +3,19 @@
 /**
  * Administrator Plugin
  *
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 1999-2004 The SquirrelMail Project Team
  * Licensed under the GNU GPL. For full terms see the file COPYING.
  *
  * Philippe Mingo
  *
  * $Id$
+ * @package plugins
+ * @subpackage administrator
  */
 
+/**
+ * parse the config file
+ */
 function parseConfig( $cfg_file ) {
 
     global $newcfg;
@@ -195,6 +200,7 @@ function change_to_sm_path($old_path) {
 
 /* ---------------------- main -------------------------- */
 
+/** @ignore */
 define('SM_PATH','../../');
 
 /* SquirrelMail required files. */
@@ -567,7 +573,9 @@ if( $colapse['Group8'] == 'off' ) {
   }
 }
 echo "<tr bgcolor=\"$color[5]\"><th colspan=2><input value=\"" .
-     _("Change Settings") . "\" type=submit></th></tr>" ,
+     _("Change Settings") . '" type="submit"><br />'.
+     '<a href="'.SM_PATH.'src/configtest.php" target="_blank">'._("Test Configuration").
+     "</th></tr>\n" ,
      '</table></td></tr></table></form>';
 
 /*
@@ -584,14 +592,14 @@ if( $fp = @fopen( $cfgfile, 'w' ) ) {
     "global \$version;\n" );
 
     foreach ( $newcfg as $k => $v ) {
-        if ( $k{0} == '$' && $v <> '' ) {
+        if ( $k{0} == '$' && $v <> '' || is_int($v)) {
             if ( substr( $k, 1, 11 ) == 'ldap_server' ) {
                 $v = substr( $v, 0, strlen( $v ) - 1 ) . "\n)";
                 $v = str_replace( 'array(', "array(\n\t", $v );
                 $v = str_replace( "',", "',\n\t", $v );
             }
             fwrite( $fp, "$k = $v;\n" );
-        }
+       }
     }
     fwrite( $fp, '?>' );
     fclose( $fp );