diff --git a/app/call_broadcast/call_broadcast_edit.php b/app/call_broadcast/call_broadcast_edit.php index f8276c97b8..c43991bd42 100644 --- a/app/call_broadcast/call_broadcast_edit.php +++ b/app/call_broadcast/call_broadcast_edit.php @@ -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 "\n"; echo "\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 "\n"; diff --git a/app/call_centers/call_center_queue_edit.php b/app/call_centers/call_center_queue_edit.php index 81ce4acbfb..f9e5168856 100644 --- a/app/call_centers/call_center_queue_edit.php +++ b/app/call_centers/call_center_queue_edit.php @@ -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") { diff --git a/app/contacts/contact_delete.php b/app/contacts/contact_delete.php index 8fc0b73f36..1b05e71140 100644 --- a/app/contacts/contact_delete.php +++ b/app/contacts/contact_delete.php @@ -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."' "; diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index 3d48fb6059..ae85c7749a 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -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 "\n"; echo "\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 "\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 "\n"; echo "\n"; echo " ".$text['label-monthly_price']."\n"; @@ -797,7 +797,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo "
\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 "\n"; diff --git a/app/dialplan/dialplan_edit.php b/app/dialplan/dialplan_edit.php index 68ec9b3b1b..8f5c99ec31 100644 --- a/app/dialplan/dialplan_edit.php +++ b/app/dialplan/dialplan_edit.php @@ -786,7 +786,7 @@ else { echo "

\n"; echo ""; - 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']."

"; } diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index 5f7cd3c442..06edad79f4 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -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"; diff --git a/app/fax/fax_edit.php b/app/fax/fax_edit.php index 83fabbae3d..f4fd232a3c 100644 --- a/app/fax/fax_edit.php +++ b/app/fax/fax_edit.php @@ -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"; diff --git a/app/xml_cdr/v_xml_cdr_import.php b/app/xml_cdr/v_xml_cdr_import.php index 900b6086af..236940e143 100644 --- a/app/xml_cdr/v_xml_cdr_import.php +++ b/app/xml_cdr/v_xml_cdr_import.php @@ -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; diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php index 25fcb0e2e7..816ed04e6b 100644 --- a/app/xml_cdr/xml_cdr.php +++ b/app/xml_cdr/xml_cdr.php @@ -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 "".$text['label-price']."\n"; $col_count++; @@ -362,7 +362,7 @@ else { $col_count++; } echo "\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 " ".gmdate("G:i:s", $seconds)."\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]); diff --git a/app/xml_cdr/xml_cdr_inc.php b/app/xml_cdr/xml_cdr_inc.php index 34c8a23321..708e614362 100644 --- a/app/xml_cdr/xml_cdr_inc.php +++ b/app/xml_cdr/xml_cdr_inc.php @@ -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")) { diff --git a/core/domain_settings/domain_edit.php b/core/domain_settings/domain_edit.php index 870a2c9ad9..0afc577cb1 100644 --- a/core/domain_settings/domain_edit.php +++ b/core/domain_settings/domain_edit.php @@ -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."%' "; diff --git a/core/install/index.php b/core/install/index.php index 36d012f0f7..34faefef83 100644 --- a/core/install/index.php +++ b/core/install/index.php @@ -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 diff --git a/core/install/install_first_time.php b/core/install/install_first_time.php index f6ed320bf1..7a60766b93 100644 --- a/core/install/install_first_time.php +++ b/core/install/install_first_time.php @@ -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; diff --git a/core/install/resources/classes/install_fusionpbx.php b/core/install/resources/classes/install_fusionpbx.php index a889d908ff..c55e89fb9b 100644 --- a/core/install/resources/classes/install_fusionpbx.php +++ b/core/install/resources/classes/install_fusionpbx.php @@ -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 { diff --git a/core/user_settings/user_dashboard.php b/core/user_settings/user_dashboard.php index ed7f61a9d7..282fe09e5d 100644 --- a/core/user_settings/user_dashboard.php +++ b/core/user_settings/user_dashboard.php @@ -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 diff --git a/core/users/usersupdate.php b/core/users/usersupdate.php index 10bab4cc32..16d641a313 100644 --- a/core/users/usersupdate.php +++ b/core/users/usersupdate.php @@ -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."' "; diff --git a/index.php b/index.php index 757aefec39..1ffe4ab5d6 100644 --- a/index.php +++ b/index.php @@ -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 { diff --git a/login.php b/login.php index 0a9a01a7c6..75ff792782 100644 --- a/login.php +++ b/login.php @@ -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 { diff --git a/resources/classes/config.php b/resources/classes/config.php index a63ba0d03e..cc675d6933 100644 --- a/resources/classes/config.php +++ b/resources/classes/config.php @@ -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")) { diff --git a/resources/classes/database.php b/resources/classes/database.php index ef45601740..7cbcad0349 100644 --- a/resources/classes/database.php +++ b/resources/classes/database.php @@ -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"; diff --git a/resources/classes/destinations.php b/resources/classes/destinations.php index cff34ae040..f2657972b0 100644 --- a/resources/classes/destinations.php +++ b/resources/classes/destinations.php @@ -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); } diff --git a/resources/header.php b/resources/header.php index 6f792dfc5c..e8dc220901 100644 --- a/resources/header.php +++ b/resources/header.php @@ -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' "; diff --git a/resources/switch.php b/resources/switch.php index c073d23a7c..b4546c72a6 100644 --- a/resources/switch.php +++ b/resources/switch.php @@ -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(); } }