diff --git a/webadmin/setup.php b/webadmin/setup.php index 960a034659cc55d301bdc0ad62cec9a819f21fbe..379c7a89d28a2baf8cfa0a03a84a242cc1a04023 100755 --- a/webadmin/setup.php +++ b/webadmin/setup.php @@ -1,19 +1,24 @@ <?php +$output_filename = "index.html"; + if (isset($_POST['setup'])) { - $my_username = htmlspecialchars($_POST['my_username']); - $default_domain_name = htmlspecialchars($_POST['default_domain_name']); + if(file_exists("setup_confirm.html")) { + $my_username = htmlspecialchars($_POST['my_username']); + $default_domain_name = htmlspecialchars($_POST['default_domain_name']); - if(!file_exists(".temp_setup.txt")) { - $setup_file = fopen(".temp_setup.txt", "w") or die("Unable to create setup file"); - fwrite($setup_file, $my_username.",".$default_domain_name."\n"); - fclose($); - } + if(!file_exists(".temp_setup.txt")) { + $setup_file = fopen(".temp_setup.txt", "w") or die("Unable to create setup file"); + fwrite($setup_file, $my_username.",".$default_domain_name."\n"); + fclose($); + } - $output_filename = "setup_installing.html"; - $htmlfile = fopen("$output_filename", "r") or die("Unable to open $output_filename"); - echo fread($htmlfile,filesize("$output_filename")); - fclose($htmlfile); + $output_filename = "setup_confirm.html"; + } } +$htmlfile = fopen("$output_filename", "r") or die("Unable to open $output_filename"); +echo fread($htmlfile,filesize("$output_filename")); +fclose($htmlfile); + ?>