From 4321704a334b3792a45163140b5819f34d8aa0f1 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Sat, 16 Jan 2016 21:42:13 -0700 Subject: [PATCH 01/33] Rename the cisco provision files for consistency. --- resources/templates/provision/cisco/7940/directory.xml | 8 ++++---- ...{directory-enterprise.xml => directory_enterprise.xml} | 0 ...{directory-extensions.xml => directory_extensions.xml} | 0 .../{directory-personal.xml => directory_personal.xml} | 0 ...{directory-speed_dial.xml => directory_speed_dial.xml} | 0 resources/templates/provision/cisco/7960/directory.xml | 8 ++++---- ...{directory-enterprise.xml => directory_enterprise.xml} | 0 ...{directory-extensions.xml => directory_extensions.xml} | 0 .../{directory-personal.xml => directory_personal.xml} | 0 ...{directory-speed_dial.xml => directory_speed_dial.xml} | 0 10 files changed, 8 insertions(+), 8 deletions(-) rename resources/templates/provision/cisco/7940/{directory-enterprise.xml => directory_enterprise.xml} (100%) rename resources/templates/provision/cisco/7940/{directory-extensions.xml => directory_extensions.xml} (100%) rename resources/templates/provision/cisco/7940/{directory-personal.xml => directory_personal.xml} (100%) rename resources/templates/provision/cisco/7940/{directory-speed_dial.xml => directory_speed_dial.xml} (100%) rename resources/templates/provision/cisco/7960/{directory-enterprise.xml => directory_enterprise.xml} (100%) rename resources/templates/provision/cisco/7960/{directory-extensions.xml => directory_extensions.xml} (100%) rename resources/templates/provision/cisco/7960/{directory-personal.xml => directory_personal.xml} (100%) rename resources/templates/provision/cisco/7960/{directory-speed_dial.xml => directory_speed_dial.xml} (100%) diff --git a/resources/templates/provision/cisco/7940/directory.xml b/resources/templates/provision/cisco/7940/directory.xml index 6bb0637022..fa7ddca68d 100644 --- a/resources/templates/provision/cisco/7940/directory.xml +++ b/resources/templates/provision/cisco/7940/directory.xml @@ -3,20 +3,20 @@ Please choose... Our Phones - http://{$domain_name}/app/provision/file/directory-extensions.xml + http://{$domain_name}/app/provision/file/directory_extensions.xml Enterprise - http://{$domain_name}/app/provision/file/directory-enterprise.xml?mac={$mac} + http://{$domain_name}/app/provision/file/directory_enterprise.xml?mac={$mac} Speed Dial - http://{$domain_name}/app/provision/file/directory-speed_dial.xml?mac={$mac} + http://{$domain_name}/app/provision/file/directory_speed_dial.xml?mac={$mac} \ No newline at end of file diff --git a/resources/templates/provision/cisco/7940/directory-enterprise.xml b/resources/templates/provision/cisco/7940/directory_enterprise.xml similarity index 100% rename from resources/templates/provision/cisco/7940/directory-enterprise.xml rename to resources/templates/provision/cisco/7940/directory_enterprise.xml diff --git a/resources/templates/provision/cisco/7940/directory-extensions.xml b/resources/templates/provision/cisco/7940/directory_extensions.xml similarity index 100% rename from resources/templates/provision/cisco/7940/directory-extensions.xml rename to resources/templates/provision/cisco/7940/directory_extensions.xml diff --git a/resources/templates/provision/cisco/7940/directory-personal.xml b/resources/templates/provision/cisco/7940/directory_personal.xml similarity index 100% rename from resources/templates/provision/cisco/7940/directory-personal.xml rename to resources/templates/provision/cisco/7940/directory_personal.xml diff --git a/resources/templates/provision/cisco/7940/directory-speed_dial.xml b/resources/templates/provision/cisco/7940/directory_speed_dial.xml similarity index 100% rename from resources/templates/provision/cisco/7940/directory-speed_dial.xml rename to resources/templates/provision/cisco/7940/directory_speed_dial.xml diff --git a/resources/templates/provision/cisco/7960/directory.xml b/resources/templates/provision/cisco/7960/directory.xml index 6bb0637022..fa7ddca68d 100644 --- a/resources/templates/provision/cisco/7960/directory.xml +++ b/resources/templates/provision/cisco/7960/directory.xml @@ -3,20 +3,20 @@ Please choose... Our Phones - http://{$domain_name}/app/provision/file/directory-extensions.xml + http://{$domain_name}/app/provision/file/directory_extensions.xml Enterprise - http://{$domain_name}/app/provision/file/directory-enterprise.xml?mac={$mac} + http://{$domain_name}/app/provision/file/directory_enterprise.xml?mac={$mac} Speed Dial - http://{$domain_name}/app/provision/file/directory-speed_dial.xml?mac={$mac} + http://{$domain_name}/app/provision/file/directory_speed_dial.xml?mac={$mac} \ No newline at end of file diff --git a/resources/templates/provision/cisco/7960/directory-enterprise.xml b/resources/templates/provision/cisco/7960/directory_enterprise.xml similarity index 100% rename from resources/templates/provision/cisco/7960/directory-enterprise.xml rename to resources/templates/provision/cisco/7960/directory_enterprise.xml diff --git a/resources/templates/provision/cisco/7960/directory-extensions.xml b/resources/templates/provision/cisco/7960/directory_extensions.xml similarity index 100% rename from resources/templates/provision/cisco/7960/directory-extensions.xml rename to resources/templates/provision/cisco/7960/directory_extensions.xml diff --git a/resources/templates/provision/cisco/7960/directory-personal.xml b/resources/templates/provision/cisco/7960/directory_personal.xml similarity index 100% rename from resources/templates/provision/cisco/7960/directory-personal.xml rename to resources/templates/provision/cisco/7960/directory_personal.xml diff --git a/resources/templates/provision/cisco/7960/directory-speed_dial.xml b/resources/templates/provision/cisco/7960/directory_speed_dial.xml similarity index 100% rename from resources/templates/provision/cisco/7960/directory-speed_dial.xml rename to resources/templates/provision/cisco/7960/directory_speed_dial.xml From 23b4b7c9bf37b542c6afb9194897daa90ddef3e7 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Sun, 17 Jan 2016 00:01:13 -0700 Subject: [PATCH 02/33] Change $_SERVER['DOCUMENT_ROOT'].PROJECT_PATH to $_SERVER["PROJECT_ROOT"]. --- app/call_broadcast/call_broadcast_edit.php | 4 +-- app/call_centers/call_center_queue_edit.php | 3 +- app/contacts/contact_delete.php | 2 +- app/destinations/destination_edit.php | 10 +++---- app/dialplan/dialplan_edit.php | 2 +- app/extensions/extension_edit.php | 2 +- app/fax/fax_edit.php | 2 +- app/xml_cdr/v_xml_cdr_import.php | 4 +-- app/xml_cdr/xml_cdr.php | 6 ++-- app/xml_cdr/xml_cdr_inc.php | 2 +- core/domain_settings/domain_edit.php | 28 +++++++++---------- core/install/index.php | 2 +- core/install/install_first_time.php | 2 +- .../resources/classes/install_fusionpbx.php | 2 +- core/user_settings/user_dashboard.php | 4 +-- core/users/usersupdate.php | 2 +- index.php | 16 +++++------ login.php | 8 +++--- resources/classes/config.php | 4 +-- resources/classes/database.php | 8 +++--- resources/classes/destinations.php | 2 +- resources/header.php | 2 +- resources/switch.php | 20 ++++++------- 23 files changed, 68 insertions(+), 69 deletions(-) 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(); } } From 1c5945395266bad2148d6d84c4c6cb2a3d66e163 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Sun, 17 Jan 2016 14:17:12 -0700 Subject: [PATCH 03/33] Add a new table v_contact_users. --- app/contacts/app_config.php | 55 +++++++++++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 9 deletions(-) diff --git a/app/contacts/app_config.php b/app/contacts/app_config.php index de26c0be08..f3f858a156 100644 --- a/app/contacts/app_config.php +++ b/app/contacts/app_config.php @@ -294,7 +294,7 @@ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; - $y = 1; //table array index + $y++; //table array index $apps[$x]['db'][$y]['table'] = "v_contact_addresses"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_address_uuid"; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; @@ -374,7 +374,7 @@ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the description."; $z++; - $y = 2; //table array index + $y++; //table array index $apps[$x]['db'][$y]['table'] = "v_contact_phones"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_phone_uuid"; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; @@ -438,7 +438,7 @@ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the description."; $z++; - $y = 3; //table array index + $y++; //table array index $apps[$x]['db'][$y]['table'] = "v_contact_notes"; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "id"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "contacts_note_id"; @@ -496,7 +496,44 @@ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; - $y = 4; //table array index + $y++; //table array index + $apps[$x]['db'][$y]['table'] = "v_contact_users"; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_user_uuid"; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; + $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "primary"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "domain_uuid"; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; + $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign"; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_domains"; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "domain_uuid"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_uuid"; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; + $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign"; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_contacts"; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "contact_uuid"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "user_uuid"; + $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; + $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = "char(36)"; + $apps[$x]['db'][$y]['fields'][$z]['key']['type'] = "foreign"; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = "v_users"; + $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = "user_uuid"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; + $z++; + + $y++; //table array index $apps[$x]['db'][$y]['table'] = "v_contact_groups"; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = "contact_group_uuid"; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = "contact_groups_uuid"; @@ -534,7 +571,7 @@ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; - $y = 5; //table array index + $y++; //table array index $apps[$x]['db'][$y]['table'] = "v_contact_settings"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_setting_uuid"; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; @@ -585,7 +622,7 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; - $y = 6; //table array index + $y++; //table array index $apps[$x]['db'][$y]['table'] = "v_contact_relations"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_relation_uuid"; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; @@ -622,7 +659,7 @@ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ""; $z++; - $y = 7; //table array index + $y++; //table array index $apps[$x]['db'][$y]['table'] = "v_contact_emails"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_email_uuid"; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; @@ -666,7 +703,7 @@ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the email description."; $z++; - $y = 8; //table array index + $y++; //table array index $apps[$x]['db'][$y]['table'] = "v_contact_urls"; $apps[$x]['db'][$y]['fields'][$z]['name'] = "contact_url_uuid"; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = "uuid"; @@ -714,7 +751,7 @@ $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = "Enter the URL description."; $z++; - $y = 9; //table array index + $y++; //table array index $apps[$x]['db'][$y]['table'] = 'v_contact_times'; $apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid'; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid'; From e9d8605c0db5db6310e48d699f97045cc7ae5bd5 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Sun, 17 Jan 2016 16:16:51 -0700 Subject: [PATCH 04/33] Assign the user that created the contact to the user that created it. When deleting a contact delete the user assigned to it. --- app/contacts/contact_delete.php | 10 +- app/contacts/contact_edit.php | 246 +++++++++++++++----------------- 2 files changed, 128 insertions(+), 128 deletions(-) diff --git a/app/contacts/contact_delete.php b/app/contacts/contact_delete.php index 1b05e71140..a3b1732152 100644 --- a/app/contacts/contact_delete.php +++ b/app/contacts/contact_delete.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2012 + Portions created by the Initial Developer are Copyright (C) 2008-2015 the Initial Developer. All Rights Reserved. Contributor(s): @@ -106,6 +106,14 @@ if (strlen($contact_uuid) > 0) { $prep_statement->execute(); unset($prep_statement, $sql); + //delete contact users + $sql = "delete from v_contact_users "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + unset($prep_statement, $sql); + //delete contact groups $sql = "delete from v_contact_groups "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index db8e56fb92..5aa21cad3d 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -117,141 +117,133 @@ else { //add or update the database if ($_POST["persistformvar"] != "true") { - //update last modified - $sql = "update v_contacts set "; - $sql .= "last_mod_date = now(), "; - $sql .= "last_mod_user = '".$_SESSION['username']."' "; - $sql .= "where domain_uuid = '".$domain_uuid."' "; - $sql .= "and contact_uuid = '".$contact_uuid."' "; - $db->exec(check_sql($sql)); - unset($sql); + //add the contact + if ($action == "add") { + $contact_uuid = uuid(); + $sql = "insert into v_contacts "; + $sql .= "( "; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "contact_type, "; + $sql .= "contact_organization, "; + $sql .= "contact_name_prefix, "; + $sql .= "contact_name_given, "; + $sql .= "contact_name_middle, "; + $sql .= "contact_name_family, "; + $sql .= "contact_name_suffix, "; + $sql .= "contact_nickname, "; + $sql .= "contact_title, "; + $sql .= "contact_category, "; + $sql .= "contact_role, "; + $sql .= "contact_time_zone, "; + $sql .= "contact_note, "; + $sql .= "last_mod_date, "; + $sql .= "last_mod_user "; + $sql .= ") "; + $sql .= "values "; + $sql .= "( "; + $sql .= "'".$_SESSION['domain_uuid']."', "; + $sql .= "'".$contact_uuid."', "; + $sql .= "'".$contact_type."', "; + $sql .= "'".$contact_organization."', "; + $sql .= "'".$contact_name_prefix."', "; + $sql .= "'".$contact_name_given."', "; + $sql .= "'".$contact_name_middle."', "; + $sql .= "'".$contact_name_family."', "; + $sql .= "'".$contact_name_suffix."', "; + $sql .= "'".$contact_nickname."', "; + $sql .= "'".$contact_title."', "; + $sql .= "'".$contact_category."', "; + $sql .= "'".$contact_role."', "; + $sql .= "'".$contact_time_zone."', "; + $sql .= "'".$contact_note."', "; + $sql .= "now(), "; + $sql .= "'".$_SESSION['username']."' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); - if ($action == "add") { - $contact_uuid = uuid(); - $sql = "insert into v_contacts "; - $sql .= "( "; - $sql .= "domain_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "contact_type, "; - $sql .= "contact_organization, "; - $sql .= "contact_name_prefix, "; - $sql .= "contact_name_given, "; - $sql .= "contact_name_middle, "; - $sql .= "contact_name_family, "; - $sql .= "contact_name_suffix, "; - $sql .= "contact_nickname, "; - $sql .= "contact_title, "; - $sql .= "contact_category, "; - $sql .= "contact_role, "; - $sql .= "contact_time_zone, "; - $sql .= "contact_note, "; - $sql .= "last_mod_date, "; - $sql .= "last_mod_user "; - $sql .= ") "; - $sql .= "values "; - $sql .= "( "; - $sql .= "'".$_SESSION['domain_uuid']."', "; - $sql .= "'".$contact_uuid."', "; - $sql .= "'".$contact_type."', "; - $sql .= "'".$contact_organization."', "; - $sql .= "'".$contact_name_prefix."', "; - $sql .= "'".$contact_name_given."', "; - $sql .= "'".$contact_name_middle."', "; - $sql .= "'".$contact_name_family."', "; - $sql .= "'".$contact_name_suffix."', "; - $sql .= "'".$contact_nickname."', "; - $sql .= "'".$contact_title."', "; - $sql .= "'".$contact_category."', "; - $sql .= "'".$contact_role."', "; - $sql .= "'".$contact_time_zone."', "; - $sql .= "'".$contact_note."', "; - $sql .= "now(), "; - $sql .= "'".$_SESSION['username']."' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); + $_SESSION["message"] = $text['message-add']; + $location = "contact_edit.php?id=".$contact_uuid; + } //if ($action == "add") - $_SESSION["message"] = $text['message-add']; - $location = "contact_edit.php?id=".$contact_uuid; - } //if ($action == "add") + //assign the contact to the user that added the contact + if ($action == "add") { + $sql = "insert into v_contact_users "; + $sql .= "( "; + $sql .= "contact_user_uuid, "; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "user_uuid "; + $sql .= ") "; + $sql .= "values "; + $sql .= "( "; + $sql .= "'".uuid()."', "; + $sql .= "'".$domain_uuid."', "; + $sql .= "'".$contact_uuid."', "; + $sql .= "'".$_SESSION["user_uuid"]."' "; + $sql .= ") "; + $db->exec(check_sql($sql)); + unset($sql); + } - //if contact is shared, remove contact group record containing user's uuid - if ($_POST['contact_shared'] == 'true') { - $sql = "delete from v_contact_groups "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and contact_uuid = '".$contact_uuid."' "; - $sql .= "and group_uuid = '".$_SESSION["user_uuid"]."' "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - unset($prep_statement, $sql); - $group_uuid = $_POST['group_uuid']; - } - //if private contact, delete any groups currently assigned, set group uuid to user's uuid - else { - $sql = "delete from v_contact_groups "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and contact_uuid = '".$contact_uuid."' "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - unset($prep_statement, $sql); - $group_uuid = $_SESSION["user_uuid"]; - } + //assign the contact to the group + if ($group_uuid != '') { + $sql = "insert into v_contact_groups "; + $sql .= "( "; + $sql .= "contact_group_uuid, "; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "group_uuid "; + $sql .= ") "; + $sql .= "values "; + $sql .= "( "; + $sql .= "'".uuid()."', "; + $sql .= "'".$domain_uuid."', "; + $sql .= "'".$contact_uuid."', "; + $sql .= "'".$group_uuid."' "; + $sql .= ") "; + $db->exec(check_sql($sql)); + unset($sql); + } - //handle insertion of contact group (or private contact, if not shared) - if ($group_uuid != '') { - $sql = "insert into v_contact_groups "; - $sql .= "( "; - $sql .= "contact_group_uuid, "; - $sql .= "domain_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "group_uuid "; - $sql .= ") "; - $sql .= "values "; - $sql .= "( "; - $sql .= "'".uuid()."', "; - $sql .= "'".$domain_uuid."', "; - $sql .= "'".$contact_uuid."', "; - $sql .= "'".$group_uuid."' "; - $sql .= ") "; - $db->exec(check_sql($sql)); - unset($sql); - } + //update the contact + if ($action == "update") { + $sql = "update v_contacts set "; + $sql .= "contact_type = '".$contact_type."', "; + $sql .= "contact_organization = '".$contact_organization."', "; + $sql .= "contact_name_prefix = '".$contact_name_prefix."', "; + $sql .= "contact_name_given = '".$contact_name_given."', "; + $sql .= "contact_name_middle = '".$contact_name_middle."', "; + $sql .= "contact_name_family = '".$contact_name_family."', "; + $sql .= "contact_name_suffix = '".$contact_name_suffix."', "; + $sql .= "contact_nickname = '".$contact_nickname."', "; + $sql .= "contact_title = '".$contact_title."', "; + $sql .= "contact_category = '".$contact_category."', "; + $sql .= "contact_role = '".$contact_role."', "; + $sql .= "contact_time_zone = '".$contact_time_zone."', "; + $sql .= "contact_note = '".$contact_note."', "; + $sql .= "last_mod_date = now(), "; + $sql .= "last_mod_user = '".$_SESSION['username']."' "; + $sql .= "where domain_uuid = '".$domain_uuid."' "; + $sql .= "and contact_uuid = '".$contact_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); - if ($action == "update") { - $sql = "update v_contacts set "; - $sql .= "contact_type = '".$contact_type."', "; - $sql .= "contact_organization = '".$contact_organization."', "; - $sql .= "contact_name_prefix = '".$contact_name_prefix."', "; - $sql .= "contact_name_given = '".$contact_name_given."', "; - $sql .= "contact_name_middle = '".$contact_name_middle."', "; - $sql .= "contact_name_family = '".$contact_name_family."', "; - $sql .= "contact_name_suffix = '".$contact_name_suffix."', "; - $sql .= "contact_nickname = '".$contact_nickname."', "; - $sql .= "contact_title = '".$contact_title."', "; - $sql .= "contact_category = '".$contact_category."', "; - $sql .= "contact_role = '".$contact_role."', "; - $sql .= "contact_time_zone = '".$contact_time_zone."', "; - $sql .= "contact_note = '".$contact_note."', "; - $sql .= "last_mod_date = now(), "; - $sql .= "last_mod_user = '".$_SESSION['username']."' "; - $sql .= "where domain_uuid = '".$domain_uuid."' "; - $sql .= "and contact_uuid = '".$contact_uuid."' "; - $db->exec(check_sql($sql)); - unset($sql); - - $_SESSION["message"] = $text['message-update']; - $location = "contact_edit.php?id=".$contact_uuid; - } //if ($action == "update") + $_SESSION["message"] = $text['message-update']; + $location = "contact_edit.php?id=".$contact_uuid; + } //if ($action == "update") //handle redirect - if ($_POST['submit'] == $text['button-add']) { - $group_uuid = $_POST['group_uuid']; - //insert - $location = "contact_edit.php?id=".$contact_uuid; - } + if ($_POST['submit'] == $text['button-add']) { + $group_uuid = $_POST['group_uuid']; + //insert + $location = "contact_edit.php?id=".$contact_uuid; + } - header("Location: ".$location); - return; + //redirect the browser + header("Location: ".$location); + return; } //if ($_POST["persistformvar"] != "true") } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) From 2669f6f1a9cc22eb44145609cb7398f4ce315045 Mon Sep 17 00:00:00 2001 From: Mafoo Date: Sun, 17 Jan 2016 20:06:13 +0000 Subject: [PATCH 05/33] Added check for if .project.ROOT is missing If a installation is missing the .project.ROOT previously it would just use the last search path as the project root (wrong) this will cause a Exception should it be unable to find it --- app/access_controls/root.php | 3 +++ app/adminer/root.php | 3 +++ app/backup/root.php | 3 +++ app/call_block/root.php | 3 +++ app/call_broadcast/root.php | 3 +++ app/call_center_active/root.php | 3 +++ app/call_centers/root.php | 3 +++ app/call_flows/root.php | 3 +++ app/calls/root.php | 3 +++ app/calls_active/root.php | 3 +++ app/click_to_call/root.php | 3 +++ app/conference_centers/root.php | 3 +++ app/conferences/root.php | 3 +++ app/conferences_active/root.php | 3 +++ app/contacts/root.php | 3 +++ app/destinations/root.php | 3 +++ app/devices/root.php | 3 +++ app/dialplan/root.php | 3 +++ app/dialplan_inbound/root.php | 3 +++ app/dialplan_outbound/root.php | 3 +++ app/edit/root.php | 3 +++ app/emails/root.php | 3 +++ app/exec/root.php | 3 +++ app/extensions/root.php | 3 +++ app/fax/root.php | 3 +++ app/fifo/root.php | 3 +++ app/fifo_list/root.php | 3 +++ app/follow_me/root.php | 3 +++ app/gateways/root.php | 3 +++ app/ivr_menus/root.php | 3 +++ app/log_viewer/root.php | 3 +++ app/modules/root.php | 3 +++ app/music_on_hold/root.php | 3 +++ app/operator_panel/root.php | 3 +++ app/phrases/root.php | 3 +++ app/provision/root.php | 3 +++ app/recordings/root.php | 3 +++ app/registrations/root.php | 3 +++ app/ring_groups/root.php | 3 +++ app/services/root.php | 3 +++ app/settings/root.php | 3 +++ app/sip_profiles/root.php | 3 +++ app/sip_status/root.php | 3 +++ app/sql_query/root.php | 3 +++ app/system/root.php | 3 +++ app/time_conditions/root.php | 3 +++ app/traffic_graph/root.php | 3 +++ app/vars/root.php | 3 +++ app/voicemail_greetings/root.php | 3 +++ app/voicemails/root.php | 3 +++ app/xml_cdr/root.php | 3 +++ core/apps/root.php | 3 +++ core/databases/root.php | 3 +++ core/default_settings/root.php | 3 +++ core/domain_settings/root.php | 3 +++ core/install/root.php | 3 +++ core/menu/root.php | 3 +++ core/notifications/root.php | 3 +++ core/upgrade/root.php | 3 +++ core/user_settings/root.php | 3 +++ core/users/root.php | 3 +++ resources/captcha/root.php | 3 +++ resources/classes/root.php | 3 +++ resources/root.php | 3 +++ root.php | 3 +++ secure/root.php | 3 +++ themes/accessible/root.php | 3 +++ themes/enhanced/root.php | 3 +++ themes/minimized/root.php | 3 +++ 69 files changed, 207 insertions(+) diff --git a/app/access_controls/root.php b/app/access_controls/root.php index 899238f027..2f0f086baa 100644 --- a/app/access_controls/root.php +++ b/app/access_controls/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/adminer/root.php b/app/adminer/root.php index 899238f027..2f0f086baa 100644 --- a/app/adminer/root.php +++ b/app/adminer/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/backup/root.php b/app/backup/root.php index 899238f027..2f0f086baa 100755 --- a/app/backup/root.php +++ b/app/backup/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/call_block/root.php b/app/call_block/root.php index 899238f027..2f0f086baa 100644 --- a/app/call_block/root.php +++ b/app/call_block/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/call_broadcast/root.php b/app/call_broadcast/root.php index 899238f027..2f0f086baa 100644 --- a/app/call_broadcast/root.php +++ b/app/call_broadcast/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/call_center_active/root.php b/app/call_center_active/root.php index 899238f027..2f0f086baa 100644 --- a/app/call_center_active/root.php +++ b/app/call_center_active/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/call_centers/root.php b/app/call_centers/root.php index 899238f027..2f0f086baa 100644 --- a/app/call_centers/root.php +++ b/app/call_centers/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/call_flows/root.php b/app/call_flows/root.php index 899238f027..2f0f086baa 100644 --- a/app/call_flows/root.php +++ b/app/call_flows/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/calls/root.php b/app/calls/root.php index 899238f027..2f0f086baa 100644 --- a/app/calls/root.php +++ b/app/calls/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/calls_active/root.php b/app/calls_active/root.php index 899238f027..2f0f086baa 100644 --- a/app/calls_active/root.php +++ b/app/calls_active/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/click_to_call/root.php b/app/click_to_call/root.php index 899238f027..2f0f086baa 100644 --- a/app/click_to_call/root.php +++ b/app/click_to_call/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/conference_centers/root.php b/app/conference_centers/root.php index 899238f027..2f0f086baa 100644 --- a/app/conference_centers/root.php +++ b/app/conference_centers/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/conferences/root.php b/app/conferences/root.php index 899238f027..2f0f086baa 100644 --- a/app/conferences/root.php +++ b/app/conferences/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/conferences_active/root.php b/app/conferences_active/root.php index 899238f027..2f0f086baa 100644 --- a/app/conferences_active/root.php +++ b/app/conferences_active/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/contacts/root.php b/app/contacts/root.php index 899238f027..2f0f086baa 100644 --- a/app/contacts/root.php +++ b/app/contacts/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/destinations/root.php b/app/destinations/root.php index 899238f027..2f0f086baa 100644 --- a/app/destinations/root.php +++ b/app/destinations/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/devices/root.php b/app/devices/root.php index 899238f027..2f0f086baa 100644 --- a/app/devices/root.php +++ b/app/devices/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/dialplan/root.php b/app/dialplan/root.php index 899238f027..2f0f086baa 100644 --- a/app/dialplan/root.php +++ b/app/dialplan/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/dialplan_inbound/root.php b/app/dialplan_inbound/root.php index 899238f027..2f0f086baa 100644 --- a/app/dialplan_inbound/root.php +++ b/app/dialplan_inbound/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/dialplan_outbound/root.php b/app/dialplan_outbound/root.php index 899238f027..2f0f086baa 100644 --- a/app/dialplan_outbound/root.php +++ b/app/dialplan_outbound/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/edit/root.php b/app/edit/root.php index 899238f027..2f0f086baa 100644 --- a/app/edit/root.php +++ b/app/edit/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/emails/root.php b/app/emails/root.php index 899238f027..2f0f086baa 100644 --- a/app/emails/root.php +++ b/app/emails/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/exec/root.php b/app/exec/root.php index 899238f027..2f0f086baa 100644 --- a/app/exec/root.php +++ b/app/exec/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/extensions/root.php b/app/extensions/root.php index 899238f027..2f0f086baa 100644 --- a/app/extensions/root.php +++ b/app/extensions/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/fax/root.php b/app/fax/root.php index 899238f027..2f0f086baa 100644 --- a/app/fax/root.php +++ b/app/fax/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/fifo/root.php b/app/fifo/root.php index 899238f027..2f0f086baa 100644 --- a/app/fifo/root.php +++ b/app/fifo/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/fifo_list/root.php b/app/fifo_list/root.php index 899238f027..2f0f086baa 100644 --- a/app/fifo_list/root.php +++ b/app/fifo_list/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/follow_me/root.php b/app/follow_me/root.php index 899238f027..2f0f086baa 100644 --- a/app/follow_me/root.php +++ b/app/follow_me/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/gateways/root.php b/app/gateways/root.php index 899238f027..2f0f086baa 100644 --- a/app/gateways/root.php +++ b/app/gateways/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/ivr_menus/root.php b/app/ivr_menus/root.php index 899238f027..2f0f086baa 100644 --- a/app/ivr_menus/root.php +++ b/app/ivr_menus/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/log_viewer/root.php b/app/log_viewer/root.php index 899238f027..2f0f086baa 100644 --- a/app/log_viewer/root.php +++ b/app/log_viewer/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/modules/root.php b/app/modules/root.php index 899238f027..2f0f086baa 100644 --- a/app/modules/root.php +++ b/app/modules/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/music_on_hold/root.php b/app/music_on_hold/root.php index 899238f027..2f0f086baa 100644 --- a/app/music_on_hold/root.php +++ b/app/music_on_hold/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/operator_panel/root.php b/app/operator_panel/root.php index 899238f027..2f0f086baa 100644 --- a/app/operator_panel/root.php +++ b/app/operator_panel/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/phrases/root.php b/app/phrases/root.php index 899238f027..2f0f086baa 100644 --- a/app/phrases/root.php +++ b/app/phrases/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/provision/root.php b/app/provision/root.php index 899238f027..2f0f086baa 100644 --- a/app/provision/root.php +++ b/app/provision/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/recordings/root.php b/app/recordings/root.php index 899238f027..2f0f086baa 100644 --- a/app/recordings/root.php +++ b/app/recordings/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/registrations/root.php b/app/registrations/root.php index 899238f027..2f0f086baa 100644 --- a/app/registrations/root.php +++ b/app/registrations/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/ring_groups/root.php b/app/ring_groups/root.php index 899238f027..2f0f086baa 100644 --- a/app/ring_groups/root.php +++ b/app/ring_groups/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/services/root.php b/app/services/root.php index 899238f027..2f0f086baa 100644 --- a/app/services/root.php +++ b/app/services/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/settings/root.php b/app/settings/root.php index 899238f027..2f0f086baa 100644 --- a/app/settings/root.php +++ b/app/settings/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/sip_profiles/root.php b/app/sip_profiles/root.php index 899238f027..2f0f086baa 100644 --- a/app/sip_profiles/root.php +++ b/app/sip_profiles/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/sip_status/root.php b/app/sip_status/root.php index 899238f027..2f0f086baa 100644 --- a/app/sip_status/root.php +++ b/app/sip_status/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/sql_query/root.php b/app/sql_query/root.php index 899238f027..2f0f086baa 100644 --- a/app/sql_query/root.php +++ b/app/sql_query/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/system/root.php b/app/system/root.php index 899238f027..2f0f086baa 100644 --- a/app/system/root.php +++ b/app/system/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/time_conditions/root.php b/app/time_conditions/root.php index 899238f027..2f0f086baa 100644 --- a/app/time_conditions/root.php +++ b/app/time_conditions/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/traffic_graph/root.php b/app/traffic_graph/root.php index 899238f027..2f0f086baa 100644 --- a/app/traffic_graph/root.php +++ b/app/traffic_graph/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/vars/root.php b/app/vars/root.php index 899238f027..2f0f086baa 100644 --- a/app/vars/root.php +++ b/app/vars/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/voicemail_greetings/root.php b/app/voicemail_greetings/root.php index 899238f027..2f0f086baa 100644 --- a/app/voicemail_greetings/root.php +++ b/app/voicemail_greetings/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/voicemails/root.php b/app/voicemails/root.php index 899238f027..2f0f086baa 100644 --- a/app/voicemails/root.php +++ b/app/voicemails/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/app/xml_cdr/root.php b/app/xml_cdr/root.php index 899238f027..2f0f086baa 100644 --- a/app/xml_cdr/root.php +++ b/app/xml_cdr/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/core/apps/root.php b/core/apps/root.php index 899238f027..2f0f086baa 100644 --- a/core/apps/root.php +++ b/core/apps/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/core/databases/root.php b/core/databases/root.php index 899238f027..2f0f086baa 100644 --- a/core/databases/root.php +++ b/core/databases/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/core/default_settings/root.php b/core/default_settings/root.php index 899238f027..2f0f086baa 100644 --- a/core/default_settings/root.php +++ b/core/default_settings/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/core/domain_settings/root.php b/core/domain_settings/root.php index 899238f027..2f0f086baa 100644 --- a/core/domain_settings/root.php +++ b/core/domain_settings/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/core/install/root.php b/core/install/root.php index 899238f027..2f0f086baa 100644 --- a/core/install/root.php +++ b/core/install/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/core/menu/root.php b/core/menu/root.php index 899238f027..2f0f086baa 100644 --- a/core/menu/root.php +++ b/core/menu/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/core/notifications/root.php b/core/notifications/root.php index 899238f027..2f0f086baa 100644 --- a/core/notifications/root.php +++ b/core/notifications/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/core/upgrade/root.php b/core/upgrade/root.php index 899238f027..2f0f086baa 100644 --- a/core/upgrade/root.php +++ b/core/upgrade/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/core/user_settings/root.php b/core/user_settings/root.php index 899238f027..2f0f086baa 100644 --- a/core/user_settings/root.php +++ b/core/user_settings/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/core/users/root.php b/core/users/root.php index 899238f027..2f0f086baa 100644 --- a/core/users/root.php +++ b/core/users/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/resources/captcha/root.php b/resources/captcha/root.php index 899238f027..2f0f086baa 100644 --- a/resources/captcha/root.php +++ b/resources/captcha/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/resources/classes/root.php b/resources/classes/root.php index 899238f027..2f0f086baa 100644 --- a/resources/classes/root.php +++ b/resources/classes/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/resources/root.php b/resources/root.php index 899238f027..2f0f086baa 100644 --- a/resources/root.php +++ b/resources/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/root.php b/root.php index 899238f027..2f0f086baa 100644 --- a/root.php +++ b/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/secure/root.php b/secure/root.php index 899238f027..2f0f086baa 100644 --- a/secure/root.php +++ b/secure/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/themes/accessible/root.php b/themes/accessible/root.php index 899238f027..2f0f086baa 100644 --- a/themes/accessible/root.php +++ b/themes/accessible/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/themes/enhanced/root.php b/themes/enhanced/root.php index 899238f027..2f0f086baa 100644 --- a/themes/enhanced/root.php +++ b/themes/enhanced/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } diff --git a/themes/minimized/root.php b/themes/minimized/root.php index 899238f027..2f0f086baa 100644 --- a/themes/minimized/root.php +++ b/themes/minimized/root.php @@ -74,6 +74,9 @@ } $i++; } + if(!file_exists($path. '/.project.ROOT')){ + throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); } From e960c847d61c0619a7b5c263f89d02940760bc21 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 18 Jan 2016 14:15:21 -0700 Subject: [PATCH 06/33] Move the sql queries from the content in conference_room_edit.php --- .../conference_room_edit.php | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/app/conference_centers/conference_room_edit.php b/app/conference_centers/conference_room_edit.php index 9170244163..ed01b41a03 100644 --- a/app/conference_centers/conference_room_edit.php +++ b/app/conference_centers/conference_room_edit.php @@ -473,8 +473,28 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $enabled = $row["enabled"]; $description = $row["description"]; } - unset ($prep_statement); - } + unset ($prep_statement, $sql); + } + +//get the users array + $sql = "SELECT * FROM v_users "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "order by username asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $users = $prep_statement->fetchAll(PDO::FETCH_NAMED); + unset($prep_statement, $sql); + +//get the users assigned to this meeting + $sql = "SELECT * FROM v_users as u, v_meeting_users as m "; + $sql .= "where u.user_uuid = m.user_uuid "; + $sql .= "and m.domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and m.meeting_uuid = '$meeting_uuid' "; + $sql .= "order by u.username asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $meeting_users = $prep_statement->fetchAll(PDO::FETCH_NAMED); + unset($prep_statement, $sql); //set default profile if (strlen($profile) == 0) { $profile = 'default'; } @@ -572,56 +592,36 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo " "; if (if_group("superadmin") || if_group("admin")) { - - echo " "; - echo " ".$text['label-users'].""; - echo " "; - if ($action == "update") { - echo " \n"; - $sql = "SELECT * FROM v_users as u, v_meeting_users as m "; - $sql .= "where u.user_uuid = m.user_uuid "; - $sql .= "and m.domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and m.meeting_uuid = '$meeting_uuid' "; - $sql .= "order by u.username asc "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); - $result_count = count($result); - foreach($result as $field) { - echo " \n"; - echo " \n"; - echo " "; + echo " "; + echo "
".$field['username']."\n"; - if ($result_count > 1) { + echo "
".$text['label-users'].""; + if ($action == "update") { + echo " \n"; + foreach($meeting_users as $field) { + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; } - echo " \n"; - echo " \n"; + echo "
".$field['username']."\n"; echo " $v_link_label_delete\n"; + echo "
\n"; } - echo "
\n"; - } - - echo "
\n"; - $sql = "SELECT * FROM v_users "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "order by username asc "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - echo " "; - if ($action == "update") { - echo " \n"; - } - unset($sql, $result); - echo "
\n"; - echo " ".$text['description-users']."\n"; - echo " "; - echo " "; - + echo "
\n"; + echo " "; + if ($action == "update") { + echo " \n"; + } + unset($users); + echo "
\n"; + echo " ".$text['description-users']."\n"; + echo " "; + echo " "; } if (permission_exists('conference_room_profile')) { From b60f55525efdb3b55f074c17f04c2e6f86953139 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 18 Jan 2016 14:17:59 -0700 Subject: [PATCH 07/33] Add contact user list to contact_edit.php. --- app/contacts/contact_edit.php | 59 +++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index 5aa21cad3d..8f8155f990 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -63,7 +63,7 @@ else { } //get http post variables and set them to php variables - if (count($_POST)>0) { + if (count($_POST) > 0) { $contact_type = check_str($_POST["contact_type"]); $contact_organization = check_str($_POST["contact_organization"]); $contact_name_prefix = check_str($_POST["contact_name_prefix"]); @@ -272,9 +272,29 @@ else { $contact_time_zone = $row["contact_time_zone"]; $contact_note = $row["contact_note"]; } - unset ($prep_statement); + unset ($prep_statement, $sql); } +//get the users array + $sql = "SELECT * FROM v_users "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "order by username asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $users = $prep_statement->fetchAll(PDO::FETCH_NAMED); + unset($prep_statement, $sql); + +//get the users assigned to this contact + $sql = "SELECT * FROM v_contact_users as u, v_contact_users as c "; + $sql .= "where u.user_uuid = c.user_uuid "; + $sql .= "and m.domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and m.contact_uuid = '".$contact_uuid."' "; + $sql .= "order by u.username asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $contact_users = $prep_statement->fetchAll(PDO::FETCH_NAMED); + unset($prep_statement, $sql); + //show the header require_once "resources/header.php"; if ($action == "update") { @@ -284,7 +304,7 @@ else { $document['title'] = $text['title-contact-add']; } -// qr code generation +//qr code generation $_GET['type'] = "text"; $qr_vcard = true; include "contacts_vcard.php"; @@ -620,6 +640,39 @@ else { echo "\n"; echo ""; + if (if_group("superadmin") || if_group("admin")) { + echo " "; + echo " ".$text['label-users'].""; + echo " "; + if ($action == "update") { + echo " \n"; + foreach($contact_users as $field) { + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + } + echo "
".$field['username']."\n"; + echo " $v_link_label_delete\n"; + echo "
\n"; + } + echo "
\n"; + echo " "; + if ($action == "update") { + echo " \n"; + } + unset($users); + echo "
\n"; + echo " ".$text['description-users']."\n"; + echo " "; + echo " "; + } + if (permission_exists('contact_group_view')) { echo "
\n"; echo "\n"; From 35c81981602bf56e92532b190ca2466a8ce97a1d Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 18 Jan 2016 14:35:44 -0700 Subject: [PATCH 08/33] Add the translations for Users, and add the new permissions. --- app/contacts/app_config.php | 16 ++++++++++++++++ app/contacts/app_languages.php | 20 ++++++++++++++++++++ app/contacts/contact_edit.php | 8 ++++---- 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/app/contacts/app_config.php b/app/contacts/app_config.php index f3f858a156..0d2323ec06 100644 --- a/app/contacts/app_config.php +++ b/app/contacts/app_config.php @@ -102,6 +102,22 @@ $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; $y++; + $apps[$x]['permissions'][$y]['name'] = "contact_user_view"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "contact_user_add"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "contact_user_edit"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; + $apps[$x]['permissions'][$y]['name'] = "contact_user_delete"; + $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; + $apps[$x]['permissions'][$y]['groups'][] = "admin"; + $y++; $apps[$x]['permissions'][$y]['name'] = "contact_email_view"; $apps[$x]['permissions'][$y]['groups'][] = "superadmin"; $apps[$x]['permissions'][$y]['groups'][] = "admin"; diff --git a/app/contacts/app_languages.php b/app/contacts/app_languages.php index 2e2031957f..517c637e33 100644 --- a/app/contacts/app_languages.php +++ b/app/contacts/app_languages.php @@ -1033,6 +1033,16 @@ $text['label-import_delimiter']['sv-se'] = "Avgränsare"; $text['label-import_delimiter']['de-at'] = "Trennzeichen"; $text['label-import_delimiter']['he'] = ""; +$text['label-users']['en-us'] = "Users"; +$text['label-users']['es-cl'] = "Usuarios"; +$text['label-users']['pt-pt'] = "Utilizadores"; +$text['label-users']['fr-fr'] = "Utilisateurs"; +$text['label-users']['pt-br'] = "Usuários"; +$text['label-users']['pl'] = "Użytkownicy"; +$text['label-users']['sv-se'] = "Användare"; +$text['label-users']['uk'] = "Користувачі"; +$text['label-users']['de-at'] = "Benutzer"; + $text['label-groups']['en-us'] = "Groups"; $text['label-groups']['es-cl'] = "Grupos"; $text['label-groups']['pt-pt'] = "Grupos"; @@ -2108,6 +2118,16 @@ $text['description-import_delimiter']['sv-se'] = "Välj avgränsare (comma or pi $text['description-import_delimiter']['de-at'] = "Wählen Sie das Trennzeichen (Beistrich oder Wagrechter Strich)"; $text['description-import_delimiter']['he'] = ""; +$text['description-users']['en-us'] = "Assign additional users as administrators of this conference room."; +$text['description-users']['es-cl'] = "Asignar usuarios adicionales como administradores de esta sala de conferencia."; +$text['description-users']['pt-pt'] = "Atribuir utilizadores adicionais como administradores da sala de conferência."; +$text['description-users']['fr-fr'] = "Ajouter des utilisateurs comme administrateurs des cette salle de conférence."; +$text['description-users']['pt-br'] = "Atribuir usuários adicionais como administradores da sala de conferência. "; +$text['description-users']['pl'] = "'Dodaj dodatkowych użytkowników jako administratorów tego pokoju konferencyjnego."; +$text['description-users']['sv-se'] = "Lägg till ytterligare användare som administratörer för detta konferensrum."; +$text['description-users']['uk'] = "Зв'язати додаткових користувачів як адміністраторів цього конференц-залу."; +$text['description-users']['de-at'] = "Weisen Sie diesem Konferenzraum weitere Administratoren zu. "; + $text['description-groups']['en-us'] = "Contacts assigned to a group are only visible to users in the group. Contacts not assigned to a group will be visible to all users in the domain."; $text['description-groups']['es-cl'] = "Contactos asignados a un grupo sólo son visibles para los usuarios del grupo. Los contactos no asignados a un grupo serán visibles para todos los usuarios del dominio."; $text['description-groups']['pt-pt'] = "Contatos atribuídos a um grupo só são visíveis para os usuários do grupo. Contatos não atribuídos a um grupo será visível para todos os usuários no domínio."; diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index 8f8155f990..433c65c077 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -285,10 +285,10 @@ else { unset($prep_statement, $sql); //get the users assigned to this contact - $sql = "SELECT * FROM v_contact_users as u, v_contact_users as c "; + $sql = "SELECT * FROM v_contacts as u, v_contact_users as c "; $sql .= "where u.user_uuid = c.user_uuid "; - $sql .= "and m.domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and m.contact_uuid = '".$contact_uuid."' "; + $sql .= "and u.domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and u.contact_uuid = '".$contact_uuid."' "; $sql .= "order by u.username asc "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); @@ -640,7 +640,7 @@ else { echo "\n"; echo "
"; - if (if_group("superadmin") || if_group("admin")) { + if (permission_exists('contact_user_view')) { echo " "; echo " ".$text['label-users'].""; echo " "; From 69de2cacacbe4f1bba40cc3d299300d5bafa83ba Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 18 Jan 2016 14:44:05 -0700 Subject: [PATCH 09/33] Fix the contact page layout. --- app/contacts/contact_edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index 433c65c077..80fbe052b1 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -638,7 +638,6 @@ else { echo $text['description-shared']."\n"; echo "\n"; echo "\n"; - echo ""; if (permission_exists('contact_user_view')) { echo " "; @@ -672,6 +671,7 @@ else { echo " "; echo " "; } + echo ""; if (permission_exists('contact_group_view')) { echo "
\n"; From 08625735e968c78f796c4b9668e45b33c148964f Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 18 Jan 2016 15:02:34 -0700 Subject: [PATCH 10/33] Update the sql query that lists the assigned users to specific contacts. --- app/contacts/contact_edit.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index 80fbe052b1..835eae922c 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -285,10 +285,11 @@ else { unset($prep_statement, $sql); //get the users assigned to this contact - $sql = "SELECT * FROM v_contacts as u, v_contact_users as c "; - $sql .= "where u.user_uuid = c.user_uuid "; - $sql .= "and u.domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and u.contact_uuid = '".$contact_uuid."' "; + $sql = "SELECT u.username, u.user_uuid, a.contact_user_uuid FROM v_contacts as c, v_users as u, v_contact_users as a "; + $sql .= "where c.contact_uuid = '".$contact_uuid."' "; + $sql .= "and c.domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and u.user_uuid = a.user_uuid "; + $sql .= "and c.contact_uuid = a.contact_uuid "; $sql .= "order by u.username asc "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); From 1474b51779d208c18b4d230f8c7880ab873ec4dc Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 18 Jan 2016 16:53:19 -0700 Subject: [PATCH 11/33] Update permissions on contact_edit and add ability to delete a user that is assigned to the contact. --- app/contacts/contact_edit.php | 148 +++++++++++++++++++++------------- 1 file changed, 91 insertions(+), 57 deletions(-) diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index 835eae922c..b84d824f94 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -26,7 +26,7 @@ require_once "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; -if (permission_exists('contact_edit')) { +if (permission_exists('contact_view')) { //access granted } else { @@ -64,6 +64,7 @@ else { //get http post variables and set them to php variables if (count($_POST) > 0) { + $user_uuid = check_str($_POST["user_uuid"]); $contact_type = check_str($_POST["contact_type"]); $contact_organization = check_str($_POST["contact_organization"]); $contact_name_prefix = check_str($_POST["contact_name_prefix"]); @@ -79,6 +80,25 @@ else { $contact_note = check_str($_POST["contact_note"]); } +//delete the user + if ($_GET["a"] == "delete" && permission_exists('contact_user_delete')) { + if (strlen($_REQUEST["contact_user_uuid"]) > 0) { + //set the variables + $contact_uuid = check_str($_REQUEST["contact_uuid"]); + $contact_user_uuid = check_str($_REQUEST["contact_user_uuid"]); + //delete the assigned user from the contact + $sql = "delete from v_contact_users "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and contact_user_uuid = '$contact_user_uuid' "; + $db->exec(check_sql($sql)); + unset($sql); + } + + $_SESSION["message"] = $text['message-delete']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } + //process the form data if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { @@ -118,7 +138,7 @@ else { if ($_POST["persistformvar"] != "true") { //add the contact - if ($action == "add") { + if ($action == "add" && permission_exists('contact_add')) { $contact_uuid = uuid(); $sql = "insert into v_contacts "; $sql .= "( "; @@ -167,48 +187,8 @@ else { $location = "contact_edit.php?id=".$contact_uuid; } //if ($action == "add") - //assign the contact to the user that added the contact - if ($action == "add") { - $sql = "insert into v_contact_users "; - $sql .= "( "; - $sql .= "contact_user_uuid, "; - $sql .= "domain_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "user_uuid "; - $sql .= ") "; - $sql .= "values "; - $sql .= "( "; - $sql .= "'".uuid()."', "; - $sql .= "'".$domain_uuid."', "; - $sql .= "'".$contact_uuid."', "; - $sql .= "'".$_SESSION["user_uuid"]."' "; - $sql .= ") "; - $db->exec(check_sql($sql)); - unset($sql); - } - - //assign the contact to the group - if ($group_uuid != '') { - $sql = "insert into v_contact_groups "; - $sql .= "( "; - $sql .= "contact_group_uuid, "; - $sql .= "domain_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "group_uuid "; - $sql .= ") "; - $sql .= "values "; - $sql .= "( "; - $sql .= "'".uuid()."', "; - $sql .= "'".$domain_uuid."', "; - $sql .= "'".$contact_uuid."', "; - $sql .= "'".$group_uuid."' "; - $sql .= ") "; - $db->exec(check_sql($sql)); - unset($sql); - } - //update the contact - if ($action == "update") { + if ($action == "update" && permission_exists('contact_edit')) { $sql = "update v_contacts set "; $sql .= "contact_type = '".$contact_type."', "; $sql .= "contact_organization = '".$contact_organization."', "; @@ -234,10 +214,60 @@ else { $location = "contact_edit.php?id=".$contact_uuid; } //if ($action == "update") + //assign the contact to the user that added the contact + if ($action == "add" && !permission_exists('contact_user_add')) { + $user_uuid = $_SESSION["user_uuid"]; + } + + //add user to contact users table + if ($user_uuid != '') { + $contact_user_uuid = uuid(); + $sql = "insert into v_contact_users "; + $sql .= "("; + $sql .= "domain_uuid, "; + $sql .= "contact_user_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "user_uuid "; + $sql .= ") "; + $sql .= "values "; + $sql .= "("; + $sql .= "'$domain_uuid', "; + $sql .= "'$contact_user_uuid', "; + $sql .= "'$contact_uuid', "; + $sql .= "'$user_uuid' "; + $sql .= ")"; + if (permission_exists('contact_user_add')) { + $db->exec(check_sql($sql)); + } + elseif ($action == "add") { + //add the contact to the user that created it + $db->exec(check_sql($sql)); + } + unset($sql); + + //assign the contact to the group + if ($group_uuid != '' && permission_exists('contact_group_add')) { + $sql = "insert into v_contact_groups "; + $sql .= "( "; + $sql .= "contact_group_uuid, "; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "group_uuid "; + $sql .= ") "; + $sql .= "values "; + $sql .= "( "; + $sql .= "'".uuid()."', "; + $sql .= "'".$domain_uuid."', "; + $sql .= "'".$contact_uuid."', "; + $sql .= "'".$group_uuid."' "; + $sql .= ") "; + $db->exec(check_sql($sql)); + unset($sql); + } + //handle redirect if ($_POST['submit'] == $text['button-add']) { $group_uuid = $_POST['group_uuid']; - //insert $location = "contact_edit.php?id=".$contact_uuid; } @@ -640,7 +670,7 @@ else { echo "\n"; echo "\n"; - if (permission_exists('contact_user_view')) { + if (permission_exists('contact_user_edit')) { echo " "; echo " ".$text['label-users'].""; echo " "; @@ -650,25 +680,29 @@ else { echo " \n"; echo " ".$field['username']."\n"; echo " \n"; - echo " $v_link_label_delete\n"; + if (permission_exists('contact_user_delete')) { + echo " $v_link_label_delete\n"; + } echo " \n"; echo " \n"; } echo " \n"; } echo "
\n"; - echo " \n"; + echo " \n"; + foreach($users as $field) { + echo " \n"; + } + echo " "; + if ($action == "update") { + echo " \n"; + } + unset($users); + echo "
\n"; + echo " ".$text['description-users']."\n"; } - echo " "; - if ($action == "update") { - echo " \n"; - } - unset($users); - echo "
\n"; - echo " ".$text['description-users']."\n"; echo " "; echo " "; } From 9e8cd7d3488d5a68a0d613d74c720f79ec423760 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 18 Jan 2016 16:55:26 -0700 Subject: [PATCH 12/33] Add a missing bracket. --- app/contacts/contact_edit.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index b84d824f94..9e9196dcef 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -244,6 +244,7 @@ else { $db->exec(check_sql($sql)); } unset($sql); + } //assign the contact to the group if ($group_uuid != '' && permission_exists('contact_group_add')) { From 38af18d127ecd223584120557dde87e92fbd633c Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 18 Jan 2016 17:42:32 -0700 Subject: [PATCH 13/33] Simply deleting contact users and groups. --- app/contacts/contact_edit.php | 38 +--------------- app/contacts/contact_group_delete.php | 65 +++++++++++++++++++++++++++ app/contacts/contact_user_delete.php | 65 +++++++++++++++++++++++++++ 3 files changed, 132 insertions(+), 36 deletions(-) create mode 100644 app/contacts/contact_group_delete.php create mode 100644 app/contacts/contact_user_delete.php diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index 9e9196dcef..ac87911c1c 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -38,21 +38,6 @@ else { $language = new text; $text = $language->get(); -//handle removal of contact group - if ($_GET['a'] == 'delete') { - $contact_uuid = $_GET["id"]; - $contact_group_uuid = $_GET["cgid"]; - $sql = "delete from v_contact_groups "; - $sql .= "where contact_uuid = '".$contact_uuid."' "; - $sql .= "and contact_group_uuid = '".$contact_group_uuid."' "; - $db->exec(check_sql($sql)); - unset($sql); - - $_SESSION["message"] = $text['message-update']; - header("Location: contact_edit.php?id=".$contact_uuid); - exit; - } - //action add or update if (isset($_REQUEST["id"])) { $action = "update"; @@ -80,25 +65,6 @@ else { $contact_note = check_str($_POST["contact_note"]); } -//delete the user - if ($_GET["a"] == "delete" && permission_exists('contact_user_delete')) { - if (strlen($_REQUEST["contact_user_uuid"]) > 0) { - //set the variables - $contact_uuid = check_str($_REQUEST["contact_uuid"]); - $contact_user_uuid = check_str($_REQUEST["contact_user_uuid"]); - //delete the assigned user from the contact - $sql = "delete from v_contact_users "; - $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - $sql .= "and contact_user_uuid = '$contact_user_uuid' "; - $db->exec(check_sql($sql)); - unset($sql); - } - - $_SESSION["message"] = $text['message-delete']; - header("Location: contact_edit.php?id=".$contact_uuid); - return; - } - //process the form data if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { @@ -682,7 +648,7 @@ else { echo " ".$field['username']."\n"; echo " \n"; if (permission_exists('contact_user_delete')) { - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; } echo " \n"; echo " \n"; @@ -739,7 +705,7 @@ else { echo " ".$field['group_name']."\n"; echo " \n"; if (permission_exists('contact_group_delete') || if_group("superadmin")) { - echo " $v_link_label_delete\n"; + echo " $v_link_label_delete\n"; } echo " \n"; echo "\n"; diff --git a/app/contacts/contact_group_delete.php b/app/contacts/contact_group_delete.php new file mode 100644 index 0000000000..b1fe25208b --- /dev/null +++ b/app/contacts/contact_group_delete.php @@ -0,0 +1,65 @@ + + Portions created by the Initial Developer are Copyright (C) 2008-2015 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane +*/ +require_once "root.php"; +require_once "resources/require.php"; +require_once "resources/check_auth.php"; +if (permission_exists('contact_group_delete')) { + //access granted +} +else { + echo "access denied"; + exit; +} + +// check if included in another file + if (!$included) { + //add multi-lingual support + $language = new text; + $text = $language->get(); + + if (count($_REQUEST) > 0) { + $contact_uuid = check_str($_REQUEST["contact_uuid"]); + $contact_group_uuid = $_REQUEST["id"]; + } + } + +//delete the group + if (is_uuid($contact_uuid) && is_uuid($contact_group_uuid)) { + $sql = "delete from v_contact_groups "; + $sql .= "where contact_uuid = '".$contact_uuid."' "; + $sql .= "and contact_group_uuid = '".$contact_group_uuid."' "; + $db->exec(check_sql($sql)); + unset($sql); + } + +//redirect the browser + if (!$included) { + $_SESSION["message"] = $text['message-delete']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } + +?> \ No newline at end of file diff --git a/app/contacts/contact_user_delete.php b/app/contacts/contact_user_delete.php new file mode 100644 index 0000000000..d8112c3751 --- /dev/null +++ b/app/contacts/contact_user_delete.php @@ -0,0 +1,65 @@ + + Portions created by the Initial Developer are Copyright (C) 2008-2015 + the Initial Developer. All Rights Reserved. + + Contributor(s): + Mark J Crane +*/ +require_once "root.php"; +require_once "resources/require.php"; +require_once "resources/check_auth.php"; +if (permission_exists('contact_group_delete')) { + //access granted +} +else { + echo "access denied"; + exit; +} + +// check if included in another file + if (!$included) { + //add multi-lingual support + $language = new text; + $text = $language->get(); + + if (count($_REQUEST) > 0) { + $contact_user_uuid = check_str($_REQUEST["id"]); + $contact_uuid = check_str($_REQUEST["contact_uuid"]); + } + } + +//delete the user + if (is_uuid($contact_uuid) && is_uuid($contact_user_uuid)) { + $sql = "delete from v_contact_users "; + $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= "and contact_user_uuid = '$contact_user_uuid' "; + $db->exec(check_sql($sql)); + unset($sql); + } + +//redirect the browser + if (!$included) { + $_SESSION["message"] = $text['message-delete']; + header("Location: contact_edit.php?id=".$contact_uuid); + return; + } + +?> \ No newline at end of file From bad658ac6889c5036c57d4c3859c842eec7c3563 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 18 Jan 2016 17:51:32 -0700 Subject: [PATCH 14/33] Move the contact user data to the correct table. --- app/contacts/app_defaults.php | 350 +++++++++++++++++++--------------- 1 file changed, 192 insertions(+), 158 deletions(-) diff --git a/app/contacts/app_defaults.php b/app/contacts/app_defaults.php index ad1094ffcc..5a03ed8ea4 100644 --- a/app/contacts/app_defaults.php +++ b/app/contacts/app_defaults.php @@ -2,183 +2,217 @@ if ($domains_processed == 1) { - require_once "resources/classes/schema.php"; - //populate new phone_label values, phone_type_* values - $obj = new schema; - $obj->db = $db; - $obj->db_type = $db_type; - $obj->schema(); - $field_exists = $obj->column_exists($db_name, 'v_contact_phones', 'phone_type'); //check if field exists - if ($field_exists) { - //add multi-lingual support - $language = new text; - $text = $language->get(); + $obj = new schema; + $obj->db = $db; + $obj->db_type = $db_type; + $obj->schema(); + $field_exists = $obj->column_exists($db_name, 'v_contact_phones', 'phone_type'); //check if field exists + if ($field_exists) { + //add multi-lingual support + $language = new text; + $text = $language->get(); - // populate phone_type_* values - $sql = "update v_contact_phones set phone_type_voice = '1' "; - $sql .= "where phone_type = 'home' "; - $sql .= "or phone_type = 'work' "; - $sql .= "or phone_type = 'voice' "; - $sql .= "or phone_type = 'voicemail' "; - $sql .= "or phone_type = 'cell' "; - $sql .= "or phone_type = 'pcs' "; - $db->exec(check_sql($sql)); - unset($sql); - $sql = "update v_contact_phones set phone_type_fax = '1' where phone_type = 'fax'"; - $db->exec(check_sql($sql)); - unset($sql); - $sql = "update v_contact_phones set phone_type_video = '1' where phone_type = 'video'"; - $db->exec(check_sql($sql)); - unset($sql); - $sql = "update v_contact_phones set phone_type_text = '1' where phone_type = 'cell' or phone_type = 'pager'"; - $db->exec(check_sql($sql)); - unset($sql); + // populate phone_type_* values + $sql = "update v_contact_phones set phone_type_voice = '1' "; + $sql .= "where phone_type = 'home' "; + $sql .= "or phone_type = 'work' "; + $sql .= "or phone_type = 'voice' "; + $sql .= "or phone_type = 'voicemail' "; + $sql .= "or phone_type = 'cell' "; + $sql .= "or phone_type = 'pcs' "; + $db->exec(check_sql($sql)); + unset($sql); - // migrate phone_type values to phone_label, correct case and make multilingual where appropriate - $default_phone_types = array('home','work','pref','voice','fax','msg','cell','pager','modem','car','isdn','video','pcs'); - $default_phone_labels = array($text['option-home'],$text['option-work'],'Pref','Voice',$text['option-fax'],$text['option-voicemail'],$text['option-mobile'],$text['option-pager'],'Modem','Car','ISDN','Video','PCS'); - foreach ($default_phone_types as $index => $old) { - $new = $default_phone_labels[$index]; - $sql = "update v_contact_phones set phone_label = '".$new."' where phone_type = '".$old."'"; + $sql = "update v_contact_phones set phone_type_fax = '1' where phone_type = 'fax'"; + $db->exec(check_sql($sql)); + unset($sql); + + $sql = "update v_contact_phones set phone_type_video = '1' where phone_type = 'video'"; + $db->exec(check_sql($sql)); + unset($sql); + + $sql = "update v_contact_phones set phone_type_text = '1' where phone_type = 'cell' or phone_type = 'pager'"; + $db->exec(check_sql($sql)); + unset($sql); + + // migrate phone_type values to phone_label, correct case and make multilingual where appropriate + $default_phone_types = array('home','work','pref','voice','fax','msg','cell','pager','modem','car','isdn','video','pcs'); + $default_phone_labels = array($text['option-home'],$text['option-work'],'Pref','Voice',$text['option-fax'],$text['option-voicemail'],$text['option-mobile'],$text['option-pager'],'Modem','Car','ISDN','Video','PCS'); + foreach ($default_phone_types as $index => $old) { + $new = $default_phone_labels[$index]; + $sql = "update v_contact_phones set phone_label = '".$new."' where phone_type = '".$old."'"; + $db->exec(check_sql($sql)); + unset($sql); + } + + // empty phone_type field to prevent confusion in the future + $sql = "update v_contact_phones set phone_type = null"; $db->exec(check_sql($sql)); unset($sql); } - - // empty phone_type field to prevent confusion in the future - $sql = "update v_contact_phones set phone_type = null"; - $db->exec(check_sql($sql)); - unset($sql); - } - unset($obj); + unset($obj); //populate primary email from deprecated field in v_contact table - $obj = new schema; - $obj->db = $db; - $obj->db_type = $db_type; - $obj->schema(); - $field_exists = $obj->column_exists($db_name, 'v_contacts', 'contact_email'); //check if field exists - if ($field_exists) { - // get email records - $sql = "select * from v_contacts where contact_email is not null and contact_email != ''"; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); - $result_count = count($result); - unset ($prep_statement, $sql); - if ($result_count > 0) { - foreach($result as $row) { - $sql = "insert into v_contact_emails "; - $sql .= "("; - $sql .= "domain_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "contact_email_uuid, "; - $sql .= "email_primary, "; - $sql .= "email_address"; - $sql .= ")"; - $sql .= "values "; - $sql .= "("; - $sql .= "'".$row['domain_uuid']."', "; - $sql .= "'".$row['contact_uuid']."', "; - $sql .= "'".uuid()."', "; - $sql .= "1, "; - $sql .= "'".$row['contact_email']."' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); + $obj = new schema; + $obj->db = $db; + $obj->db_type = $db_type; + $obj->schema(); + $field_exists = $obj->column_exists($db_name, 'v_contacts', 'contact_email'); //check if field exists + if ($field_exists) { + // get email records + $sql = "select * from v_contacts where contact_email is not null and contact_email != ''"; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + $result_count = count($result); + unset ($prep_statement, $sql); + if ($result_count > 0) { + foreach($result as $row) { + $sql = "insert into v_contact_emails "; + $sql .= "("; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "contact_email_uuid, "; + $sql .= "email_primary, "; + $sql .= "email_address"; + $sql .= ")"; + $sql .= "values "; + $sql .= "("; + $sql .= "'".$row['domain_uuid']."', "; + $sql .= "'".$row['contact_uuid']."', "; + $sql .= "'".uuid()."', "; + $sql .= "1, "; + $sql .= "'".$row['contact_email']."' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); - //verify and remove value from old field - $sql2 = "select email_address from v_contact_emails "; - $sql2 .= "where domain_uuid = '".$row['domain_uuid']."' "; - $sql2 .= "and contact_uuid = '".$row['contact_uuid']."' "; - $sql2 .= "and email_address = '".$row['contact_email']."' "; - $prep_statement2 = $db->prepare(check_sql($sql2)); - $prep_statement2->execute(); - $result2 = $prep_statement2->fetchAll(PDO::FETCH_NAMED); - $result_count2 = count($result2); - if ($result_count2 > 0) { - $sql3 = "update v_contacts set contact_email = '' "; - $sql3 .= "where domain_uuid = '".$row['domain_uuid']."' "; - $sql3 .= "and contact_uuid = '".$row['contact_uuid']."' "; - $prep_statement3 = $db->prepare(check_sql($sql3)); - $prep_statement3->execute(); - unset($sql3, $prep_statement3); + //verify and remove value from old field + $sql2 = "select email_address from v_contact_emails "; + $sql2 .= "where domain_uuid = '".$row['domain_uuid']."' "; + $sql2 .= "and contact_uuid = '".$row['contact_uuid']."' "; + $sql2 .= "and email_address = '".$row['contact_email']."' "; + $prep_statement2 = $db->prepare(check_sql($sql2)); + $prep_statement2->execute(); + $result2 = $prep_statement2->fetchAll(PDO::FETCH_NAMED); + $result_count2 = count($result2); + if ($result_count2 > 0) { + $sql3 = "update v_contacts set contact_email = '' "; + $sql3 .= "where domain_uuid = '".$row['domain_uuid']."' "; + $sql3 .= "and contact_uuid = '".$row['contact_uuid']."' "; + $prep_statement3 = $db->prepare(check_sql($sql3)); + $prep_statement3->execute(); + unset($sql3, $prep_statement3); + } + unset($sql2, $result2, $prep_statement2); } - unset($sql2, $result2, $prep_statement2); } } - } - unset($obj); + unset($obj); //populate primary url from deprecated field in v_contact table - $obj = new schema; - $obj->db = $db; - $obj->db_type = $db_type; - $obj->schema(); - $field_exists = $obj->column_exists($db_name, 'v_contacts', 'contact_url'); //check if field exists - if ($field_exists) { - // get email records - $sql = "select * from v_contacts where contact_url is not null and contact_url != ''"; + $obj = new schema; + $obj->db = $db; + $obj->db_type = $db_type; + $obj->schema(); + $field_exists = $obj->column_exists($db_name, 'v_contacts', 'contact_url'); //check if field exists + if ($field_exists) { + // get email records + $sql = "select * from v_contacts where contact_url is not null and contact_url != ''"; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); + $result_count = count($result); + unset ($prep_statement, $sql); + if ($result_count > 0) { + foreach($result as $row) { + $sql = "insert into v_contact_urls "; + $sql .= "("; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "contact_url_uuid, "; + $sql .= "url_primary, "; + $sql .= "url_address"; + $sql .= ")"; + $sql .= "values "; + $sql .= "("; + $sql .= "'".$row['domain_uuid']."', "; + $sql .= "'".$row['contact_uuid']."', "; + $sql .= "'".uuid()."', "; + $sql .= "1, "; + $sql .= "'".$row['contact_url']."' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); + + //verify and remove value from old field + $sql2 = "select url_address from v_contact_urls "; + $sql2 .= "where domain_uuid = '".$row['domain_uuid']."' "; + $sql2 .= "and contact_uuid = '".$row['contact_uuid']."' "; + $sql2 .= "and url_address = '".$row['contact_url']."' "; + $prep_statement2 = $db->prepare(check_sql($sql2)); + $prep_statement2->execute(); + $result2 = $prep_statement2->fetchAll(PDO::FETCH_NAMED); + $result_count2 = count($result2); + if ($result_count2 > 0) { + $sql3 = "update v_contacts set contact_url = '' "; + $sql3 .= "where domain_uuid = '".$row['domain_uuid']."' "; + $sql3 .= "and contact_uuid = '".$row['contact_uuid']."' "; + $prep_statement3 = $db->prepare(check_sql($sql3)); + $prep_statement3->execute(); + unset($sql3, $prep_statement3); + } + unset($sql2, $result2, $prep_statement2); + } + } + } + unset($obj); + + //set [name]_primary fields to 0 where null + $name_tables = array('phones','addresses','emails','urls'); + $name_fields = array('phone','address','email','url'); + foreach ($name_tables as $name_index => $name_table) { + $sql = "update v_contact_".$name_table." set ".$name_fields[$name_index]."_primary = 0 "; + $sql .= "where ".$name_fields[$name_index]."_primary is null "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + unset($sql, $prep_statement); + } + unset($name_tables, $name_fields); + + //move the users from the contact groups table into the contact users table + $sql = "select * from v_contact_groups "; + $sql .= "where group_uuid in (select user_uuid from v_users) "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); - $result_count = count($result); - unset ($prep_statement, $sql); - if ($result_count > 0) { - foreach($result as $row) { - $sql = "insert into v_contact_urls "; - $sql .= "("; - $sql .= "domain_uuid, "; - $sql .= "contact_uuid, "; - $sql .= "contact_url_uuid, "; - $sql .= "url_primary, "; - $sql .= "url_address"; - $sql .= ")"; - $sql .= "values "; - $sql .= "("; - $sql .= "'".$row['domain_uuid']."', "; - $sql .= "'".$row['contact_uuid']."', "; - $sql .= "'".uuid()."', "; - $sql .= "1, "; - $sql .= "'".$row['contact_url']."' "; - $sql .= ")"; - $db->exec(check_sql($sql)); - unset($sql); + foreach ($result as &$row) { + $sql = "insert into v_contact_users "; + $sql .= "( "; + $sql .= "contact_user_uuid, "; + $sql .= "domain_uuid, "; + $sql .= "contact_uuid, "; + $sql .= "user_uuid "; + $sql .= ") "; + $sql .= "values "; + $sql .= "( "; + $sql .= "'".uuid()."', "; + $sql .= "'".$row["domain_uuid"]."', "; + $sql .= "'".$row["contact_uuid"]."', "; + $sql .= "'".$row["group_uuid"]."' "; + $sql .= ");"; + //echo $sql."\n"; + $db->exec($sql); + unset($sql); - //verify and remove value from old field - $sql2 = "select url_address from v_contact_urls "; - $sql2 .= "where domain_uuid = '".$row['domain_uuid']."' "; - $sql2 .= "and contact_uuid = '".$row['contact_uuid']."' "; - $sql2 .= "and url_address = '".$row['contact_url']."' "; - $prep_statement2 = $db->prepare(check_sql($sql2)); - $prep_statement2->execute(); - $result2 = $prep_statement2->fetchAll(PDO::FETCH_NAMED); - $result_count2 = count($result2); - if ($result_count2 > 0) { - $sql3 = "update v_contacts set contact_url = '' "; - $sql3 .= "where domain_uuid = '".$row['domain_uuid']."' "; - $sql3 .= "and contact_uuid = '".$row['contact_uuid']."' "; - $prep_statement3 = $db->prepare(check_sql($sql3)); - $prep_statement3->execute(); - unset($sql3, $prep_statement3); - } - unset($sql2, $result2, $prep_statement2); - } + $sql = "delete from v_contact_groups "; + $sql .= "where contact_group_uuid = '".$row["contact_group_uuid"]."';"; + //echo $sql."\n"; + $db->exec($sql); + unset($sql); } - } - unset($obj); - - //set [name]_primary fields to 0 where null - $name_tables = array('phones','addresses','emails','urls'); - $name_fields = array('phone','address','email','url'); - foreach ($name_tables as $name_index => $name_table) { - $sql = "update v_contact_".$name_table." set ".$name_fields[$name_index]."_primary = 0 "; - $sql .= "where ".$name_fields[$name_index]."_primary is null "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - unset($sql, $prep_statement); - } - unset($name_tables, $name_fields); + unset ($prep_statement); } From 8fcc999bd25bde868303a32b85834ff79a5084d5 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 18 Jan 2016 18:30:22 -0700 Subject: [PATCH 15/33] Remvove the shared option and update the contact description. --- app/contacts/app_languages.php | 8 ++++---- app/contacts/contact_edit.php | 36 +--------------------------------- 2 files changed, 5 insertions(+), 39 deletions(-) diff --git a/app/contacts/app_languages.php b/app/contacts/app_languages.php index 517c637e33..a17b05f209 100644 --- a/app/contacts/app_languages.php +++ b/app/contacts/app_languages.php @@ -2118,21 +2118,21 @@ $text['description-import_delimiter']['sv-se'] = "Välj avgränsare (comma or pi $text['description-import_delimiter']['de-at'] = "Wählen Sie das Trennzeichen (Beistrich oder Wagrechter Strich)"; $text['description-import_delimiter']['he'] = ""; -$text['description-users']['en-us'] = "Assign additional users as administrators of this conference room."; +$text['description-users']['en-us'] = "Select the users that are allowed to view this contact."; $text['description-users']['es-cl'] = "Asignar usuarios adicionales como administradores de esta sala de conferencia."; $text['description-users']['pt-pt'] = "Atribuir utilizadores adicionais como administradores da sala de conferência."; $text['description-users']['fr-fr'] = "Ajouter des utilisateurs comme administrateurs des cette salle de conférence."; -$text['description-users']['pt-br'] = "Atribuir usuários adicionais como administradores da sala de conferência. "; +$text['description-users']['pt-br'] = "Selecione os usuários que podem ver este contato. "; $text['description-users']['pl'] = "'Dodaj dodatkowych użytkowników jako administratorów tego pokoju konferencyjnego."; $text['description-users']['sv-se'] = "Lägg till ytterligare användare som administratörer för detta konferensrum."; $text['description-users']['uk'] = "Зв'язати додаткових користувачів як адміністраторів цього конференц-залу."; $text['description-users']['de-at'] = "Weisen Sie diesem Konferenzraum weitere Administratoren zu. "; -$text['description-groups']['en-us'] = "Contacts assigned to a group are only visible to users in the group. Contacts not assigned to a group will be visible to all users in the domain."; +$text['description-groups']['en-us'] = "Select the groups that are allowed to view this contact."; $text['description-groups']['es-cl'] = "Contactos asignados a un grupo sólo son visibles para los usuarios del grupo. Los contactos no asignados a un grupo serán visibles para todos los usuarios del dominio."; $text['description-groups']['pt-pt'] = "Contatos atribuídos a um grupo só são visíveis para os usuários do grupo. Contatos não atribuídos a um grupo será visível para todos os usuários no domínio."; $text['description-groups']['fr-fr'] = "Contacts affectés à un groupe ne sont accessibles qu'aux utilisateurs du groupe. Contacts ne sont pas affectés à un groupe seront visibles à tous les utilisateurs dans le domaine."; -$text['description-groups']['pt-br'] = "Descrição"; +$text['description-groups']['pt-br'] = "Selecione os grupos que podem ver este contato"; $text['description-groups']['pl'] = "Kontaky przypisane do grupy, są widoczne tylko dla użytkowników w grupie. Kontakty nie przypisane do grupy będą widoczna dla wszystkich użytkowników w domenie."; $text['description-groups']['uk'] = "Опис"; $text['description-groups']['sv-se'] = "Kontakter tilldelade till en grupp är endast synbara för användare i guppen. Kontakter som inte är tilldelade till någon grupp syns för alla användare i hela domänen."; diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index ac87911c1c..883977907e 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -602,41 +602,6 @@ else { echo "\n"; echo "\n"; - //determine if contact is shared or private - if ($action == 'update') { - $sql = "select count(*) as num_rows from v_contact_groups "; - $sql .= "where domain_uuid = '".$domain_uuid."' "; - $sql .= "and contact_uuid = '".$contact_uuid."' "; - $sql .= "and group_uuid = '".$_SESSION["user_uuid"]."' "; - $prep_statement = $db->prepare(check_sql($sql)); - $prep_statement->execute(); - $row = $prep_statement->fetch(PDO::FETCH_ASSOC); - $contact_shared = ($row['num_rows'] > 0) ? 'false' : 'true'; - unset ($sql, $prep_statement, $row); - } - else { - //private by default on contact add, unless being done by a superadmin from a different domain - $contact_shared = ($_SESSION['groups'][0]['domain_uuid'] != $_SESSION['domain_uuid']) ? 'true' : 'false'; - } - //disable shared change if user (superadmin) is accessing a foreign domain - $contact_shared_disabled = ($_SESSION['groups'][0]['domain_uuid'] != $_SESSION['domain_uuid']) ? "disabled='disabled'" : null; - echo "\n"; - echo "\n"; - echo " ".$text['label-shared']."\n"; - echo "\n"; - echo "\n"; - echo " \n"; - if ($contact_shared_disabled != '') { - echo " "; - } - echo "
\n"; - echo $text['description-shared']."\n"; - echo "\n"; - echo "\n"; - if (permission_exists('contact_user_edit')) { echo " "; echo " ".$text['label-users'].""; @@ -676,6 +641,7 @@ else { echo ""; if (permission_exists('contact_group_view')) { + $contact_shared = 'true'; echo "
\n"; echo "\n"; echo ""; From 33d8597a5f3693a240095f5da3b1090c6ceddafa Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 18 Jan 2016 21:33:03 -0700 Subject: [PATCH 16/33] Allow call forward and follow me to be setup when the extension is disabled. --- app/calls/call_edit.php | 1 - 1 file changed, 1 deletion(-) diff --git a/app/calls/call_edit.php b/app/calls/call_edit.php index f0ce961c96..0c5dd53241 100644 --- a/app/calls/call_edit.php +++ b/app/calls/call_edit.php @@ -79,7 +79,6 @@ else { $sql .= "and extension = 'disabled' "; } } - $sql .= "and enabled = 'true' "; $prep_statement = $db->prepare(check_sql($sql)); $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED); From 30d5177b0a216a6718bd2965a11c01eb5f8ebead Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 18 Jan 2016 21:46:49 -0700 Subject: [PATCH 17/33] Work on the permissions for contacts. --- app/contacts/contacts.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/contacts/contacts.php b/app/contacts/contacts.php index 82ebd227d9..f48d8f2ae3 100644 --- a/app/contacts/contacts.php +++ b/app/contacts/contacts.php @@ -72,7 +72,7 @@ else { $sql .= "and contact_setting_name = 'array' "; $sql .= "and contact_setting_value <> '' "; $sql .= "and contact_setting_value is not null "; - if (sizeof($user_group_uuids) > 0) { + if (!(if_group("superadmin") || if_group("admin"))) { $sql .= "and ( \n"; //only contacts assigned to current user's group(s) and those not assigned to any group $sql .= " contact_uuid in ( \n"; $sql .= " select contact_uuid from v_contact_groups "; @@ -82,7 +82,8 @@ else { $sql .= " or \n"; $sql .= " contact_uuid not in ( \n"; $sql .= " select contact_uuid from v_contact_groups "; - $sql .= " where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= " where user_uuid = '".$_SESSION['user_uuid']."' "; + $sql .= " and domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= " ) \n"; $sql .= ") \n"; } @@ -100,17 +101,18 @@ else { $sql = "select count(*) as num_rows "; $sql .= "from v_contacts as c "; $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' "; - if (sizeof($user_group_uuids) > 0) { + if (!(if_group("superadmin") || if_group("admin"))) { $sql .= "and ( \n"; //only contacts assigned to current user's group(s) and those not assigned to any group $sql .= " contact_uuid in ( \n"; $sql .= " select contact_uuid from v_contact_groups "; $sql .= " where group_uuid in ('".implode("','", $user_group_uuids)."') "; $sql .= " and domain_uuid = '".$_SESSION['domain_uuid']."' "; $sql .= " ) \n"; - $sql .= " or \n"; - $sql .= " contact_uuid not in ( \n"; - $sql .= " select contact_uuid from v_contact_groups "; - $sql .= " where domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= " or contact_uuid in ( \n"; + $sql .= " select contact_uuid from v_contact_users "; + $sql .= " where user_uuid = '".$_SESSION['user_uuid']."' "; + $sql .= " and domain_uuid = '".$_SESSION['domain_uuid']."' "; + $sql .= ""; $sql .= " ) \n"; $sql .= ") \n"; } From c068d9dab61694a0779e80e721b3d9917512d6f4 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 18 Jan 2016 22:06:45 -0700 Subject: [PATCH 18/33] Add a few more permission checks to conference_room_edit.php --- .../conference_room_edit.php | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/app/conference_centers/conference_room_edit.php b/app/conference_centers/conference_room_edit.php index ed01b41a03..9b56e6f619 100644 --- a/app/conference_centers/conference_room_edit.php +++ b/app/conference_centers/conference_room_edit.php @@ -141,7 +141,7 @@ else { } //delete the user - if ($_GET["a"] == "delete" && permission_exists('conference_room_add') && permission_exists('conference_room_edit')) { + if ($_GET["a"] == "delete" && permission_exists('conference_room_delete')) { if (strlen($_REQUEST["meeting_user_uuid"]) > 0) { //set the variables $meeting_user_uuid = check_str($_REQUEST["meeting_user_uuid"]); @@ -601,24 +601,28 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { echo " \n"; echo " \n"; echo " \n"; echo " \n"; } echo "
".$field['username']."\n"; - echo " $v_link_label_delete\n"; + if (permission_exists('conference_room_delete')) { + echo " $v_link_label_delete\n"; + } echo "
\n"; } echo "
\n"; - echo " \n"; + echo " \n"; + foreach($users as $field) { + echo " \n"; + } + echo " "; + if ($action == "update") { + echo " \n"; + } + unset($users); + echo "
\n"; } - echo " "; - if ($action == "update") { - echo " \n"; - } - unset($users); - echo "
\n"; echo " ".$text['description-users']."\n"; echo " "; echo " "; From 882333a1b009e76ae28e536a6c744c6383131ad6 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Tue, 19 Jan 2016 22:14:02 -0700 Subject: [PATCH 19/33] Add personal directory array for provisioning. --- app/provision/resources/classes/provision.php | 64 +++++++++++++++++++ .../provision/cisco/7940/directory.xml | 6 +- .../cisco/7940/directory_personal.xml | 3 +- .../provision/cisco/7960/directory.xml | 6 +- .../cisco/7960/directory_personal.xml | 3 +- 5 files changed, 70 insertions(+), 12 deletions(-) diff --git a/app/provision/resources/classes/provision.php b/app/provision/resources/classes/provision.php index 6525c68a0d..feedeba39b 100644 --- a/app/provision/resources/classes/provision.php +++ b/app/provision/resources/classes/provision.php @@ -498,6 +498,70 @@ include "root.php"; unset ($prep_statement); } + //get the list of contact directly assigned to the user + if (strlen($device_uuid) > 0 and strlen($domain_uuid) > 0 and $_SESSION['provision']['directory_personal']['boolean'] == "true") { + foreach ($device_lines as &$line) { + //get the extension uuid from the line username [one result] + $sql = "select * from v_extensions "; + $sql .= "where (extension = '".$line["user_id"]."' or number_alias = '".$line["user_id"]."') "; + $sql .= "and domain_uuid = '$domain_uuid' "; + //echo $sql."\n"; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $extensions = $prep_statement->fetchAll(PDO::FETCH_NAMED); + unset($prep_statement); + foreach ($extensions as &$extension) { + $extension_uuid = $extension["extension_uuid"]; + } + //echo "extension uuid: ".$extension_uuid."\n"; + + //get the user_uuid assigned to the extension_uuid [multiple results] + $sql = "select user_uuid from v_extension_users "; + $sql .= "where extension_uuid = '$extension_uuid' "; + $sql .= "and domain_uuid = '$domain_uuid' "; + //echo $sql."\n"; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $extension_users = $prep_statement->fetchAll(PDO::FETCH_NAMED); + unset($prep_statement); + foreach ($extension_users as &$row) { + //get the list of contacts [multiple results] + $sql = "select contact_uuid from v_contact_users "; + $sql .= "where user_uuid = '".$row["user_uuid"]."' "; + $sql .= "and domain_uuid = '$domain_uuid' "; + //echo $sql."\n"; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $extension_users = $prep_statement->fetchAll(PDO::FETCH_NAMED); + unset($prep_statement); + foreach ($extension_users as &$row) { + $contacts[] = $row["contact_uuid"]; + } + } + } + + //get the contacts assigned to the user + //SQL 'in' with implode contacts array prevents returning duplicate contacts + if (sizeof($contacts) > 0) { + $sql = "select c.contact_organization, c.contact_name_given, c.contact_name_family, "; + $sql .= "p.phone_number, p.phone_extension "; + $sql .= "from v_contacts as c, v_contact_phones as p "; + $sql .= "where c.contact_uuid in ('".implode("','",$contacts)."') "; + $sql .= "and c.contact_uuid = p.contact_uuid "; + $sql .= "and p.phone_type_voice = '1' "; + $sql .= "and c.domain_uuid = '$domain_uuid' "; + //echo $sql."\n"; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $directory_personal = $prep_statement->fetchAll(PDO::FETCH_NAMED); + unset($prep_statement); + //print_r($contacts); + } + + //assign the contacts array + $view->assign("directory_personal", $contacts); + } + //get the contact extensions array and add to the template engine if (strlen($device_uuid) > 0 and strlen($domain_uuid) > 0 and $_SESSION['provision']['directory_extensions']['boolean'] == "true") { //get contacts from the database diff --git a/resources/templates/provision/cisco/7940/directory.xml b/resources/templates/provision/cisco/7940/directory.xml index fa7ddca68d..2b90e37102 100644 --- a/resources/templates/provision/cisco/7940/directory.xml +++ b/resources/templates/provision/cisco/7940/directory.xml @@ -3,14 +3,12 @@ Please choose... Our Phones - http://{$domain_name}/app/provision/file/directory_extensions.xml + http://{$domain_name}/app/provision/file/directory_extensions.xml?mac={$mac} - Enterprise http://{$domain_name}/app/provision/file/directory_enterprise.xml?mac={$mac} diff --git a/resources/templates/provision/cisco/7940/directory_personal.xml b/resources/templates/provision/cisco/7940/directory_personal.xml index 49998680f6..52f1f61688 100644 --- a/resources/templates/provision/cisco/7940/directory_personal.xml +++ b/resources/templates/provision/cisco/7940/directory_personal.xml @@ -2,7 +2,7 @@ Personal Please choose... {assign var=x value=1} -{foreach $contacts as $row}{if $row.contact_category == "personal"} +{foreach $directory_personal as $row} {if $row.contact_name_given != ""} {$row.contact_name_given} {$row.contact_name_family} @@ -15,7 +15,6 @@ {$row.phone_extension} {/if} -{/if} {assign var=x value=$x+1} {/foreach} diff --git a/resources/templates/provision/cisco/7960/directory.xml b/resources/templates/provision/cisco/7960/directory.xml index fa7ddca68d..2b90e37102 100644 --- a/resources/templates/provision/cisco/7960/directory.xml +++ b/resources/templates/provision/cisco/7960/directory.xml @@ -3,14 +3,12 @@ Please choose... Our Phones - http://{$domain_name}/app/provision/file/directory_extensions.xml + http://{$domain_name}/app/provision/file/directory_extensions.xml?mac={$mac} - Enterprise http://{$domain_name}/app/provision/file/directory_enterprise.xml?mac={$mac} diff --git a/resources/templates/provision/cisco/7960/directory_personal.xml b/resources/templates/provision/cisco/7960/directory_personal.xml index 49998680f6..52f1f61688 100644 --- a/resources/templates/provision/cisco/7960/directory_personal.xml +++ b/resources/templates/provision/cisco/7960/directory_personal.xml @@ -2,7 +2,7 @@ Personal Please choose... {assign var=x value=1} -{foreach $contacts as $row}{if $row.contact_category == "personal"} +{foreach $directory_personal as $row} {if $row.contact_name_given != ""} {$row.contact_name_given} {$row.contact_name_family} @@ -15,7 +15,6 @@ {$row.phone_extension} {/if} -{/if} {assign var=x value=$x+1} {/foreach} From ad324f4744d65641003eb371d8207107f36372fc Mon Sep 17 00:00:00 2001 From: Mafoo Date: Wed, 20 Jan 2016 11:25:02 +0000 Subject: [PATCH 20/33] changed throw Exception to die nothing ever eval runs the root.php so changed to die to cause a immediate report of error and stop code processing. --- app/access_controls/root.php | 2 +- app/adminer/root.php | 2 +- app/backup/root.php | 2 +- app/call_block/root.php | 2 +- app/call_broadcast/root.php | 2 +- app/call_center_active/root.php | 2 +- app/call_centers/root.php | 2 +- app/call_flows/root.php | 2 +- app/calls/root.php | 2 +- app/calls_active/root.php | 2 +- app/click_to_call/root.php | 2 +- app/conference_centers/root.php | 2 +- app/conferences/root.php | 2 +- app/conferences_active/root.php | 2 +- app/contacts/root.php | 2 +- app/destinations/root.php | 2 +- app/devices/root.php | 2 +- app/dialplan/root.php | 2 +- app/dialplan_inbound/root.php | 2 +- app/dialplan_outbound/root.php | 2 +- app/edit/root.php | 2 +- app/emails/root.php | 2 +- app/exec/root.php | 2 +- app/extensions/root.php | 2 +- app/fax/root.php | 2 +- app/fifo/root.php | 2 +- app/fifo_list/root.php | 2 +- app/follow_me/root.php | 2 +- app/gateways/root.php | 2 +- app/ivr_menus/root.php | 2 +- app/log_viewer/root.php | 2 +- app/modules/root.php | 2 +- app/music_on_hold/root.php | 2 +- app/operator_panel/root.php | 2 +- app/phrases/root.php | 2 +- app/provision/root.php | 2 +- app/recordings/root.php | 2 +- app/registrations/root.php | 2 +- app/ring_groups/root.php | 2 +- app/services/root.php | 2 +- app/settings/root.php | 2 +- app/sip_profiles/root.php | 2 +- app/sip_status/root.php | 2 +- app/sql_query/root.php | 2 +- app/system/root.php | 2 +- app/time_conditions/root.php | 2 +- app/traffic_graph/root.php | 2 +- app/vars/root.php | 2 +- app/voicemail_greetings/root.php | 2 +- app/voicemails/root.php | 2 +- app/xml_cdr/root.php | 2 +- core/apps/root.php | 2 +- core/databases/root.php | 2 +- core/default_settings/root.php | 2 +- core/domain_settings/root.php | 2 +- core/install/root.php | 2 +- core/menu/root.php | 2 +- core/notifications/root.php | 2 +- core/upgrade/root.php | 2 +- core/user_settings/root.php | 2 +- core/users/root.php | 2 +- resources/captcha/root.php | 2 +- resources/classes/root.php | 2 +- resources/root.php | 2 +- root.php | 2 +- secure/root.php | 2 +- themes/accessible/root.php | 2 +- themes/enhanced/root.php | 2 +- themes/minimized/root.php | 2 +- 69 files changed, 69 insertions(+), 69 deletions(-) diff --git a/app/access_controls/root.php b/app/access_controls/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/access_controls/root.php +++ b/app/access_controls/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/adminer/root.php b/app/adminer/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/adminer/root.php +++ b/app/adminer/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/backup/root.php b/app/backup/root.php index 2f0f086baa..4728665dd8 100755 --- a/app/backup/root.php +++ b/app/backup/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/call_block/root.php b/app/call_block/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/call_block/root.php +++ b/app/call_block/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/call_broadcast/root.php b/app/call_broadcast/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/call_broadcast/root.php +++ b/app/call_broadcast/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/call_center_active/root.php b/app/call_center_active/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/call_center_active/root.php +++ b/app/call_center_active/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/call_centers/root.php b/app/call_centers/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/call_centers/root.php +++ b/app/call_centers/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/call_flows/root.php b/app/call_flows/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/call_flows/root.php +++ b/app/call_flows/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/calls/root.php b/app/calls/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/calls/root.php +++ b/app/calls/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/calls_active/root.php b/app/calls_active/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/calls_active/root.php +++ b/app/calls_active/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/click_to_call/root.php b/app/click_to_call/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/click_to_call/root.php +++ b/app/click_to_call/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/conference_centers/root.php b/app/conference_centers/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/conference_centers/root.php +++ b/app/conference_centers/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/conferences/root.php b/app/conferences/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/conferences/root.php +++ b/app/conferences/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/conferences_active/root.php b/app/conferences_active/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/conferences_active/root.php +++ b/app/conferences_active/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/contacts/root.php b/app/contacts/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/contacts/root.php +++ b/app/contacts/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/destinations/root.php b/app/destinations/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/destinations/root.php +++ b/app/destinations/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/devices/root.php b/app/devices/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/devices/root.php +++ b/app/devices/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/dialplan/root.php b/app/dialplan/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/dialplan/root.php +++ b/app/dialplan/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/dialplan_inbound/root.php b/app/dialplan_inbound/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/dialplan_inbound/root.php +++ b/app/dialplan_inbound/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/dialplan_outbound/root.php b/app/dialplan_outbound/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/dialplan_outbound/root.php +++ b/app/dialplan_outbound/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/edit/root.php b/app/edit/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/edit/root.php +++ b/app/edit/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/emails/root.php b/app/emails/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/emails/root.php +++ b/app/emails/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/exec/root.php b/app/exec/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/exec/root.php +++ b/app/exec/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/extensions/root.php b/app/extensions/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/extensions/root.php +++ b/app/extensions/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/fax/root.php b/app/fax/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/fax/root.php +++ b/app/fax/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/fifo/root.php b/app/fifo/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/fifo/root.php +++ b/app/fifo/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/fifo_list/root.php b/app/fifo_list/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/fifo_list/root.php +++ b/app/fifo_list/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/follow_me/root.php b/app/follow_me/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/follow_me/root.php +++ b/app/follow_me/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/gateways/root.php b/app/gateways/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/gateways/root.php +++ b/app/gateways/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/ivr_menus/root.php b/app/ivr_menus/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/ivr_menus/root.php +++ b/app/ivr_menus/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/log_viewer/root.php b/app/log_viewer/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/log_viewer/root.php +++ b/app/log_viewer/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/modules/root.php b/app/modules/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/modules/root.php +++ b/app/modules/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/music_on_hold/root.php b/app/music_on_hold/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/music_on_hold/root.php +++ b/app/music_on_hold/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/operator_panel/root.php b/app/operator_panel/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/operator_panel/root.php +++ b/app/operator_panel/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/phrases/root.php b/app/phrases/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/phrases/root.php +++ b/app/phrases/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/provision/root.php b/app/provision/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/provision/root.php +++ b/app/provision/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/recordings/root.php b/app/recordings/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/recordings/root.php +++ b/app/recordings/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/registrations/root.php b/app/registrations/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/registrations/root.php +++ b/app/registrations/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/ring_groups/root.php b/app/ring_groups/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/ring_groups/root.php +++ b/app/ring_groups/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/services/root.php b/app/services/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/services/root.php +++ b/app/services/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/settings/root.php b/app/settings/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/settings/root.php +++ b/app/settings/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/sip_profiles/root.php b/app/sip_profiles/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/sip_profiles/root.php +++ b/app/sip_profiles/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/sip_status/root.php b/app/sip_status/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/sip_status/root.php +++ b/app/sip_status/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/sql_query/root.php b/app/sql_query/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/sql_query/root.php +++ b/app/sql_query/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/system/root.php b/app/system/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/system/root.php +++ b/app/system/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/time_conditions/root.php b/app/time_conditions/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/time_conditions/root.php +++ b/app/time_conditions/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/traffic_graph/root.php b/app/traffic_graph/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/traffic_graph/root.php +++ b/app/traffic_graph/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/vars/root.php b/app/vars/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/vars/root.php +++ b/app/vars/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/voicemail_greetings/root.php b/app/voicemail_greetings/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/voicemail_greetings/root.php +++ b/app/voicemail_greetings/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/voicemails/root.php b/app/voicemails/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/voicemails/root.php +++ b/app/voicemails/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/app/xml_cdr/root.php b/app/xml_cdr/root.php index 2f0f086baa..4728665dd8 100644 --- a/app/xml_cdr/root.php +++ b/app/xml_cdr/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/core/apps/root.php b/core/apps/root.php index 2f0f086baa..4728665dd8 100644 --- a/core/apps/root.php +++ b/core/apps/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/core/databases/root.php b/core/databases/root.php index 2f0f086baa..4728665dd8 100644 --- a/core/databases/root.php +++ b/core/databases/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/core/default_settings/root.php b/core/default_settings/root.php index 2f0f086baa..4728665dd8 100644 --- a/core/default_settings/root.php +++ b/core/default_settings/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/core/domain_settings/root.php b/core/domain_settings/root.php index 2f0f086baa..4728665dd8 100644 --- a/core/domain_settings/root.php +++ b/core/domain_settings/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/core/install/root.php b/core/install/root.php index 2f0f086baa..4728665dd8 100644 --- a/core/install/root.php +++ b/core/install/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/core/menu/root.php b/core/menu/root.php index 2f0f086baa..4728665dd8 100644 --- a/core/menu/root.php +++ b/core/menu/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/core/notifications/root.php b/core/notifications/root.php index 2f0f086baa..4728665dd8 100644 --- a/core/notifications/root.php +++ b/core/notifications/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/core/upgrade/root.php b/core/upgrade/root.php index 2f0f086baa..4728665dd8 100644 --- a/core/upgrade/root.php +++ b/core/upgrade/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/core/user_settings/root.php b/core/user_settings/root.php index 2f0f086baa..4728665dd8 100644 --- a/core/user_settings/root.php +++ b/core/user_settings/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/core/users/root.php b/core/users/root.php index 2f0f086baa..4728665dd8 100644 --- a/core/users/root.php +++ b/core/users/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/resources/captcha/root.php b/resources/captcha/root.php index 2f0f086baa..4728665dd8 100644 --- a/resources/captcha/root.php +++ b/resources/captcha/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/resources/classes/root.php b/resources/classes/root.php index 2f0f086baa..4728665dd8 100644 --- a/resources/classes/root.php +++ b/resources/classes/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/resources/root.php b/resources/root.php index 2f0f086baa..4728665dd8 100644 --- a/resources/root.php +++ b/resources/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/root.php b/root.php index 2f0f086baa..4728665dd8 100644 --- a/root.php +++ b/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/secure/root.php b/secure/root.php index 2f0f086baa..4728665dd8 100644 --- a/secure/root.php +++ b/secure/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/themes/accessible/root.php b/themes/accessible/root.php index 2f0f086baa..4728665dd8 100644 --- a/themes/accessible/root.php +++ b/themes/accessible/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/themes/enhanced/root.php b/themes/enhanced/root.php index 2f0f086baa..4728665dd8 100644 --- a/themes/enhanced/root.php +++ b/themes/enhanced/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); diff --git a/themes/minimized/root.php b/themes/minimized/root.php index 2f0f086baa..4728665dd8 100644 --- a/themes/minimized/root.php +++ b/themes/minimized/root.php @@ -75,7 +75,7 @@ $i++; } if(!file_exists($path. '/.project.ROOT')){ - throw new Exception("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); + die("Failed to locate the Project Root by searching for .project.ROOT please contact support for assistance"); } $project_path = str_replace($_SERVER["DOCUMENT_ROOT"], "", $path); define('PROJECT_PATH', $project_path); From 9ce00a03cf5131edc217891abffd72079e389d99 Mon Sep 17 00:00:00 2001 From: mafoo Date: Wed, 20 Jan 2016 13:44:36 +0000 Subject: [PATCH 21/33] values were being assigned rather than compared --- app/devices/device_edit.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index de92aec84d..613df1fdbd 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -557,8 +557,8 @@ require_once "resources/require.php"; if (!isset($_SERVER['HTTP_PROTOCOL'])) { $_SERVER['HTTP_PROTOCOL'] = 'http'; if (isset($_SERVER['REQUEST_SCHEME'])) { $_SERVER['HTTP_PROTOCOL'] = $_SERVER['REQUEST_SCHEME']; } - if ($_SERVER['HTTPS'] = 'on') { $_SERVER['HTTP_PROTOCOL'] = 'https'; } - if ($_SERVER['SERVER_PORT'] = '443') { $_SERVER['HTTP_PROTOCOL'] = 'https'; } + if ($_SERVER['HTTPS'] == 'on') { $_SERVER['HTTP_PROTOCOL'] = 'https'; } + if ($_SERVER['SERVER_PORT'] == '443') { $_SERVER['HTTP_PROTOCOL'] = 'https'; } } echo " window.location = '".$_SERVER['HTTP_PROTOCOL']."://".$domain_name."/app/provision?mac=".$device_mac_address."&file=' + d + '&content_type=application/octet-stream';\n"; echo " }\n"; From c6b39cc0a58b650dc4e15d2e03d2f91c42143427 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Wed, 20 Jan 2016 11:58:10 -0700 Subject: [PATCH 22/33] Add device profile copy button. --- app/devices/device_profile_edit.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/devices/device_profile_edit.php b/app/devices/device_profile_edit.php index bfe703b584..8ef1ede278 100644 --- a/app/devices/device_profile_edit.php +++ b/app/devices/device_profile_edit.php @@ -257,6 +257,7 @@ require_once "resources/require.php"; echo "\n"; echo "\n"; echo " \n"; + echo " \n"; echo " \n"; echo "\n"; echo "\n"; From 3984218fb5f685bd59ef8c4b4f86a63377101f3e Mon Sep 17 00:00:00 2001 From: markjcrane Date: Wed, 20 Jan 2016 12:26:01 -0700 Subject: [PATCH 23/33] Fix the provisioning class. --- app/provision/resources/classes/provision.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/provision/resources/classes/provision.php b/app/provision/resources/classes/provision.php index feedeba39b..95a3304d7f 100644 --- a/app/provision/resources/classes/provision.php +++ b/app/provision/resources/classes/provision.php @@ -506,7 +506,7 @@ include "root.php"; $sql .= "where (extension = '".$line["user_id"]."' or number_alias = '".$line["user_id"]."') "; $sql .= "and domain_uuid = '$domain_uuid' "; //echo $sql."\n"; - $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement = $this->db->prepare(check_sql($sql)); $prep_statement->execute(); $extensions = $prep_statement->fetchAll(PDO::FETCH_NAMED); unset($prep_statement); @@ -520,7 +520,7 @@ include "root.php"; $sql .= "where extension_uuid = '$extension_uuid' "; $sql .= "and domain_uuid = '$domain_uuid' "; //echo $sql."\n"; - $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement = $this->db->prepare(check_sql($sql)); $prep_statement->execute(); $extension_users = $prep_statement->fetchAll(PDO::FETCH_NAMED); unset($prep_statement); @@ -530,7 +530,7 @@ include "root.php"; $sql .= "where user_uuid = '".$row["user_uuid"]."' "; $sql .= "and domain_uuid = '$domain_uuid' "; //echo $sql."\n"; - $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement = $this->db->prepare(check_sql($sql)); $prep_statement->execute(); $extension_users = $prep_statement->fetchAll(PDO::FETCH_NAMED); unset($prep_statement); @@ -551,7 +551,7 @@ include "root.php"; $sql .= "and p.phone_type_voice = '1' "; $sql .= "and c.domain_uuid = '$domain_uuid' "; //echo $sql."\n"; - $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement = $this->db->prepare(check_sql($sql)); $prep_statement->execute(); $directory_personal = $prep_statement->fetchAll(PDO::FETCH_NAMED); unset($prep_statement); From d452bdda0c433ae9e9f3583c28a13aced641fa76 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Wed, 20 Jan 2016 16:27:17 -0700 Subject: [PATCH 24/33] Add a new polycom template for tftp. --- .../templates/provision/polycom/tftp/site.cfg | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 resources/templates/provision/polycom/tftp/site.cfg diff --git a/resources/templates/provision/polycom/tftp/site.cfg b/resources/templates/provision/polycom/tftp/site.cfg new file mode 100644 index 0000000000..85552f61ea --- /dev/null +++ b/resources/templates/provision/polycom/tftp/site.cfg @@ -0,0 +1,14 @@ + + + + \ No newline at end of file From 24434b06ed8dbdfafbd73edcdc54a43219f99b6a Mon Sep 17 00:00:00 2001 From: markjcrane Date: Wed, 20 Jan 2016 20:33:50 -0700 Subject: [PATCH 25/33] Remove the polycom/tftp/site.cfg as its currently not working as expected. --- .../templates/provision/polycom/tftp/site.cfg | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 resources/templates/provision/polycom/tftp/site.cfg diff --git a/resources/templates/provision/polycom/tftp/site.cfg b/resources/templates/provision/polycom/tftp/site.cfg deleted file mode 100644 index 85552f61ea..0000000000 --- a/resources/templates/provision/polycom/tftp/site.cfg +++ /dev/null @@ -1,14 +0,0 @@ - - - - \ No newline at end of file From c505fec77b57758801cd28eda3b139b2288a4f39 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Wed, 20 Jan 2016 23:56:06 -0700 Subject: [PATCH 26/33] Update the constructor in the vcard class. --- resources/classes/vcard.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/resources/classes/vcard.php b/resources/classes/vcard.php index 34285d47d0..30f51bd85c 100644 --- a/resources/classes/vcard.php +++ b/resources/classes/vcard.php @@ -13,10 +13,10 @@ class vcard { var $revision_date; var $card; - /* - The class constructor. You can set some defaults here if desired. - */ - function vcard() { + /** + * Called when the object is created + */ + public function __construct() { $this->log = "New vcard() called
"; $this->data = array( "display_name"=>null @@ -59,7 +59,17 @@ class vcard { ,"sort_string"=>null ,"note"=>null ); - return true; + return true; + } + + /** + * Called when there are no references to a particular object + * unset the variables used in the class + */ + public function __destruct() { + foreach ($this as $key => $value) { + unset($this->$key); + } } /* From fec4df23a08019262e2b8980cb8ce5a14b31873d Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Thu, 21 Jan 2016 17:29:14 +0300 Subject: [PATCH 27/33] Fix. Copy dialplan extension with correct `add_uuid` for outbound route. --- app/dialplan/dialplan_copy.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/dialplan/dialplan_copy.php b/app/dialplan/dialplan_copy.php index de81736106..81829cd4de 100644 --- a/app/dialplan/dialplan_copy.php +++ b/app/dialplan/dialplan_copy.php @@ -79,9 +79,9 @@ else { //create a new app_uuid when copying a dialplan except for these exceptions switch ($app_uuid) { - case "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4": //inbound routes - case "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3": //outbound routes - case "4b821450-926b-175a-af93-a03c441818b1": //time conditions + case "c03b422e-13a8-bd1b-e42b-b6b9b4d27ce4": break; //inbound routes + case "8c914ec3-9fc0-8ab5-4cda-6c9288bdc9a3": break; //outbound routes + case "4b821450-926b-175a-af93-a03c441818b1": break; //time conditions default: $app_uuid = uuid(); } From 3ea6eac9cfe01896cdfc2534c1ad8f8340be39d7 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Thu, 21 Jan 2016 23:29:13 -0700 Subject: [PATCH 28/33] Start the Mitel functions list. --- app/devices/device_edit.php | 49 +++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index 613df1fdbd..234f4780dc 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -1049,6 +1049,55 @@ require_once "resources/require.php"; "; } } + if (strtolower($device_vendor) == "mitel" || strlen($device_vendor) == 0 || strlen($device_username) > 0) { + echo ""; + ?> + + + + + + + + + + + + + + + + + if (strlen($device_vendor) == 0) { echo ""; } + } if (strtolower($device_vendor) == "polycom" || strlen($device_vendor) == 0 || strlen($device_username) > 0) { echo ""; ?> From 5a20dce9ab1c980c2768e78055e0f42e8e67d29b Mon Sep 17 00:00:00 2001 From: markjcrane Date: Thu, 21 Jan 2016 23:33:03 -0700 Subject: [PATCH 29/33] Move the php tag. --- app/devices/device_edit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index 234f4780dc..b485cfd295 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -1067,7 +1067,6 @@ require_once "resources/require.php"; - + "; } } if (strtolower($device_vendor) == "polycom" || strlen($device_vendor) == 0 || strlen($device_username) > 0) { From e4e6fe92a94ae0ec5f28af63a070c5a9eba6e24d Mon Sep 17 00:00:00 2001 From: Alexey Melnichuk Date: Fri, 22 Jan 2016 11:37:34 +0300 Subject: [PATCH 30/33] Fix. Do not prompt password if there no mailbox. --- .../app/voicemail/resources/functions/check_password.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/install/scripts/app/voicemail/resources/functions/check_password.lua b/resources/install/scripts/app/voicemail/resources/functions/check_password.lua index b95cf1feae..674d7fbcbd 100644 --- a/resources/install/scripts/app/voicemail/resources/functions/check_password.lua +++ b/resources/install/scripts/app/voicemail/resources/functions/check_password.lua @@ -61,6 +61,12 @@ end); end end + + -- check either we found valid voicemail box + if (not voicemail_uuid) or (#voicemail_uuid == 0) then + return session:hangup(); + end + --please enter your password followed by pound dtmf_digits = ''; password = macro(session, "voicemail_password", 20, 5000, ''); From 87a2b0de476a6c9e8fe53669d116d75625d38d8a Mon Sep 17 00:00:00 2001 From: mafoo Date: Fri, 22 Jan 2016 11:51:58 +0000 Subject: [PATCH 31/33] fix for when the element is not in the document yet --- app/operator_panel/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/operator_panel/index.php b/app/operator_panel/index.php index 481696d0ba..31827423b0 100644 --- a/app/operator_panel/index.php +++ b/app/operator_panel/index.php @@ -199,7 +199,7 @@ require_once "resources/header.php"; //refresh controls function refresh_stop() { clearInterval(interval_timer_id); - document.getElementById('refresh_state').innerHTML = "\"<?php\" title=\"\">"; + if (document.getElementById('refresh_state')) { document.getElementById('refresh_state').innerHTML = "\"<?php\" title=\"\">"; } } function refresh_start() { From f9bd8e0998e5bac344a0f9212e9fd1d36afcd058 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Fri, 22 Jan 2016 11:02:25 -0700 Subject: [PATCH 32/33] Change Mitel Line 1-8 to Line only. --- app/devices/device_edit.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index b485cfd295..2be99a46d8 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -1053,14 +1053,7 @@ require_once "resources/require.php"; echo ""; ?> - - - - - - - - + From 19945b5095647bc6e3ed036e116d28bd81dc11c7 Mon Sep 17 00:00:00 2001 From: markjcrane Date: Fri, 22 Jan 2016 12:24:18 -0700 Subject: [PATCH 33/33] Change the comment in check_password.lua. --- .../app/voicemail/resources/functions/check_password.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/install/scripts/app/voicemail/resources/functions/check_password.lua b/resources/install/scripts/app/voicemail/resources/functions/check_password.lua index 674d7fbcbd..7763cfc2ba 100644 --- a/resources/install/scripts/app/voicemail/resources/functions/check_password.lua +++ b/resources/install/scripts/app/voicemail/resources/functions/check_password.lua @@ -62,7 +62,7 @@ end end - -- check either we found valid voicemail box + --end the session if this is an invalid voicemail box if (not voicemail_uuid) or (#voicemail_uuid == 0) then return session:hangup(); end