mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2025-12-30 00:53:50 +00:00
Update the install.php
- Updated to work with latest changes - Updated a few setting defaults
This commit is contained in:
@@ -336,8 +336,8 @@
|
|||||||
}
|
}
|
||||||
echo " <td class='center'>";
|
echo " <td class='center'>";
|
||||||
switch ($row['call_block_direction']) {
|
switch ($row['call_block_direction']) {
|
||||||
case "inbound": echo "<img src='/themes/".$settings->get('domain', 'template')."/images/icon_cdr_inbound_answered.png' style='border: none;' title='".$text['label-inbound']."'>\n"; break;
|
case "inbound": echo "<img src='/themes/".$settings->get('domain', 'template', 'default')."/images/icon_cdr_inbound_answered.png' style='border: none;' title='".$text['label-inbound']."'>\n"; break;
|
||||||
case "outbound": echo "<img src='/themes/".$settings->get('domain', 'template')."/images/icon_cdr_outbound_answered.png' style='border: none;' title='".$text['label-outbound']."'>\n"; break;
|
case "outbound": echo "<img src='/themes/".$settings->get('domain', 'template', 'default')."/images/icon_cdr_outbound_answered.png' style='border: none;' title='".$text['label-outbound']."'>\n"; break;
|
||||||
}
|
}
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
echo " <td class='center'>";
|
echo " <td class='center'>";
|
||||||
|
|||||||
@@ -697,10 +697,10 @@ if (permission_exists('call_block_all') || permission_exists('call_block_ring_gr
|
|||||||
echo " <input type='hidden' name='xml_cdrs[$x][uuid]' value='".escape($row['xml_cdr_uuid'])."' />\n";
|
echo " <input type='hidden' name='xml_cdrs[$x][uuid]' value='".escape($row['xml_cdr_uuid'])."' />\n";
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
if (
|
if (
|
||||||
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$settings->get('domain', 'template')."/images/icon_cdr_inbound_voicemail.png") &&
|
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$settings->get('domain', 'template', 'default')."/images/icon_cdr_inbound_voicemail.png") &&
|
||||||
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$settings->get('domain', 'template')."/images/icon_cdr_inbound_answered.png") &&
|
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$settings->get('domain', 'template', 'default')."/images/icon_cdr_inbound_answered.png") &&
|
||||||
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$settings->get('domain', 'template')."/images/icon_cdr_outbound_failed.png") &&
|
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$settings->get('domain', 'template', 'default')."/images/icon_cdr_outbound_failed.png") &&
|
||||||
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$settings->get('domain', 'template')."/images/icon_cdr_outbound_answered.png")
|
file_exists($_SERVER["DOCUMENT_ROOT"]."/themes/".$settings->get('domain', 'template', 'default')."/images/icon_cdr_outbound_answered.png")
|
||||||
) {
|
) {
|
||||||
$title_mod = null;
|
$title_mod = null;
|
||||||
echo " <td class='center' ".$list_row_onclick_toggle.">";
|
echo " <td class='center' ".$list_row_onclick_toggle.">";
|
||||||
@@ -713,7 +713,7 @@ if (permission_exists('call_block_all') || permission_exists('call_block_ring_gr
|
|||||||
else {
|
else {
|
||||||
$file_mod = "_answered";
|
$file_mod = "_answered";
|
||||||
}
|
}
|
||||||
echo "<img src='/themes/".$settings->get('domain', 'template')."/images/icon_cdr_inbound".$file_mod.".png' style='border: none;' title='".$text['label-inbound'].$title_mod."'>\n";
|
echo "<img src='/themes/".$settings->get('domain', 'template', 'default')."/images/icon_cdr_inbound".$file_mod.".png' style='border: none;' title='".$text['label-inbound'].$title_mod."'>\n";
|
||||||
break;
|
break;
|
||||||
case "outbound":
|
case "outbound":
|
||||||
if ($row['billsec'] == 0) {
|
if ($row['billsec'] == 0) {
|
||||||
@@ -723,7 +723,7 @@ if (permission_exists('call_block_all') || permission_exists('call_block_ring_gr
|
|||||||
else {
|
else {
|
||||||
$file_mod = "_answered";
|
$file_mod = "_answered";
|
||||||
}
|
}
|
||||||
echo "<img src='/themes/".$settings->get('domain', 'template')."/images/icon_cdr_outbound".$file_mod.".png' style='border: none;' title='".$text['label-outbound'].$title_mod."'>\n";
|
echo "<img src='/themes/".$settings->get('domain', 'template', 'default')."/images/icon_cdr_outbound".$file_mod.".png' style='border: none;' title='".$text['label-outbound'].$title_mod."'>\n";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
$text = $language->get();
|
$text = $language->get();
|
||||||
|
|
||||||
//include theme config for button images
|
//include theme config for button images
|
||||||
include_once("themes/".$settings->get('domain', 'template')."/config.php");
|
include_once("themes/".$settings->get('domain', 'template', 'default')."/config.php");
|
||||||
|
|
||||||
//show the list
|
//show the list
|
||||||
$switch_cmd = 'fifo list';
|
$switch_cmd = 'fifo list';
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
$widget_label = $text['label-'.$widget_key] ?? $widget_name;
|
$widget_label = $text['label-'.$widget_key] ?? $widget_name;
|
||||||
|
|
||||||
//used for missed and recent calls
|
//used for missed and recent calls
|
||||||
$theme_image_path = $_SERVER["DOCUMENT_ROOT"]."/themes/".$settings->get('domain', 'template')."/images/";
|
$theme_image_path = $_SERVER["DOCUMENT_ROOT"]."/themes/".$settings->get('domain', 'template', 'default')."/images/";
|
||||||
|
|
||||||
//voicemail
|
//voicemail
|
||||||
echo "<div class='hud_box'>\n";
|
echo "<div class='hud_box'>\n";
|
||||||
|
|||||||
@@ -202,7 +202,7 @@
|
|||||||
if ($theme_cdr_images_exist) {
|
if ($theme_cdr_images_exist) {
|
||||||
$call_result = $row['status'];
|
$call_result = $row['status'];
|
||||||
if (isset($row['direction'])) {
|
if (isset($row['direction'])) {
|
||||||
echo " <img src='".PROJECT_PATH."/themes/".$settings->get('domain', 'template')."/images/icon_cdr_".$row['direction']."_".$call_result.".png' width='16' style='border: none;' title='".$text['label-'.$row['direction']].": ".$text['label-'.$call_result]."'>\n";
|
echo " <img src='".PROJECT_PATH."/themes/".$settings->get('domain', 'template', 'default')."/images/icon_cdr_".$row['direction']."_".$call_result.".png' width='16' style='border: none;' title='".$text['label-'.$row['direction']].": ".$text['label-'.$call_result]."'>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
|
|||||||
@@ -221,7 +221,7 @@
|
|||||||
if ($theme_cdr_images_exist) {
|
if ($theme_cdr_images_exist) {
|
||||||
$call_result = $row['status'];
|
$call_result = $row['status'];
|
||||||
if (isset($row['direction'])) {
|
if (isset($row['direction'])) {
|
||||||
echo "<img src='".PROJECT_PATH."/themes/".$settings->get('domain', 'template')."/images/icon_cdr_".$row['direction']."_".$call_result.".png' width='16' style='border: none;' title='".$text['label-'.$row['direction']].": ".$text['label-'.$call_result]."'>\n";
|
echo "<img src='".PROJECT_PATH."/themes/".$settings->get('domain', 'template', 'default')."/images/icon_cdr_".$row['direction']."_".$call_result.".png' width='16' style='border: none;' title='".$text['label-'.$row['direction']].": ".$text['label-'.$call_result]."'>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
|
|||||||
@@ -829,7 +829,7 @@
|
|||||||
if (is_array($result)) {
|
if (is_array($result)) {
|
||||||
|
|
||||||
//determine if theme images exist
|
//determine if theme images exist
|
||||||
$theme_image_path = $_SERVER["DOCUMENT_ROOT"]."/themes/".$settings->get('domain', 'template')."/images/";
|
$theme_image_path = $_SERVER["DOCUMENT_ROOT"]."/themes/".$settings->get('domain', 'template', 'default')."/images/";
|
||||||
$theme_cdr_images_exist = (
|
$theme_cdr_images_exist = (
|
||||||
file_exists($theme_image_path."icon_cdr_inbound_answered.png") &&
|
file_exists($theme_image_path."icon_cdr_inbound_answered.png") &&
|
||||||
file_exists($theme_image_path."icon_cdr_inbound_no_answer.png") &&
|
file_exists($theme_image_path."icon_cdr_inbound_no_answer.png") &&
|
||||||
@@ -966,7 +966,7 @@
|
|||||||
}
|
}
|
||||||
$image_name .= ".png";
|
$image_name .= ".png";
|
||||||
if (file_exists($theme_image_path.$image_name)) {
|
if (file_exists($theme_image_path.$image_name)) {
|
||||||
$content .= "<img src='".PROJECT_PATH."/themes/".$settings->get('domain', 'template')."/images/".escape($image_name)."' width='16' style='border: none; cursor: help;' title='".$text['label-'.$row['direction']].": ".$text['label-'.$status]. ($row['leg']=='b'?'(b)':'') . "'>\n";
|
$content .= "<img src='".PROJECT_PATH."/themes/".$settings->get('domain', 'template', 'default')."/images/".escape($image_name)."' width='16' style='border: none; cursor: help;' title='".$text['label-'.$row['direction']].": ".$text['label-'.$status]. ($row['leg']=='b'?'(b)':'') . "'>\n";
|
||||||
}
|
}
|
||||||
else { $content .= " "; }
|
else { $content .= " "; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -453,7 +453,7 @@
|
|||||||
$image_name .= '_b';
|
$image_name .= '_b';
|
||||||
}
|
}
|
||||||
$image_name .= ".png";
|
$image_name .= ".png";
|
||||||
echo " <img src='".PROJECT_PATH."/themes/".$settings->get('domain', 'template')."/images/".escape($image_name)."' width='16' style='border: none; cursor: help;' title='".$text['label-'.$call_direction].": ".$text['label-'.$status]. ($leg=='b'?'(b)':'') . "'>\n";
|
echo " <img src='".PROJECT_PATH."/themes/".$settings->get('domain', 'template', 'default')."/images/".escape($image_name)."' width='16' style='border: none; cursor: help;' title='".$text['label-'.$call_direction].": ".$text['label-'.$status]. ($leg=='b'?'(b)':'') . "'>\n";
|
||||||
}
|
}
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'><a href='xml_cdr_details.php?id=".urlencode($uuid)."'>".escape($direction)."</a></td>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'><a href='xml_cdr_details.php?id=".urlencode($uuid)."'>".escape($direction)."</a></td>\n";
|
||||||
|
|||||||
@@ -1013,7 +1013,7 @@
|
|||||||
$qr_size = '0';
|
$qr_size = '0';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo "<img id='img-buffer' style='display: none;' src='".PROJECT_PATH."/themes/".$settings->get('domain', 'template')."/images/qr_code.png'>";
|
echo "<img id='img-buffer' style='display: none;' src='".PROJECT_PATH."/themes/".$settings->get('domain', 'template', 'default')."/images/qr_code.png'>";
|
||||||
$qr_option = "image: $('#img-buffer')[0],";
|
$qr_option = "image: $('#img-buffer')[0],";
|
||||||
$qr_mode = '4';
|
$qr_mode = '4';
|
||||||
$qr_size = '0.2';
|
$qr_size = '0.2';
|
||||||
|
|||||||
@@ -172,7 +172,7 @@
|
|||||||
$qr_size = '0';
|
$qr_size = '0';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo "<img id='img-buffer' style='display: none;' src='".PROJECT_PATH."/themes/".$settings->get('domain', 'template')."/images/qr_code.png'>";
|
echo "<img id='img-buffer' style='display: none;' src='".PROJECT_PATH."/themes/".$settings->get('domain', 'template', 'default')."/images/qr_code.png'>";
|
||||||
$qr_option = "image: $('#img-buffer')[0],";
|
$qr_option = "image: $('#img-buffer')[0],";
|
||||||
$qr_mode = '4';
|
$qr_mode = '4';
|
||||||
$qr_size = '0.2';
|
$qr_size = '0.2';
|
||||||
|
|||||||
@@ -34,14 +34,19 @@
|
|||||||
//includes files
|
//includes files
|
||||||
require_once "resources/functions.php";
|
require_once "resources/functions.php";
|
||||||
|
|
||||||
|
//add the auto loader
|
||||||
|
require_once "resources/classes/auto_loader.php";
|
||||||
|
$autoload = new auto_loader();
|
||||||
|
|
||||||
//include required classes
|
//include required classes
|
||||||
require_once "resources/classes/text.php";
|
require_once "resources/classes/text.php";
|
||||||
require_once "resources/classes/template.php";
|
require_once "resources/classes/template.php";
|
||||||
require_once "resources/classes/message.php";
|
|
||||||
require_once "core/install/resources/classes/install.php";
|
require_once "core/install/resources/classes/install.php";
|
||||||
|
|
||||||
//start the session before text object stores values in session
|
//start the session before text object stores values in session
|
||||||
//ini_set("session.cookie_httponly", True);
|
ini_set("session.cookie_httponly", 'true');
|
||||||
|
ini_set("session.cookie_secure", 'false');
|
||||||
|
ini_set("session.cookie_samesite", 'Lax');
|
||||||
session_start();
|
session_start();
|
||||||
|
|
||||||
//add multi-lingual support
|
//add multi-lingual support
|
||||||
@@ -60,12 +65,8 @@
|
|||||||
|
|
||||||
//error reporting
|
//error reporting
|
||||||
ini_set('display_errors', '1');
|
ini_set('display_errors', '1');
|
||||||
//error_reporting (E_ALL); // Report everything
|
|
||||||
|
|
||||||
//error reporting
|
|
||||||
ini_set('display_errors', '1');
|
|
||||||
//error_reporting (E_ALL); // Report everything
|
|
||||||
error_reporting (E_ALL ^ E_NOTICE); // Report warnings
|
error_reporting (E_ALL ^ E_NOTICE); // Report warnings
|
||||||
|
//error_reporting (E_ALL); // Report everything
|
||||||
//error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ); //hide notices and warnings
|
//error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ); //hide notices and warnings
|
||||||
|
|
||||||
//set the default time zone
|
//set the default time zone
|
||||||
@@ -75,39 +76,27 @@
|
|||||||
$config_exists = false;
|
$config_exists = false;
|
||||||
if (file_exists("/usr/local/etc/fusionpbx/config.conf")) {
|
if (file_exists("/usr/local/etc/fusionpbx/config.conf")) {
|
||||||
//bsd
|
//bsd
|
||||||
|
$config_path = "/usr/local/etc/fusionpbx";
|
||||||
$config_exists = true;
|
$config_exists = true;
|
||||||
}
|
}
|
||||||
elseif (file_exists("/etc/fusionpbx/config.conf")) {
|
elseif (file_exists("/etc/fusionpbx/config.conf")) {
|
||||||
//linux
|
//linux
|
||||||
|
$config_path = "/etc/fusionpbx";
|
||||||
$config_exists = true;
|
$config_exists = true;
|
||||||
}
|
}
|
||||||
elseif (file_exists(getenv('SystemDrive') . DIRECTORY_SEPARATOR . 'ProgramData' . DIRECTORY_SEPARATOR . 'fusionpbx' . DIRECTORY_SEPARATOR . 'config.conf')) {
|
elseif (file_exists(getenv('SystemDrive') . DIRECTORY_SEPARATOR . 'ProgramData' . DIRECTORY_SEPARATOR . 'fusionpbx' . DIRECTORY_SEPARATOR . 'config.conf')) {
|
||||||
//Windows
|
//windows
|
||||||
|
$config_path = getenv('SystemDrive') . DIRECTORY_SEPARATOR . 'ProgramData' . DIRECTORY_SEPARATOR . 'fusionpbx' . DIRECTORY_SEPARATOR;
|
||||||
$config_exists = true;
|
$config_exists = true;
|
||||||
}
|
}
|
||||||
if ($config_exists) {
|
if ($config_exists) {
|
||||||
$msg = "Already Installed";
|
|
||||||
//report to user
|
|
||||||
message::add($msg);
|
|
||||||
//redirect with message
|
//redirect with message
|
||||||
header("Location: ".PROJECT_PATH."/index.php?msg=".urlencode($msg));
|
header("Location: ".PROJECT_PATH."/?msg=".urlencode("Already Installed"));
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if the config.php exists create the config.conf file
|
//if the config.php exists then use it to create the config.conf file
|
||||||
if (!$config_exists) {
|
if (!$config_exists) {
|
||||||
if (file_exists("/usr/local/etc/fusionpbx/config.php")) {
|
|
||||||
//bsd
|
|
||||||
$config_path = "/usr/local/etc/fusionpbx";
|
|
||||||
}
|
|
||||||
elseif (file_exists("/etc/fusionpbx/config.php")) {
|
|
||||||
//linux
|
|
||||||
$config_path = "/etc/fusionpbx";
|
|
||||||
}
|
|
||||||
elseif (file_exists(getenv('SystemDrive') . DIRECTORY_SEPARATOR . 'ProgramData' . DIRECTORY_SEPARATOR . 'fusionpbx' . DIRECTORY_SEPARATOR . 'config.php')) {
|
|
||||||
//Windows
|
|
||||||
$config_path = getenv('SystemDrive') . DIRECTORY_SEPARATOR . 'ProgramData' . DIRECTORY_SEPARATOR . 'fusionpbx' ;
|
|
||||||
}
|
|
||||||
if (isset($config_path)) {
|
if (isset($config_path)) {
|
||||||
if (is_writable($config_path)) {
|
if (is_writable($config_path)) {
|
||||||
//include the config.php file
|
//include the config.php file
|
||||||
@@ -122,6 +111,9 @@
|
|||||||
$install->database_password = $db_password;
|
$install->database_password = $db_password;
|
||||||
$install->config();
|
$install->config();
|
||||||
|
|
||||||
|
//give time for the config file to be saved
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
//redirect the user
|
//redirect the user
|
||||||
header("Location: /");
|
header("Location: /");
|
||||||
exit;
|
exit;
|
||||||
@@ -138,7 +130,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//process and save the data
|
//process and save the data
|
||||||
if (count($_POST) > 0) {
|
if (!empty($_POST)) {
|
||||||
foreach($_POST as $key => $value) {
|
foreach($_POST as $key => $value) {
|
||||||
switch($key) {
|
switch($key) {
|
||||||
case 'admin_username':
|
case 'admin_username':
|
||||||
@@ -152,7 +144,7 @@
|
|||||||
$_SESSION['install'][$key] = $value;
|
$_SESSION['install'][$key] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($_REQUEST["step"] == "install") {
|
if (!empty($_REQUEST["step"]) && $_REQUEST["step"] == "install") {
|
||||||
//show debug information
|
//show debug information
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
echo "<pre>\n";
|
echo "<pre>\n";
|
||||||
@@ -176,11 +168,14 @@
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//wait for the config to be saved to the file system
|
||||||
|
sleep(1);
|
||||||
|
|
||||||
//add the database schema
|
//add the database schema
|
||||||
$output = shell_exec('cd '.$_SERVER["DOCUMENT_ROOT"].' && php /var/www/fusionpbx/core/upgrade/upgrade_schema.php');
|
$output = shell_exec('cd '.$_SERVER["DOCUMENT_ROOT"].' && php /var/www/fusionpbx/core/upgrade/upgrade_schema.php');
|
||||||
|
|
||||||
//includes - this includes the config.php
|
//connect to the database
|
||||||
require_once dirname(__DIR__, 2) . "/resources/require.php";
|
$database = new database;
|
||||||
|
|
||||||
//get the domain name
|
//get the domain name
|
||||||
$domain_name = $_SESSION['install']['domain_name'];
|
$domain_name = $_SESSION['install']['domain_name'];
|
||||||
@@ -188,13 +183,13 @@
|
|||||||
//check to see if the domain name exists if it does update the domain_uuid
|
//check to see if the domain name exists if it does update the domain_uuid
|
||||||
$sql = "select domain_uuid from v_domains ";
|
$sql = "select domain_uuid from v_domains ";
|
||||||
$sql .= "where domain_name = :domain_name ";
|
$sql .= "where domain_name = :domain_name ";
|
||||||
|
$parameters = [];
|
||||||
$parameters['domain_name'] = $domain_name;
|
$parameters['domain_name'] = $domain_name;
|
||||||
|
|
||||||
$domain_uuid = $database->select($sql, $parameters, 'column');
|
$domain_uuid = $database->select($sql, $parameters, 'column');
|
||||||
unset($parameters);
|
unset($parameters);
|
||||||
|
|
||||||
//set domain and user_uuid to true or false
|
//set domain and user_uuid to true or false
|
||||||
if ($domain_uuid == null) {
|
if (empty($domain_uuid)) {
|
||||||
$domain_uuid = uuid();
|
$domain_uuid = uuid();
|
||||||
$domain_exists = false;
|
$domain_exists = false;
|
||||||
}
|
}
|
||||||
@@ -232,6 +227,8 @@
|
|||||||
//prepare the user settings
|
//prepare the user settings
|
||||||
$admin_username = $_SESSION['install']['admin_username'];
|
$admin_username = $_SESSION['install']['admin_username'];
|
||||||
$admin_password = $_SESSION['install']['admin_password'];
|
$admin_password = $_SESSION['install']['admin_password'];
|
||||||
|
|
||||||
|
//prepare the password hash
|
||||||
$user_salt = uuid();
|
$user_salt = uuid();
|
||||||
$password_hash = md5($user_salt . $admin_password);
|
$password_hash = md5($user_salt . $admin_password);
|
||||||
|
|
||||||
@@ -281,7 +278,6 @@
|
|||||||
$array['user_groups'][0]['group_name'] = 'superadmin';
|
$array['user_groups'][0]['group_name'] = 'superadmin';
|
||||||
$array['user_groups'][0]['group_uuid'] = $group_uuid;
|
$array['user_groups'][0]['group_uuid'] = $group_uuid;
|
||||||
$array['user_groups'][0]['user_uuid'] = $user_uuid;
|
$array['user_groups'][0]['user_uuid'] = $user_uuid;
|
||||||
$database->uuid($user_uuid);
|
|
||||||
$database->save($array);
|
$database->save($array);
|
||||||
$message = $database->message;
|
$message = $database->message;
|
||||||
unset($array);
|
unset($array);
|
||||||
@@ -304,18 +300,9 @@
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//update xml_cdr url, user and password in xml_cdr.conf.xml
|
|
||||||
if (!$domain_exists) {
|
|
||||||
if (file_exists($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/app/xml_cdr")) {
|
|
||||||
xml_cdr_conf_xml();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//write the switch.conf.xml file
|
//write the switch.conf.xml file
|
||||||
if (!$domain_exists) {
|
if (!$domain_exists && file_exists($switch_conf_dir)) {
|
||||||
if (file_exists($switch_conf_dir)) {
|
switch_conf_xml();
|
||||||
switch_conf_xml();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#app defaults
|
#app defaults
|
||||||
@@ -326,14 +313,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//set the max execution time to 1 hour
|
|
||||||
ini_set('max_execution_time',3600);
|
|
||||||
|
|
||||||
//set a default template
|
|
||||||
$settings->get('domain', 'template') = 'default';
|
|
||||||
$settings->get('theme', 'menu_brand_image') = PROJECT_PATH.'/themes/default/images/logo.png';
|
|
||||||
$settings->get('theme', 'menu_brand_type') = 'image';
|
|
||||||
|
|
||||||
//set a default step if not already set
|
//set a default step if not already set
|
||||||
if(empty($_REQUEST['step'])) {
|
if(empty($_REQUEST['step'])) {
|
||||||
$_REQUEST['step'] = '1';
|
$_REQUEST['step'] = '1';
|
||||||
@@ -363,14 +342,11 @@
|
|||||||
$view->assign("database_port", "5432");
|
$view->assign("database_port", "5432");
|
||||||
$view->assign("database_name", "fusionpbx");
|
$view->assign("database_name", "fusionpbx");
|
||||||
$view->assign("database_username", "fusionpbx");
|
$view->assign("database_username", "fusionpbx");
|
||||||
$view->assign("database_password", "fusionpbx");
|
$view->assign("database_password", "");
|
||||||
|
|
||||||
//add translations
|
//add translations
|
||||||
foreach($text as $key => $value) {
|
foreach($text as $key => $value) {
|
||||||
$view->assign(str_replace("-", "_", $key), $text[$key]);
|
$view->assign(str_replace("-", "_", $key), $text[$key]);
|
||||||
//$view->assign("label_username", $text['label-username']);
|
|
||||||
//$view->assign("label_password", $text['label-password']);
|
|
||||||
//$view->assign("button_back", $text['button-back']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//debug information
|
//debug information
|
||||||
@@ -385,10 +361,10 @@
|
|||||||
// $content = $view->render('language.htm');
|
// $content = $view->render('language.htm');
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if ($_REQUEST["step"] == "1") {
|
if (!empty($_REQUEST["step"]) && $_REQUEST["step"] == "1") {
|
||||||
$content = $view->render('configuration.htm');
|
$content = $view->render('configuration.htm');
|
||||||
}
|
}
|
||||||
if ($_REQUEST["step"] == "2") {
|
if (!empty($_REQUEST["step"]) && $_REQUEST["step"] == "2") {
|
||||||
$content = $view->render('database.htm');
|
$content = $view->render('database.htm');
|
||||||
}
|
}
|
||||||
$view->assign("content", $content);
|
$view->assign("content", $content);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
else {
|
else {
|
||||||
//use custom index, if present, otherwise use custom login, if present, otherwise use default login
|
//use custom index, if present, otherwise use custom login, if present, otherwise use default login
|
||||||
if (file_exists($_SERVER["PROJECT_ROOT"]."/themes/".($settings->get('domain', 'template') ?? '')."/index.php")) {
|
if (file_exists($_SERVER["PROJECT_ROOT"]."/themes/".($settings->get('domain', 'template') ?? '')."/index.php")) {
|
||||||
require_once "themes/".$settings->get('domain', 'template')."/index.php";
|
require_once "themes/".$settings->get('domain', 'template', 'default')."/index.php";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
//login prompt
|
//login prompt
|
||||||
|
|||||||
@@ -1128,7 +1128,7 @@
|
|||||||
if ($menu_brand) {
|
if ($menu_brand) {
|
||||||
//define menu brand mark
|
//define menu brand mark
|
||||||
$menu_brand_text = escape($this->settings->get('theme', 'menu_brand_text', 'FusionPBX'));
|
$menu_brand_text = escape($this->settings->get('theme', 'menu_brand_text', 'FusionPBX'));
|
||||||
switch ($this->settings->get('theme', 'menu_brand_type', '')) {
|
switch ($this->settings->get('theme', 'menu_brand_type', 'image')) {
|
||||||
case 'text':
|
case 'text':
|
||||||
$html .= " <a class='navbar-brand-text' href='".PROJECT_PATH."/'>".$menu_brand_text."</a>\n";
|
$html .= " <a class='navbar-brand-text' href='".PROJECT_PATH."/'>".$menu_brand_text."</a>\n";
|
||||||
break;
|
break;
|
||||||
@@ -1342,12 +1342,12 @@
|
|||||||
//menu brand image and/or text
|
//menu brand image and/or text
|
||||||
$html = " <div id='menu_side_control_container'>\n";
|
$html = " <div id='menu_side_control_container'>\n";
|
||||||
$html .= " <div class='menu_side_control_state' style='float: right; ".($menu_side_state != 'expanded' ? "display: none;" : null)."'>\n";
|
$html .= " <div class='menu_side_control_state' style='float: right; ".($menu_side_state != 'expanded' ? "display: none;" : null)."'>\n";
|
||||||
if ($this->settings->get('theme', 'menu_brand_type') != 'none') {
|
if ($this->settings->get('theme', 'menu_brand_type', 'image') != 'none') {
|
||||||
$html .= " <a class='menu_side_item_main menu_side_contract' onclick='menu_side_contract();' style='height: 60px; padding: 19px 16px 8px 16px !important; ".($menu_side_state != 'expanded' ? "display: none;" : null)."'><i class='fa-solid fa-bars fa-fw'></i></a>";
|
$html .= " <a class='menu_side_item_main menu_side_contract' onclick='menu_side_contract();' style='height: 60px; padding: 19px 16px 8px 16px !important; ".($menu_side_state != 'expanded' ? "display: none;" : null)."'><i class='fa-solid fa-bars fa-fw'></i></a>";
|
||||||
}
|
}
|
||||||
$html .= " </div>\n";
|
$html .= " </div>\n";
|
||||||
$menu_brand_text = escape($this->settings->get('theme', 'menu_brand_text', 'FusionPBX'));
|
$menu_brand_text = escape($this->settings->get('theme', 'menu_brand_text', 'FusionPBX'));
|
||||||
switch ($this->settings->get('theme', 'menu_brand_type', '')) {
|
switch ($this->settings->get('theme', 'menu_brand_type', 'image')) {
|
||||||
case 'none':
|
case 'none':
|
||||||
$html .= "<a class='menu_side_item_main menu_side_contract' onclick='menu_side_contract();' style='".($menu_side_state != 'expanded' ? "display: none;" : null)." height: 60px; min-width: ".intval($this->settings->get('theme', 'menu_side_width_contracted', 60))."px;' title=\"".$this->text['theme-label-contract_menu']."\"><i class='fa-solid fa-bars fa-fw' style='z-index: 99800; padding-left: 1px; padding-top: 11px;'></i></a>";
|
$html .= "<a class='menu_side_item_main menu_side_contract' onclick='menu_side_contract();' style='".($menu_side_state != 'expanded' ? "display: none;" : null)." height: 60px; min-width: ".intval($this->settings->get('theme', 'menu_side_width_contracted', 60))."px;' title=\"".$this->text['theme-label-contract_menu']."\"><i class='fa-solid fa-bars fa-fw' style='z-index: 99800; padding-left: 1px; padding-top: 11px;'></i></a>";
|
||||||
$html .= "<a class='menu_side_item_main menu_side_expand' onclick='menu_side_expand();' style='".($menu_side_state == 'expanded' ? "display: none;" : null)." height: 60px;' title=\"".$this->text['theme-label-expand_menu']."\"><i class='fa-solid fa-bars fa-fw' style='z-index: 99800; padding-left: 1px; padding-top: 11px;'></i></a>";
|
$html .= "<a class='menu_side_item_main menu_side_expand' onclick='menu_side_expand();' style='".($menu_side_state == 'expanded' ? "display: none;" : null)." height: 60px;' title=\"".$this->text['theme-label-expand_menu']."\"><i class='fa-solid fa-bars fa-fw' style='z-index: 99800; padding-left: 1px; padding-top: 11px;'></i></a>";
|
||||||
|
|||||||
@@ -148,8 +148,8 @@
|
|||||||
$settings_array['theme']['footer'] = isset($settings_array['theme']['footer']) ? $settings_array['theme']['footer'] : '© '.$text['theme-label-copyright'].' 2008 - '.date('Y')." <a href='http://www.fusionpbx.com' class='footer' target='_blank'>fusionpbx.com</a> ".$text['theme-label-all_rights_reserved'];
|
$settings_array['theme']['footer'] = isset($settings_array['theme']['footer']) ? $settings_array['theme']['footer'] : '© '.$text['theme-label-copyright'].' 2008 - '.date('Y')." <a href='http://www.fusionpbx.com' class='footer' target='_blank'>fusionpbx.com</a> ".$text['theme-label-all_rights_reserved'];
|
||||||
$settings_array['theme']['menu_side_item_main_sub_icon_contract'] = !empty($settings_array['theme']['menu_side_item_main_sub_icon_contract']) ? explode(' ', $settings_array['theme']['menu_side_item_main_sub_icon_contract'])[1] : null;
|
$settings_array['theme']['menu_side_item_main_sub_icon_contract'] = !empty($settings_array['theme']['menu_side_item_main_sub_icon_contract']) ? explode(' ', $settings_array['theme']['menu_side_item_main_sub_icon_contract'])[1] : null;
|
||||||
$settings_array['theme']['menu_side_item_main_sub_icon_expand'] = !empty($settings_array['theme']['menu_side_item_main_sub_icon_expand']) ? explode(' ', $settings_array['theme']['menu_side_item_main_sub_icon_expand'])[1] : null;
|
$settings_array['theme']['menu_side_item_main_sub_icon_expand'] = !empty($settings_array['theme']['menu_side_item_main_sub_icon_expand']) ? explode(' ', $settings_array['theme']['menu_side_item_main_sub_icon_expand'])[1] : null;
|
||||||
$settings_array['theme']['menu_brand_type'] = $settings->get('theme', 'menu_brand_type', '');
|
$settings_array['theme']['menu_brand_type'] = $settings->get('theme', 'menu_brand_type', 'image');
|
||||||
//assign the setings
|
//assign the settings
|
||||||
$view->assign('settings', $settings_array);
|
$view->assign('settings', $settings_array);
|
||||||
}
|
}
|
||||||
//background video
|
//background video
|
||||||
|
|||||||
Reference in New Issue
Block a user