X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=install%2Fsave.php;h=1e568b653d8d6a9f4a399fccb0f899d1bb1b4712;hb=2198319ddf12a9c3b286a2400aa15d2e72d82b06;hp=b11263a3e3d2836ac75ae25fa4d495e9ecaeb1e8;hpb=ebc600101ceab69c06eac4b1bd4d1782af45de05;p=fa-stable.git diff --git a/install/save.php b/install/save.php index b11263a3..1e568b65 100644 --- a/install/save.php +++ b/install/save.php @@ -27,7 +27,8 @@ if (!function_exists("_")) { // function display_error($message) { - global $_POST; + global $_POST, $path_to_root; + if(isset($message) AND $message != '') { // Copy values entered into session so user doesn't have to re-enter everything @@ -53,6 +54,7 @@ function display_error($message) // Specify that session support is enabled $_SESSION['session_support'] = 'Enabled'; // 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(); } @@ -263,7 +265,7 @@ if (!isset($_POST['admin_email']) || $_POST['admin_email'] == '') } else { - if (eregi("^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$", $_POST['admin_email'])) + if (preg_match("/^([0-9a-zA-Z]+[-._+&])*[0-9a-zA-Z]+@([-0-9a-zA-Z]+[.])+[a-zA-Z]{2,6}$/i", $_POST['admin_email'])) { $admin_email = $_POST['admin_email']; } @@ -295,9 +297,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"); @@ -382,8 +382,10 @@ if (!$db) } session_unset(); +session_regenerate_id(); session_destroy(); $_SESSION = array(); + header("Location: ".$path_to_root."/index.php"); exit();