//
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
// 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();
}
}
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'];
}
}
// 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");
if ($result) {
$sql = "UPDATE ".$table_prefix."users SET password = '" . md5($admin_password) . "', email = ".db_escape($admin_email)." WHERE user_id = 'admin'";
db_query($sql, "could not update admin account");
- $sql = "UPDATE ".$table_prefix."company SET coy_name = ".db_escape($company_name)." WHERE coy_code = 1";
+ $sql = "UPDATE ".$table_prefix."sys_prefs SET value = ".db_escape($company_name)." WHERE name='coy_name'";
db_query($sql, "could not update company name. Do it manually later in Setup");
$err = write_config_db($table_prefix != "");
}
session_unset();
+session_regenerate_id();
session_destroy();
$_SESSION = array();
+
header("Location: ".$path_to_root."/index.php");
exit();