diff --git a/resources/install.php b/resources/install.php index 63ca60110f..5680e4162d 100644 --- a/resources/install.php +++ b/resources/install.php @@ -47,17 +47,10 @@ require_once "resources/functions.php"; //set the default time zone date_default_timezone_set('UTC'); -//get the domain - $domain_array = explode(":", $_SERVER["HTTP_HOST"]); - $domain_name = $domain_array[0]; - //if the config file exists then disable the install page $config_exists = false; if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) { $config_exists = true; - } elseif (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) { - //original directory - $config_exists = true; } elseif (file_exists("/etc/fusionpbx/config.php")) { //linux $config_exists = true; @@ -86,6 +79,7 @@ require_once "resources/functions.php"; $db_host = $_POST["db_host"]; $db_port = $_POST["db_port"]; $db_name = $_POST["db_name"]; + $domain_name = $_POST["domain_name"]; $db_username = $_POST["db_username"]; $db_password = $_POST["db_password"]; $db_create_username = $_POST["db_create_username"]; @@ -98,6 +92,12 @@ require_once "resources/functions.php"; $install_default_country = $_POST["install_default_country"]; $install_template_name = $_POST["install_template_name"]; + if(!$domain_name){ + //get the domain + $domain_array = explode(":", $_SERVER["HTTP_HOST"]); + $domain_name = $domain_array[0]; + } + //clean up the values if (strlen($install_switch_base_dir) > 0) { $install_switch_base_dir = realpath($install_switch_base_dir); @@ -813,7 +813,7 @@ if ($_POST["install_step"] == "3" && count($_POST) > 0 && strlen($_POST["persist else { $filename = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH.'/resources/install/sql/mysql.sql'; } - $file_contents = file_get_contents($filename); + $file_contents = file_get_contents($filename); //replace \r\n with \n then explode on \n $file_contents = str_replace("\r\n", "\n", $file_contents); @@ -1236,7 +1236,7 @@ if ($_POST["install_step"] == "3" && count($_POST) > 0 && strlen($_POST["persist $db->exec(check_sql($sql)); unset($sql); - //add the menu items + //add the menu items require_once "resources/classes/menu.php"; $menu = new menu; $menu->db = $db; @@ -1764,6 +1764,17 @@ EOL; echo " \n"; echo " \n"; + echo "\n"; + echo "\n"; + echo " Domain name\n"; + echo "\n"; + echo "\n"; + echo "
\n"; + echo " Enter the default domain name. \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo " \n"; echo " \n"; echo " \n"; @@ -1816,6 +1827,7 @@ EOL; echo " \n"; echo " \n"; echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; @@ -1931,6 +1943,7 @@ EOL; echo " \n"; echo " \n"; echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n"; @@ -2044,6 +2057,7 @@ EOL; echo " \n"; echo " \n"; echo " \n"; + echo " \n"; echo " \n"; echo " \n"; echo " \n";