Minor bug in install/save.php
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 18 Mar 2009 13:59:23 +0000 (13:59 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 18 Mar 2009 13:59:23 +0000 (13:59 +0000)
CHANGELOG.txt
install/save.php

index 0d0ca15a742cfa7fe0f493b1e892dcae9f44d4ea..582a2e78173c57102580bbdad30ee9ec11de69ad 100644 (file)
@@ -29,6 +29,7 @@ $ config.php
 $ /.htaccess
   /install.html
   /install/index.php
+  /install/save.php
 
 16-Mar-2009 Janusz Dobrowolski
 # Fixed redirection after order cancelation.
index 69d8cfa170646757ea1552c64b2d76641d690d67..e832d87a8ae28d25c1028594a2f146ee5babad01 100644 (file)
@@ -343,14 +343,6 @@ $def_coy = $id;
 
 $config_filename = $path_to_root . '/config_db.php';
 
-$err = write_config_db($table_prefix != "");
-if ($err == -1)
-       display_error("Cannot open the configuration file ($config_filename)");
-else if ($err == -2)
-       display_error("Cannot write to the configuration file ($config_filename)");
-else if ($err == -3)
-       display_error("The configuration file $config_filename is not writable. Change its permissions so it is, then re-run step 4.");
-
 // Try connecting to database
 
 $db = mysql_connect($database_host, $database_username, $database_password);
@@ -359,6 +351,14 @@ if (!$db)
        display_error('Database host name, username and/or password incorrect. MySQL Error:<br />'.mysql_error());
 }
 
+$err = write_config_db($table_prefix != "");
+if ($err == -1)
+       display_error("Cannot open the configuration file ($config_filename)");
+else if ($err == -2)
+       display_error("Cannot write to the configuration file ($config_filename)");
+else if ($err == -3)
+       display_error("The configuration file $config_filename is not writable. Change its permissions so it is, then re-run step 4.");
+
 if($install_tables == true)
 {
        if (!mysql_select_db($database_name, $db))