Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor Changes #6756

Merged
merged 6 commits into from Jun 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 19 additions & 8 deletions core/install/install.php
Expand Up @@ -25,7 +25,7 @@
*/

//set the include path
$document_root = substr(getcwd(), 0, strlen(getcwd()) - strlen('/core/install'));
$document_root = dirname(__DIR__, 2);
set_include_path($document_root);
$_SERVER["DOCUMENT_ROOT"] = $document_root;
$_SERVER["PROJECT_ROOT"] = $document_root;
Expand All @@ -37,19 +37,20 @@
//include required classes
require_once "resources/classes/text.php";
require_once "resources/classes/template.php";
require_once "resources/classes/message.php";
require_once "core/install/resources/classes/install.php";

//start the session before text object stores values in session
//ini_set("session.cookie_httponly", True);
session_start();

//add multi-lingual support
$language = new text;
$text = $language->get();

//set debug to true or false
$debug = false;

//start the session
//ini_set("session.cookie_httponly", True);
session_start();

//set the default domain_uuid
$domain_uuid = uuid();
//$_SESSION["domain_uuid"] = uuid();
Expand All @@ -64,7 +65,7 @@
//error reporting
ini_set('display_errors', '1');
//error_reporting (E_ALL); // Report everything
error_reporting (E_ALL ^ E_NOTICE); // Report everything
error_reporting (E_ALL ^ E_NOTICE); // Report warnings
//error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ); //hide notices and warnings

//set the default time zone
Expand All @@ -81,7 +82,10 @@
$config_exists = true;
}
if ($config_exists) {
$msg .= "Already Installed";
$msg = "Already Installed";
//report to user
message::add($msg);
//redirect with message
header("Location: ".PROJECT_PATH."/index.php?msg=".urlencode($msg));
exit;
}
Expand Down Expand Up @@ -332,6 +336,11 @@
$_SESSION['theme']['menu_brand_image']['text'] = PROJECT_PATH.'/themes/default/images/logo.png';
$_SESSION['theme']['menu_brand_type']['text'] = 'image';

//set a default step if not already set
if(empty($_REQUEST['step'])) {
$_REQUEST['step'] = '1';
}

//save an install log if debug is true
//if ($debug) {
// $fp = fopen(sys_get_temp_dir()."/install.log", "w");
Expand Down Expand Up @@ -359,6 +368,7 @@
$view->assign("database_port", "5432");
$view->assign("database_name", "fusionpbx");
$view->assign("database_username", "fusionpbx");
$view->assign("database_password", "fusionpbx");

//add translations
foreach($text as $key => $value) {
Expand All @@ -379,7 +389,8 @@
//if ($_GET["step"] == "" || $_GET["step"] == "1") {
// $content = $view->render('language.htm');
//}
if ($_REQUEST["step"] == "" || $_REQUEST["step"] == "1") {

if ($_REQUEST["step"] == "1") {
$content = $view->render('configuration.htm');
}
if ($_REQUEST["step"] == "2") {
Expand Down