Change $_SERVER['DOCUMENT_ROOT'].PROJECT_PATH to $_SERVER["PROJECT_ROOT"].

This commit is contained in:
markjcrane 2016-01-17 00:01:13 -07:00
parent 4a1c02973d
commit fa081456b1
23 changed files with 68 additions and 69 deletions

View File

@ -65,7 +65,7 @@ else {
if (if_group("superadmin")){
$broadcast_accountcode = check_str($_POST["broadcast_accountcode"]);
}
elseif (if_group("admin") && file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){
elseif (if_group("admin") && file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
$sql_accountcode = "SELECT COUNT(*) as count FROM v_billings WHERE domain_uuid = '".$_SESSION['domain_uuid']."' AND type_value='".$_POST["accountcode"]."'";
$prep_statement_accountcode = $db->prepare(check_sql($sql_accountcode));
$prep_statement_accountcode->execute();
@ -277,7 +277,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo $text['description-accountcode']."\n";
echo "</td>\n";
echo "</tr>\n";
}elseif (if_group("admin") && file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){
}elseif (if_group("admin") && file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
$sql_accountcode = "SELECT type_value FROM v_billings WHERE domain_uuid = '".$_SESSION['domain_uuid']."'";
echo "<tr>\n";

View File

@ -266,7 +266,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$switch_result = event_socket_request($fp, 'api '.$switch_cmd);
}
$_SESSION["message"] = $text['message-add'];
//set the message
$_SESSION["message"] = $text['message-add'];
} //if ($action == "add")
if ($action == "update") {

View File

@ -106,7 +106,7 @@ if (strlen($contact_uuid) > 0) {
$prep_statement->execute();
unset($prep_statement, $sql);
//delete groups
//delete contact groups
$sql = "delete from v_contact_groups ";
$sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
$sql .= "and contact_uuid = '".$contact_uuid."' ";

View File

@ -35,7 +35,7 @@ else {
exit;
}
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")) {
require_once "app/billing/resources/functions/currency.php";
require_once "app/billing/resources/functions/rating.php";
}
@ -432,7 +432,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "add") {
$_SESSION["message"] = $text['message-add'];
// billing
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
$db2 = new database;
$db2->sql = "select currency, billing_uuid, balance from v_billings where type_value='$destination_accountcode'";
$db2->result = $db2->execute();
@ -706,7 +706,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "</td>\n";
echo "</tr>\n";
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/fax/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/fax/app_config.php")){
$sql = "select * from v_fax ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "order by fax_name asc ";
@ -750,7 +750,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo "</tr>\n";
// billing
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
echo "<tr id='tr_sell'>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-monthly_price']."\n";
@ -797,7 +797,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
echo " <input class='formfld' type='text' name='destination_accountcode' maxlength='255' value=\"$destination_accountcode\">\n";
echo "<br />\n";
echo $text['description-account_code']."\n";
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
echo " ".$text['billing-warning'];
}
echo "</td>\n";

View File

@ -786,7 +786,7 @@ else {
echo "<br><br>\n";
echo "</form>";
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
echo "<p>".$text['billing-warning']."</p>";
}

View File

@ -35,7 +35,7 @@ else {
}
//detect billing app
$billing_app_exists = file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php");
$billing_app_exists = file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php");
if ($billing_app_exists) {
require_once "app/billing/resources/functions/currency.php";
require_once "app/billing/resources/functions/rating.php";

View File

@ -36,7 +36,7 @@ else {
}
//detect billing app
$billing_app_exists = file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php");
$billing_app_exists = file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php");
if ($billing_app_exists) {
require_once "app/billing/resources/functions/currency.php";

View File

@ -70,7 +70,7 @@
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
//add rating functions if the billing is installed
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
require_once "app/billing/resources/functions/rating.php";
}
@ -246,7 +246,7 @@
}
//billing information
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
$db2 = new database;
$lcr_currency = (strlen($_SESSION['billing']['currency']['text'])?$_SESSION['billing']['currency']['text']:'USD');
$accountcode = (strlen(urldecode($xml->variables->accountcode)))?check_str(urldecode($xml->variables->accountcode)):$domain_name;

View File

@ -339,7 +339,7 @@ else {
echo th_order_by('start_stamp', $text['label-start'], $order_by, $order, null, "style='text-align: center;'", $param);
echo th_order_by('tta', $text['label-tta'], $order_by, $order, null, "style='text-align: right;'", $param);
echo th_order_by('duration', $text['label-duration'], $order_by, $order, null, "style='text-align: center;'", $param);
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
// billing collumns
echo "<th>".$text['label-price']."</th>\n";
$col_count++;
@ -362,7 +362,7 @@ else {
$col_count++;
}
echo "</tr>\n";
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
require_once "app/billing/resources/functions/rating.php";
require_once "resources/classes/database.php";
$database = new database;
@ -543,7 +543,7 @@ else {
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: center;'>".gmdate("G:i:s", $seconds)."</td>\n";
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
$database->table = "v_xml_cdr";
$accountcode = (strlen($row["accountcode"])?$row["accountcode"]:$_SESSION[domain_name]);

View File

@ -299,7 +299,7 @@ else {
$sql .= "caller_id_number, ";
$sql .= "destination_number, ";
$sql .= "accountcode, ";
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
$sql .= "call_sell, ";
}
if (permission_exists("xml_cdr_pdd")) {

View File

@ -133,7 +133,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
if ($original_domain_name != $domain_name) {
// update dialplans
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/dialplan/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/dialplan/app_config.php")){
$sql = "update v_dialplans set ";
$sql .= "dialplan_context = '".$domain_name."' ";
$sql .= "where dialplan_context = '".$original_domain_name."' ";
@ -143,7 +143,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
// update extensions (accountcode, user_context, dial_domain)
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/extensions/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/extensions/app_config.php")){
$sql = "update v_extensions set ";
$sql .= "accountcode = '".$domain_name."' ";
$sql .= "where accountcode = '".$original_domain_name."' ";
@ -167,7 +167,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
// update cdr records (domain_name, context)
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/xml_cdr/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/xml_cdr/app_config.php")){
$sql = "update v_xml_cdr set ";
$sql .= "domain_name = '".$domain_name."' ";
$sql .= "where domain_name = '".$original_domain_name."' ";
@ -184,7 +184,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
// update billing, if installed
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/billing/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/billing/app_config.php")){
$sql = "update v_billings set ";
$sql .= "type_value = '".$domain_name."' ";
$sql .= "where type_value = '".$original_domain_name."' ";
@ -242,7 +242,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
// update conference session recording paths
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/conference_centers/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/conference_centers/app_config.php")){
$sql = "select conference_session_uuid, recording from v_conference_sessions ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and recording like '%".$original_domain_name."%' ";
@ -267,7 +267,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
// update conference center greetings
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/conference_centers/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/conference_centers/app_config.php")){
$sql = "select conference_center_uuid, conference_center_greeting from v_conference_centers ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and conference_center_greeting like '%".$original_domain_name."%' ";
@ -292,7 +292,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
// update ivr menu greetings
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/ivr_menu/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/ivr_menu/app_config.php")){
$sql = "select ivr_menu_uuid, ivr_menu_greet_long, ivr_menu_greet_short from v_ivr_menus ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and ( ";
@ -323,7 +323,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
// update ivr menu option parameters
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/ivr_menu/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/ivr_menu/app_config.php")){
$sql = "select ivr_menu_option_uuid, ivr_menu_option_param from v_ivr_menu_options ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and ivr_menu_option_param like '%".$original_domain_name."%' ";
@ -348,7 +348,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
// update call center queue record templates
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/call_center/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/call_center/app_config.php")){
$sql = "select call_center_queue_uuid, queue_record_template from v_call_center_queues ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and queue_record_template like '%".$original_domain_name."%' ";
@ -373,7 +373,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
// update call center agent contacts
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/call_center/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/call_center/app_config.php")){
$sql = "select call_center_agent_uuid, agent_contact from v_call_center_agents ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and agent_contact like '%".$original_domain_name."%' ";
@ -398,7 +398,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
// update call flows data, anti-data and contexts
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/call_flows/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/call_flows/app_config.php")){
$sql = "select call_flow_uuid, call_flow_data, call_flow_anti_data, call_flow_context from v_call_flows ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and ( ";
@ -433,7 +433,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
// update ring group context, forward destination, timeout data
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/ring_groups/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/ring_groups/app_config.php")){
$sql = "select ring_group_uuid, ring_group_context, ring_group_forward_destination, ring_group_timeout_data from v_ring_groups ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and ( ";
@ -468,7 +468,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
}
// update device lines server address, outbound proxy
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/devices/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/devices/app_config.php")){
$sql = "select device_line_uuid, server_address, outbound_proxy from v_device_lines ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and ( ";
@ -510,7 +510,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
unset($dialplan_public_xml);
// update dialplan details
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/dialplan/app_config.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/dialplan/app_config.php")){
$sql = "select dialplan_detail_uuid, dialplan_detail_data from v_dialplan_details ";
$sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and dialplan_detail_data like '%".$original_domain_name."%' ";

View File

@ -31,7 +31,7 @@ require_once "resources/check_auth.php";
//detect install state
$first_time_install = true;
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
$first_time_install = false;
} elseif (file_exists("/etc/fusionpbx/config.php")) {
//linux

View File

@ -78,7 +78,7 @@ date_default_timezone_set($timezone);
//detect install state
$first_time_install = true;
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
$first_time_install = false;
} elseif (file_exists("/etc/fusionpbx/config.php")) {
$first_time_install = false;

View File

@ -56,7 +56,7 @@ include "root.php";
} elseif (is_dir("/usr/local/etc/fusionpbx")){
$this->config_php = "/usr/local/etc/fusionpbx/config.php";
}
elseif (is_dir($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources")) {
elseif (is_dir($_SERVER["PROJECT_ROOT"]."/resources")) {
$this->config_php = $_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/resources/config.php";
}
else {

View File

@ -28,9 +28,9 @@
include "root.php";
//if config.php file does not exist then redirect to the install page
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
//do nothing
} elseif (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) {
} elseif (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
//original directory
} elseif (file_exists("/etc/fusionpbx/config.php")){
//linux

View File

@ -341,7 +341,7 @@ if (count($_POST) > 0 && $_POST["persistform"] != "1") {
// if call center installed
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/call_center/app_config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/call_center/app_config.php")) {
// update agent and tiers tables
$sql = "update v_call_center_agents set agent_name = '".$username."' where domain_uuid = '".$domain_uuid."' and agent_name = '".$username_old."' ";

View File

@ -30,13 +30,13 @@ include "root.php";
session_start();
//if config.php file does not exist then redirect to the install page
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
//do nothing
} elseif (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) {
} elseif (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
//original directory
} elseif (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/includes/config.php")) {
} elseif (file_exists($_SERVER["PROJECT_ROOT"]."/includes/config.php")) {
//move config.php from the includes to resources directory.
rename($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/includes/config.php", $_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php");
rename($_SERVER["PROJECT_ROOT"]."/includes/config.php", $_SERVER["PROJECT_ROOT"]."/resources/config.php");
} elseif (file_exists("/etc/fusionpbx/config.php")) {
//linux
} elseif (file_exists("/usr/local/etc/fusionpbx/config.php")) {
@ -59,8 +59,7 @@ include "root.php";
if (strlen($_SESSION["username"]) > 0) {
if (strlen($_SESSION['login']['destination']['url']) > 0) {
header("Location: ".$_SESSION['login']['destination']['url']);
}elseif(file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/core/user_settings/user_dashboard.php"))
{
} elseif (file_exists($_SERVER["PROJECT_ROOT"]."/core/user_settings/user_dashboard.php")) {
header("Location: ".PROJECT_PATH."/core/user_settings/user_dashboard.php");
}
else {
@ -70,10 +69,9 @@ include "root.php";
}
else {
//use custom index, if present, otherwise use custom login, if present, otherwise use default login
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/themes/".$_SESSION['domain']['template']['name']."/index.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/index.php")) {
require_once "themes/".$_SESSION['domain']['template']['name']."/index.php";
}
else if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/themes/".$_SESSION['domain']['template']['name']."/login.php")) {
} else if (file_exists($_SERVER["PROJECT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/login.php")) {
require_once "themes/".$_SESSION['domain']['template']['name']."/login.php";
}
else {

View File

@ -40,12 +40,12 @@ include "root.php";
session_destroy();
//if config.php file does not exist then redirect to the install page
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
//original directory
}
else if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/includes/config.php")) {
else if (file_exists($_SERVER["PROJECT_ROOT"]."/includes/config.php")) {
//move config.php from the includes to resources directory.
rename($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/includes/config.php", $_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php");
rename($_SERVER["PROJECT_ROOT"]."/includes/config.php", $_SERVER["PROJECT_ROOT"]."/resources/config.php");
}
else if (file_exists("/etc/fusionpbx/config.php")){
//linux
@ -68,7 +68,7 @@ include "root.php";
}
//use custom login, if present, otherwise use default login
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/themes/".$_SESSION['domain']['template']['name']."/login.php")){
if (file_exists($_SERVER["PROJECT_ROOT"]."/themes/".$_SESSION['domain']['template']['name']."/login.php")){
require_once "themes/".$_SESSION['domain']['template']['name']."/login.php";
}
else {

View File

@ -70,8 +70,8 @@ class config {
//get the PROJECT PATH
include "root.php";
// find the file
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) {
$this->config_path = $_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php";
if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
$this->config_path = $_SERVER["PROJECT_ROOT"]."/resources/config.php";
} elseif (file_exists("/etc/fusionpbx/config.php")) {
$this->config_path = "/etc/fusionpbx/config.php";
} elseif (file_exists("/usr/local/etc/fusionpbx/config.php")) {

View File

@ -54,10 +54,10 @@ include "root.php";
if (strlen($this->type) == 0 && strlen($this->db_name) == 0) {
//include config.php
include "root.php";
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) {
include $_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php";
} elseif (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php")) {
include $_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/resources/config.php";
if (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
include $_SERVER["PROJECT_ROOT"]."/resources/config.php";
} elseif (file_exists($_SERVER["PROJECT_ROOT"]."/resources/config.php")) {
include $_SERVER["PROJECT_ROOT"]."/resources/config.php";
} elseif (file_exists("/etc/fusionpbx/config.php")){
//linux
include "/etc/fusionpbx/config.php";

View File

@ -186,7 +186,7 @@ class destinations {
$destination = $row['field']['destination'];
//add multi-lingual support
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/".$name."/app_languages.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/".$name."/app_languages.php")) {
$language2 = new text;
$text2 = $language2->get($_SESSION['domain']['language']['code'], 'app/'.$name);
}

View File

@ -87,7 +87,7 @@ require_once "resources/require.php";
unset($menu_prep_statement, $menu_result, $menu_row);
//get the content
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/content/app_config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/content/app_config.php")) {
$sql = "select * from v_rss ";
$sql .= "where domain_uuid =:domain_uuid ";
$sql .= "and rss_category = 'content' ";

View File

@ -29,7 +29,7 @@ require_once "root.php";
require_once "resources/require.php";
//get the event socket information
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/settings/app_config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/settings/app_config.php")) {
if (strlen($_SESSION['event_socket_ip_address']) == 0) {
$sql = "select * from v_settings ";
$prep_statement = $db->prepare(check_sql($sql));
@ -49,7 +49,7 @@ require_once "resources/require.php";
//get the extensions that are assigned to this user
function load_extensions() {
global $db;
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/extensions/app_config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/extensions/app_config.php")) {
if (strlen($_SESSION["domain_uuid"]) > 0 && strlen($_SESSION["user_uuid"]) > 0 && count($_SESSION['user']['extension']) == 0) {
//get the user extension list
unset($_SESSION['user']['extension']);
@ -128,7 +128,7 @@ function event_socket_request($fp, $cmd) {
function event_socket_request_cmd($cmd) {
global $db;
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/settings/app_config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/settings/app_config.php")) {
$sql = "select * from v_settings ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
@ -1442,25 +1442,25 @@ if (!function_exists('save_switch_xml')) {
}
}
if (is_readable($_SESSION['switch']['conf']['dir'])) {
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/settings/app_config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/settings/app_config.php")) {
save_setting_xml();
}
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/modules/app_config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/modules/app_config.php")) {
save_module_xml();
}
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/vars/app_config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/vars/app_config.php")) {
save_var_xml();
}
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/call_center/app_config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/call_center/app_config.php")) {
save_call_center_xml();
}
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/gateways/app_config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/gateways/app_config.php")) {
save_gateway_xml();
}
//if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/ivr_menu/app_config.php")) {
//if (file_exists($_SERVER["PROJECT_ROOT"]."/app/ivr_menu/app_config.php")) {
// save_ivr_menu_xml();
//}
if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/sip_profiles/app_config.php")) {
if (file_exists($_SERVER["PROJECT_ROOT"]."/app/sip_profiles/app_config.php")) {
save_sip_profile_xml();
}
}