X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=install%2Fsave.php;h=1e568b653d8d6a9f4a399fccb0f899d1bb1b4712;hb=85faf95991945b3f5c570e57e232562a1a137408;hp=acb8666bc4ee2ec94735985d67605226e8f5f8a6;hpb=ced4d3b728ed21cbefdd06210382b1e6127d14b1;p=fa-stable.git diff --git a/install/save.php b/install/save.php index acb8666b..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 @@ -264,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']; } @@ -379,24 +380,12 @@ if (!$db) display_error("The configuration file $config_filename is not writable. Change its permissions so it is, then re-run step 4."); } } -/* + session_unset(); +session_regenerate_id(); session_destroy(); $_SESSION = array(); -*/ -session_start(); -$_SESSION = array(); -// If it's desired to kill the session, also delete the session cookie. -// Note: This will destroy the session, and not just the session data! -if (ini_get("session.use_cookies")) { - $params = session_get_cookie_params(); - setcookie(session_name(), '', time() - 42000, - $params["path"], $params["domain"], - $params["secure"], $params["httponly"] - ); -} -// Finally, destroy the session. -session_destroy(); + header("Location: ".$path_to_root."/index.php"); exit();