Fixed error handling (removal of config.php after error).
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Tue, 1 Dec 2009 07:27:31 +0000 (07:27 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Tue, 1 Dec 2009 07:27:31 +0000 (07:27 +0000)
install/save.php

index b11263a3e3d2836ac75ae25fa4d495e9ecaeb1e8..801c2a1ab7a66902e22255c47d8558d4be743996 100644 (file)
@@ -53,6 +53,7 @@ function display_error($message)
                // Specify that session support is enabled
                $_SESSION['session_support'] = '<font class="good">Enabled</font>';
                // Redirect to first page again and exit
+               @unlink($path_to_root."/config.php"); // remove just created config file
                header('Location: index.php?sessions_checked=true');
                exit();
        }
@@ -295,9 +296,7 @@ if ($admin_password != $admin_repassword)
 }
 // End admin user details code
 
-if (!file_exists($path_to_root . "/config.php")) {
-       copy($path_to_root. "/config.default.php", $path_to_root. "/config.php");
-}
+copy($path_to_root. "/config.default.php", $path_to_root. "/config.php");
 
 include_once($path_to_root . "/includes/db/connect_db.inc");
 include_once($path_to_root . "/admin/db/maintenance_db.inc");