Skip to content

Commit

Permalink
Minor Changes (#6756)
Browse files Browse the repository at this point in the history
* Update installer to use magic __DIR__

* move setting default step to near top

* spacing

* move session start before text object creation
  • Loading branch information
frytimo committed Jun 17, 2023
1 parent cfda1ab commit 0dc9aaa
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions core/install/install.php
Original file line number Diff line number Diff line change
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

0 comments on commit 0dc9aaa

Please sign in to comment.