diff --git a/app/access_controls/access_control_edit.php b/app/access_controls/access_control_edit.php index f9327b3358..88f14a5b43 100644 --- a/app/access_controls/access_control_edit.php +++ b/app/access_controls/access_control_edit.php @@ -35,9 +35,6 @@ $language = new text; $text = $language->get(); -//create the database connection - $database = database::new(); - //action add or update if (!empty($_REQUEST["id"]) && is_uuid($_REQUEST["id"])) { $action = "update"; @@ -232,8 +229,6 @@ //save the data if (is_array($array)) { - $database->app_name = 'access controls'; - $database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd'; $database->save($array); } diff --git a/app/access_controls/app_defaults.php b/app/access_controls/app_defaults.php index a91b535865..03062004ff 100644 --- a/app/access_controls/app_defaults.php +++ b/app/access_controls/app_defaults.php @@ -77,8 +77,6 @@ $p = permissions::new(); $p->add('access_control_add', 'temp'); - $database->app_name = 'access_controls'; - $database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd'; $database->save($array, false); unset($array); @@ -109,8 +107,6 @@ $p = permissions::new(); $p->add('access_control_node_add', 'temp'); - $database->app_name = 'access_controls'; - $database->app_uuid = '1416a250-f6e1-4edc-91a6-5c9b883638fd'; $database->save($array, false); unset($array); diff --git a/app/active_calls/active_calls.php b/app/active_calls/active_calls.php index 63c85746ec..116ecc5197 100644 --- a/app/active_calls/active_calls.php +++ b/app/active_calls/active_calls.php @@ -54,10 +54,6 @@ if (!($config instanceof config)) { $config = config::load(); } -if (!($database instanceof database)) { - $database = database::new(); -} - if (!($settings instanceof settings)) { $settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid, 'user_uuid' => $user_uuid]); } diff --git a/app/active_calls/resources/dashboard/active_calls.php b/app/active_calls/resources/dashboard/active_calls.php index 6000ef165c..317d90eef9 100644 --- a/app/active_calls/resources/dashboard/active_calls.php +++ b/app/active_calls/resources/dashboard/active_calls.php @@ -40,11 +40,6 @@ $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; -//connect to the database -if (!isset($database)) { - $database = database::new(); -} - //set the dashboard icon to a solid color phone $widget_icon = 'fa-solid fa-phone'; diff --git a/app/call_block/call_block_edit.php b/app/call_block/call_block_edit.php index 492f2f61f4..a555457cb0 100644 --- a/app/call_block/call_block_edit.php +++ b/app/call_block/call_block_edit.php @@ -196,8 +196,6 @@ $array['call_block'][0]['date_added'] = time(); $array['call_block'][0]['call_block_description'] = $call_block_description; - $database->app_name = 'call_block'; - $database->app_uuid = '9ed63276-e085-4897-839c-4f2e36d92d6c'; $database->save($array); unset($array); @@ -247,8 +245,6 @@ $array['call_block'][0]['date_added'] = time(); $array['call_block'][0]['call_block_description'] = $call_block_description; - $database->app_name = 'call_block'; - $database->app_uuid = '9ed63276-e085-4897-839c-4f2e36d92d6c'; $database->save($array); unset($array); diff --git a/app/call_centers/app_defaults.php b/app/call_centers/app_defaults.php index 1a64d36919..9a61117c6f 100644 --- a/app/call_centers/app_defaults.php +++ b/app/call_centers/app_defaults.php @@ -61,10 +61,8 @@ if ($domains_processed == 1) { $p = permissions::new(); $p->add('call_center_tier_edit', 'temp'); - $database->app_name = 'call_centers'; - $database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370'; $database->save($array, false); - $response = $database->message; + //$response = $database->message; unset($array); $p->delete('call_center_tier_edit', 'temp'); @@ -173,8 +171,6 @@ if ($domains_processed == 1) { $p->add("dialplan_edit", "temp"); //save to the data - $database->app_name = 'call_centers'; - $database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370'; $database->save($array, false); $message = $database->message; diff --git a/app/call_centers/call_center_agent_edit.php b/app/call_centers/call_center_agent_edit.php index 31908178e4..55af84c0c8 100644 --- a/app/call_centers/call_center_agent_edit.php +++ b/app/call_centers/call_center_agent_edit.php @@ -167,9 +167,7 @@ $array['users'][0]['user_status'] = $agent_status; } - //save to the data - $database->app_name = 'call_center'; - $database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370'; + //save to the database $database->save($array); //syncrhonize configuration diff --git a/app/call_centers/call_center_queue_edit.php b/app/call_centers/call_center_queue_edit.php index 7bd55337ea..aa7dd4d978 100644 --- a/app/call_centers/call_center_queue_edit.php +++ b/app/call_centers/call_center_queue_edit.php @@ -42,8 +42,7 @@ $language = new text; $text = $language->get(); -//initialize database and settings - $database = database::new(); +//initialize settings object $settings = new settings(['database' => $database, $_SESSION['domain_uuid'] ?? '', $_SESSION['user_uuid'] ?? '']); //set the defaults @@ -205,8 +204,6 @@ $p = permissions::new(); $p->add('call_center_tier_delete', 'temp'); - $database->app_name = 'call_centers'; - $database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370'; $database->delete($array); unset($array); @@ -464,10 +461,8 @@ $p->add("dialplan_edit", "temp"); //save to the data - $database->app_name = 'call_centers'; - $database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370'; $database->save($array); - $message = $database->message; + //$message = $database->message; //remove the temporary permission $p->delete("dialplan_add", "temp"); diff --git a/app/call_centers/resources/dashboard/call_center_agents.php b/app/call_centers/resources/dashboard/call_center_agents.php index 7e97ca5681..b69ae3e164 100644 --- a/app/call_centers/resources/dashboard/call_center_agents.php +++ b/app/call_centers/resources/dashboard/call_center_agents.php @@ -81,8 +81,6 @@ $array['call_center_agents'][0]['call_center_agent_uuid'] = $agent_uuid; $array['call_center_agents'][0]['domain_uuid'] = $_SESSION['user']['domain_uuid']; $array['call_center_agents'][0]['agent_status'] = $agent_status; - $database->app_name = 'call_centers_dashboard'; - $database->app_uuid = '95788e50-9500-079e-2807-fd530b0ea370'; $result = $database->save($array); //send the agent status status to mod_call_center diff --git a/app/call_forward/call_forward_edit.php b/app/call_forward/call_forward_edit.php index 70ec717637..4744abd8da 100644 --- a/app/call_forward/call_forward_edit.php +++ b/app/call_forward/call_forward_edit.php @@ -249,8 +249,6 @@ $p->add("extension_edit", "temp"); //save the data - $database->app_name = 'call_forward'; - $database->app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d'; $database->save($array); unset($array); @@ -262,8 +260,6 @@ foreach ($follow_me_delete_uuids as $follow_me_delete_uuid) { $array['follow_me_destinations'][]['follow_me_destination_uuid'] = $follow_me_delete_uuid; } - $database->app_name = 'call_forward'; - $database->app_uuid = '19806921-e8ed-dcff-b325-dd3e5da4959d'; $database->delete($array); unset($array); } diff --git a/app/conference_centers/conference_center_edit.php b/app/conference_centers/conference_center_edit.php index 06477d4ff7..cc41cd4c7c 100644 --- a/app/conference_centers/conference_center_edit.php +++ b/app/conference_centers/conference_center_edit.php @@ -166,10 +166,8 @@ $p->add("dialplan_edit", "temp"); //save to the data - $database->app_name = "conference_centers"; - $database->app_uuid = "b81412e8-7253-91f4-e48e-42fc2c9a38d9"; $database->save($array); - $message = $database->message; + //$message = $database->message; unset($array); //remove the temporary permission diff --git a/app/conference_centers/conference_room_edit.php b/app/conference_centers/conference_room_edit.php index 1972c520b1..72b4d50883 100644 --- a/app/conference_centers/conference_room_edit.php +++ b/app/conference_centers/conference_room_edit.php @@ -188,8 +188,6 @@ $p = permissions::new(); $p->add('conference_room_user_delete', 'temp'); - $database->app_name = 'conference_centers'; - $database->app_uuid = '8d083f5a-f726-42a8-9ffa-8d28f848f10e'; $database->delete($array); unset($array); @@ -333,8 +331,6 @@ $array['conference_rooms'][0]['enabled'] = $enabled; $array['conference_rooms'][0]['description'] = $description; - $database->app_name = 'conference_centers'; - $database->app_uuid = '8d083f5a-f726-42a8-9ffa-8d28f848f10e'; $database->save($array); unset($array); @@ -349,8 +345,6 @@ $p = permissions::new(); $p->add('conference_room_user_add', 'temp'); - $database->app_name = 'conference_centers'; - $database->app_uuid = '8d083f5a-f726-42a8-9ffa-8d28f848f10e'; $database->save($array); unset($array); @@ -411,8 +405,6 @@ } $array['conference_rooms'][0]['description'] = $description; - $database->app_name = 'conference_centers'; - $database->app_uuid = '8d083f5a-f726-42a8-9ffa-8d28f848f10e'; $database->save($array); unset($array); @@ -431,8 +423,6 @@ $p = permissions::new(); $p->add('conference_room_user_add', 'temp'); - $database->app_name = 'conference_centers'; - $database->app_uuid = '8d083f5a-f726-42a8-9ffa-8d28f848f10e'; $database->save($array); unset($array); diff --git a/app/conference_centers/conference_rooms.php b/app/conference_centers/conference_rooms.php index e2df6a8e87..1fdf84399c 100644 --- a/app/conference_centers/conference_rooms.php +++ b/app/conference_centers/conference_rooms.php @@ -126,8 +126,6 @@ } //save to the data - $database->app_name = 'conference_rooms'; - $database->app_uuid = '8d083f5a-f726-42a8-9ffa-8d28f848f10e'; $database->save($array); $message = $database->message; unset($array); diff --git a/app/conference_controls/app_defaults.php b/app/conference_controls/app_defaults.php index 4ae4fcb8c4..bb8ca9c447 100644 --- a/app/conference_controls/app_defaults.php +++ b/app/conference_controls/app_defaults.php @@ -68,8 +68,6 @@ $p = permissions::new(); $p->add('conference_control_add', 'temp'); - $database->app_name = 'conference_controls'; - $database->app_uuid = 'e1ad84a2-79e1-450c-a5b1-7507a043e048'; $database->save($array); unset($array); @@ -99,8 +97,6 @@ $p = permissions::new(); $p->add('conference_control_detail_add', 'temp'); - $database->app_name = 'conference_controls'; - $database->app_uuid = 'e1ad84a2-79e1-450c-a5b1-7507a043e048'; $database->save($array); unset($array); diff --git a/app/conference_controls/conference_control_edit.php b/app/conference_controls/conference_control_edit.php index e25d06550e..94878d2603 100644 --- a/app/conference_controls/conference_control_edit.php +++ b/app/conference_controls/conference_control_edit.php @@ -108,8 +108,6 @@ $array['conference_controls'][0]['control_description'] = $control_description; //save to the data - $database->app_name = 'conference_controls'; - $database->app_uuid = 'e1ad84a2-79e1-450c-a5b1-7507a043e048'; if (!empty($conference_control_uuid)) { $database->uuid($conference_control_uuid); } diff --git a/app/conference_profiles/app_defaults.php b/app/conference_profiles/app_defaults.php index 6ea787c8c9..38753f9072 100644 --- a/app/conference_profiles/app_defaults.php +++ b/app/conference_profiles/app_defaults.php @@ -68,8 +68,6 @@ $p = permissions::new(); $p->add('conference_profile_add', 'temp'); - $database->app_name = 'conference_profiles'; - $database->app_uuid = 'c33e2c2a-847f-44c1-8c0d-310df5d65ba9'; $database->save($array, false); unset($array); @@ -94,8 +92,6 @@ $p = permissions::new(); $p->add('conference_profile_param_add', 'temp'); - $database->app_name = 'conference_profiles'; - $database->app_uuid = 'c33e2c2a-847f-44c1-8c0d-310df5d65ba9'; $database->save($array, false); unset($array); diff --git a/app/conference_profiles/conference_profile_param_edit.php b/app/conference_profiles/conference_profile_param_edit.php index b5867eb4eb..9e16d6a58e 100644 --- a/app/conference_profiles/conference_profile_param_edit.php +++ b/app/conference_profiles/conference_profile_param_edit.php @@ -123,8 +123,6 @@ } if (is_uuid($array['conference_profile_params'][0]['conference_profile_param_uuid'])) { - $database->app_name = 'conference_profiles'; - $database->app_uuid = 'c33e2c2a-847f-44c1-8c0d-310df5d65ba9'; $database->save($array); unset($array); } diff --git a/app/destinations/app_defaults.php b/app/destinations/app_defaults.php index 02f255d69f..c37b08a04b 100644 --- a/app/destinations/app_defaults.php +++ b/app/destinations/app_defaults.php @@ -87,8 +87,6 @@ if ($domains_processed == 1) { $p->add('destination_edit', 'temp'); //create the database object and save the data - $database->app_name = 'destinations'; - $database->app_uuid = '5ec89622-b19c-3559-64f0-afde802ab139'; $database->save($array, false); unset($array); @@ -113,8 +111,6 @@ if ($domains_processed == 1) { $p->add('destination_edit', 'temp'); //create the database object and save the data - $database->app_name = 'destinations'; - $database->app_uuid = '5ec89622-b19c-3559-64f0-afde802ab139'; $database->save($array, false); unset($array); @@ -173,8 +169,6 @@ if ($domains_processed == 1) { $p->add('destination_edit', 'temp'); //create the database object and save the data - $database->app_name = 'destinations'; - $database->app_uuid = '5ec89622-b19c-3559-64f0-afde802ab139'; //$database->save($array, false); unset($array); @@ -199,8 +193,6 @@ if ($domains_processed == 1) { $p->add('destination_edit', 'temp'); //create the database object and save the data - $database->app_name = 'destinations'; - $database->app_uuid = '5ec89622-b19c-3559-64f0-afde802ab139'; $database->save($array, false); unset($array); diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index ba5c71b780..c90698c529 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -41,9 +41,6 @@ $language = new text; $text = $language->get(); -//initialize the database object - $database = database::new(); - //initialize the settings object $settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid]); @@ -1204,8 +1201,6 @@ $p->add("dialplan_detail_edit", 'temp'); //save the dialplan - $database->app_name = 'destinations'; - $database->app_uuid = '5ec89622-b19c-3559-64f0-afde802ab139'; $response = $database->save($array); //remove the temporary permission @@ -1267,8 +1262,6 @@ } //save the destination - $database->app_name = 'destinations'; - $database->app_uuid = '5ec89622-b19c-3559-64f0-afde802ab139'; $database->save($array); $dialplan_response = $database->message; unset($array); diff --git a/app/devices/app_defaults.php b/app/devices/app_defaults.php index 1df2f32a0b..670e602709 100644 --- a/app/devices/app_defaults.php +++ b/app/devices/app_defaults.php @@ -65,8 +65,6 @@ if ($domains_processed == 1) { $p = permissions::new(); $p->add('device_key_edit', 'temp'); - $database->app_name = 'devices'; - $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; $database->save($array); $response = $database->message; unset($array); @@ -110,8 +108,6 @@ if ($domains_processed == 1) { $p = permissions::new(); $p->add('device_profile_key_add', 'temp'); - $database->app_name = 'devices'; - $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; $database->save($array); $response = $database->message; unset($array); @@ -150,8 +146,6 @@ if ($domains_processed == 1) { $p = permissions::new(); $p->add('device_profile_setting_add', 'temp'); - $database->app_name = 'devices'; - $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; $database->save($array); $response = $database->message; unset($array); @@ -234,8 +228,6 @@ if ($domains_processed == 1) { $p->add('device_vendor_function_add', 'temp'); $p->add('device_vendor_function_group_add', 'temp'); - $database->app_name = 'devices'; - $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; $database->save($array); unset($array); diff --git a/app/devices/device_download.php b/app/devices/device_download.php index 2397c4456c..03570acb7c 100644 --- a/app/devices/device_download.php +++ b/app/devices/device_download.php @@ -44,7 +44,6 @@ $user_name = $_SESSION['username'] ?? ''; //create database connection and settings object - $database = database::new(); $settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid, 'user_uuid' => $user_uuid]); //add multi-lingual support diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index 04584905a4..1c441cff8a 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -48,10 +48,7 @@ $domain_uuid = $_SESSION['domain_uuid'] ?? ''; $domain_name = $_SESSION['domain_name'] ?? ''; -//initialize the database object - $database = database::new(); - -//initialize the settigns object +//initialize the settings object $settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid]); //action add or update @@ -444,8 +441,6 @@ //save the device - $database->app_name = 'devices'; - $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; $database->save($array); //remove checked lines diff --git a/app/devices/device_profile_edit.php b/app/devices/device_profile_edit.php index c3c9cad5d9..86c2fa8444 100644 --- a/app/devices/device_profile_edit.php +++ b/app/devices/device_profile_edit.php @@ -176,8 +176,6 @@ } //save to the data - $database->app_name = 'Device Profiles'; - $database->app_uuid = 'bb2531c3-97e6-428f-9a19-cbac1b96f5b7'; $database->save($array); //remove checked keys diff --git a/app/devices/device_vendor_function_edit.php b/app/devices/device_vendor_function_edit.php index 7c4934426a..5174c93692 100644 --- a/app/devices/device_vendor_function_edit.php +++ b/app/devices/device_vendor_function_edit.php @@ -155,8 +155,6 @@ $array['device_vendor_functions'][0]['enabled'] = $enabled; $array['device_vendor_functions'][0]['description'] = $description; - $database->app_name = 'devices'; - $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; $database->save($array); unset($array); } @@ -181,8 +179,6 @@ $p = permissions::new(); $p->add('device_vendor_function_group_add', 'temp'); - $database->app_name = 'devices'; - $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; $database->save($array); unset($array); diff --git a/app/devices/devices.php b/app/devices/devices.php index ef61628c4d..cb9891ef59 100644 --- a/app/devices/devices.php +++ b/app/devices/devices.php @@ -44,8 +44,7 @@ $user_uuid = $_SESSION['user_uuid'] ?? ''; $user_name = $_SESSION['username'] ?? ''; -//create database connection and settings object - $database = database::new(); +//create the settings object $settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid, 'user_uuid' => $user_uuid]); //add multi-lingual support diff --git a/app/devices/resources/dashboard/device_keys.php b/app/devices/resources/dashboard/device_keys.php index d5e699e54a..b6e2e3bd61 100644 --- a/app/devices/resources/dashboard/device_keys.php +++ b/app/devices/resources/dashboard/device_keys.php @@ -259,8 +259,6 @@ $p->add('device_key_edit', 'temp'); //save the changes - $database->app_name = 'devices'; - $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; $result = $database->save($array); //remove the temporary permissions diff --git a/app/dialplans/app_defaults.php b/app/dialplans/app_defaults.php index 927e827179..f22e7d5281 100644 --- a/app/dialplans/app_defaults.php +++ b/app/dialplans/app_defaults.php @@ -174,8 +174,6 @@ $p->add('dialplan_add', 'temp'); $p->add('dialplan_detail_add', 'temp'); - $database->app_name = 'dialplans'; - $database->app_uuid = '742714e5-8cdf-32fd-462c-cbe7e3d655db'; $database->save($array, false); unset($array); diff --git a/app/dialplans/dialplan_edit.php b/app/dialplans/dialplan_edit.php index 1ff03b0a7e..ecaf4e15c6 100644 --- a/app/dialplans/dialplan_edit.php +++ b/app/dialplans/dialplan_edit.php @@ -312,9 +312,6 @@ $array['dialplans'][$x]['dialplan_xml'] = $dialplan_array[$dialplan_uuid]; //add or update the database - $database->app_name = 'dialplans'; - $database->app_uuid = $app_uuid ?? null; - $database->uuid($dialplan_uuid); $database->save($array); unset($array); diff --git a/app/email_queue/resources/jobs/email_send.php b/app/email_queue/resources/jobs/email_send.php index ece3ee5a61..e94228ead4 100755 --- a/app/email_queue/resources/jobs/email_send.php +++ b/app/email_queue/resources/jobs/email_send.php @@ -18,9 +18,6 @@ //ini_set('max_execution_time',1800); //30 minutes ini_set('memory_limit', '512M'); -//connect to the database - $database = database::new(); - //save the arguments to variables $script_name = $argv[0]; if (!empty($argv[1])) { @@ -446,9 +443,6 @@ $p->add('email_queue_add', 'temp'); $p->add('email_queue_update', 'temp'); //execute insert - $database->app_name = 'email_queue'; - $database->app_uuid = '5befdf60-a242-445f-91b3-2e9ee3e0ddf7'; - print_r($array); $message = $database->save($array); print_r($message); unset($array); @@ -477,8 +471,6 @@ $p->add('email_queue_add', 'temp'); //execute insert - $database->app_name = 'email_queue'; - $database->app_uuid = 'ba41954e-9d21-4b10-bbc2-fa5ceabeb184'; $database->save($array); unset($array); @@ -530,8 +522,6 @@ $p = permissions::new(); $p->add('email_log_add', 'temp'); //execute insert - $database->app_name = 'v_mailto'; - $database->app_uuid = 'ba41954e-9d21-4b10-bbc2-fa5ceabeb184'; $database->save($array); unset($array); //revoke temporary permissions diff --git a/app/extensions/app_defaults.php b/app/extensions/app_defaults.php index 8fbb6a00d6..971048dbaa 100644 --- a/app/extensions/app_defaults.php +++ b/app/extensions/app_defaults.php @@ -53,8 +53,6 @@ $p = permissions::new(); $p->add('extension_edit', 'temp'); - $database->app_name = 'extensions'; - $database->app_uuid = 'e68d9689-2769-e013-28fa-6214bf47fca3'; $database->save($array, false); unset($array); diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index 0937d7d1f1..0977f2caab 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -312,8 +312,6 @@ $p->add('extension_user_delete', 'temp'); //save the array - $database->app_name = 'extensions'; - $database->app_uuid = 'e68d9689-2769-e013-28fa-6214bf47fca3'; $database->delete($array); unset($array); @@ -339,8 +337,6 @@ $p->add('device_line_delete', 'temp'); //save the array - $database->app_name = 'extensions'; - $database->app_uuid = 'e68d9689-2769-e013-28fa-6214bf47fca3'; $database->delete($array); unset($array); @@ -831,9 +827,7 @@ unset($sql, $parameters); } - //save to the data - $database->app_name = 'extensions'; - $database->app_uuid = 'e68d9689-2769-e013-28fa-6214bf47fca3'; + //save to the data'; $message = $database->save($array); unset($array); diff --git a/app/extensions/extension_imports.php b/app/extensions/extension_imports.php index 68581309c2..5ec98421d1 100644 --- a/app/extensions/extension_imports.php +++ b/app/extensions/extension_imports.php @@ -323,8 +323,6 @@ if ($row_id === 1000) { //save to the data - $database->app_name = 'extensions'; - $database->app_uuid = 'e68d9689-2769-e013-28fa-6214bf47fca3'; $database->save($array); //clear the array @@ -342,8 +340,6 @@ //save to the data if (!empty($array) && is_array($array)) { - $database->app_name = 'extensions'; - $database->app_uuid = 'e68d9689-2769-e013-28fa-6214bf47fca3'; $database->save($array); unset($array); } diff --git a/app/extensions/resources/dashboard/caller_id.php b/app/extensions/resources/dashboard/caller_id.php index eaddb629a7..7b156a89b2 100644 --- a/app/extensions/resources/dashboard/caller_id.php +++ b/app/extensions/resources/dashboard/caller_id.php @@ -88,8 +88,6 @@ $p->add("extension_edit", "temp"); //save to the data - $database->app_name = 'extensions'; - $database->app_uuid = 'e68d9689-2769-e013-28fa-6214bf47fca3'; $message = $database->save($array); //update the session array diff --git a/app/fax/app_defaults.php b/app/fax/app_defaults.php index 3672fbc934..16025aec5d 100644 --- a/app/fax/app_defaults.php +++ b/app/fax/app_defaults.php @@ -207,8 +207,6 @@ $p->add("email_template_edit", 'temp'); //save the data - $database->app_name = 'email_templates'; - $database->app_uuid = '8173e738-2523-46d5-8943-13883befd2fd'; $database->save($array); //$message = $database->message; diff --git a/app/fax/fax_emails.php b/app/fax/fax_emails.php index 2929879f0a..7b814eb044 100644 --- a/app/fax/fax_emails.php +++ b/app/fax/fax_emails.php @@ -37,7 +37,6 @@ $sql .= "where fax_email_connection_host <> '' "; $sql .= "and f.domain_uuid = d.domain_uuid "; $sql .= "and fax_email_connection_host is not null "; $sql .= "and fax_email_outbound_subject_tag is not null "; -$database = database::new(); $result = $database->select($sql, null, 'all'); unset($sql); diff --git a/app/fax/fax_send.php b/app/fax/fax_send.php index aa0b82521d..3eb4eda568 100644 --- a/app/fax/fax_send.php +++ b/app/fax/fax_send.php @@ -844,8 +844,6 @@ if (!function_exists('fax_split_dtmf')) { $p->add('fax_queue_add', 'temp'); //save the data - $database->app_name = 'fax queue'; - $database->app_uuid = '3656287f-4b22-4cf1-91f6-00386bf488f4'; $database->save($array); //remove temporary permisison diff --git a/app/fax_queue/fax_queue.php b/app/fax_queue/fax_queue.php index bc45cbe636..04519d684b 100644 --- a/app/fax_queue/fax_queue.php +++ b/app/fax_queue/fax_queue.php @@ -36,7 +36,6 @@ } //set defaults - $database = database::new(); $domain_uuid = $_SESSION['domain_uuid'] ?? ''; $user_uuid = $_SESSION['user_uuid'] ?? ''; $settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid, 'user_uuid' => $user_uuid]); diff --git a/app/fax_queue/resources/job/fax_send.php b/app/fax_queue/resources/job/fax_send.php index 10ee2a6420..90ce8bb624 100644 --- a/app/fax_queue/resources/job/fax_send.php +++ b/app/fax_queue/resources/job/fax_send.php @@ -452,8 +452,6 @@ $p->add('fax_queue_edit', 'temp'); //save the data - $database->app_name = 'fax queue'; - $database->app_uuid = '3656287f-4b22-4cf1-91f6-00386bf488f4'; $database->save($array, false); unset($array); @@ -667,8 +665,6 @@ $p->add('fax_queue_edit', 'temp'); //save the data - $database->app_name = 'fax queue'; - $database->app_uuid = '3656287f-4b22-4cf1-91f6-00386bf488f4'; $database->save($array, false); unset($array); diff --git a/app/fifo/fifo_edit.php b/app/fifo/fifo_edit.php index be510965a2..b465e5af6b 100644 --- a/app/fifo/fifo_edit.php +++ b/app/fifo/fifo_edit.php @@ -39,9 +39,6 @@ $language = new text; $text = $language->get(); -//connect to the database - $database = database::new(); - //add the settings object $settings = new settings(["domain_uuid" => $_SESSION['domain_uuid'], "user_uuid" => $_SESSION['user_uuid']]); @@ -342,8 +339,6 @@ $p->add("dialplan_edit", "temp"); //save the data - $database->app_name = 'fifo'; - $database->app_uuid = '16589224-c876-aeb3-f59f-523a1c0801f7'; $result = $database->save($array); //remove the temporary permission diff --git a/app/ivr_menus/app_defaults.php b/app/ivr_menus/app_defaults.php index 4df19f5b75..db56aa4070 100644 --- a/app/ivr_menus/app_defaults.php +++ b/app/ivr_menus/app_defaults.php @@ -57,8 +57,6 @@ if ($domains_processed == 1) { $p = permissions::new(); $p->add('ivr_menu_edit', 'temp'); - $database->app_name = 'ivr_menus'; - $database->app_uuid = 'a5788e9b-58bc-bd1b-df59-fff5d51253ab'; $database->save($array, false); unset($array); diff --git a/app/ivr_menus/ivr_menu_edit.php b/app/ivr_menus/ivr_menu_edit.php index 6dea48b3a8..5697598e1c 100644 --- a/app/ivr_menus/ivr_menu_edit.php +++ b/app/ivr_menus/ivr_menu_edit.php @@ -42,8 +42,7 @@ $language = new text; $text = $language->get(); -//initialize database and settings - $database = database::new(); +//initialize the settings object $settings = new settings(['database' => $database, $_SESSION['domain_uuid'] ?? '', $_SESSION['user_uuid'] ?? '']); //set the defaults @@ -413,8 +412,6 @@ } //save to the data - $database->app_name = 'ivr_menus'; - $database->app_uuid = 'a5788e9b-58bc-bd1b-df59-fff5d51253ab'; $database->save($array); $message = $database->message; diff --git a/app/ivr_menus/ivr_menus.php b/app/ivr_menus/ivr_menus.php index 7443ea133f..6d470792d1 100644 --- a/app/ivr_menus/ivr_menus.php +++ b/app/ivr_menus/ivr_menus.php @@ -42,9 +42,6 @@ $language = new text; $text = $language->get(); -//connect to the database - $database = database::new(); - //define defaults $action = ''; $search = ''; diff --git a/app/modules/app_defaults.php b/app/modules/app_defaults.php index 70771fb38e..60e59a10c3 100644 --- a/app/modules/app_defaults.php +++ b/app/modules/app_defaults.php @@ -48,8 +48,6 @@ $array['modules'][$index]['module_order'] = $mod['module_order']; } if (is_array($array) && @sizeof($array) != 0) { - $database->app_name = 'modules'; - $database->app_uuid = '5eb9cba1-8cb6-5d21-e36a-775475f16b5e'; $database->save($array, false); unset($array); } diff --git a/app/music_on_hold/app_defaults.php b/app/music_on_hold/app_defaults.php index 710b6342af..2b94682f52 100644 --- a/app/music_on_hold/app_defaults.php +++ b/app/music_on_hold/app_defaults.php @@ -96,8 +96,6 @@ if ($domains_processed == 1) { $p = permissions::new(); $p->add('music_on_hold_add', 'temp'); - $database->app_name = 'app_name'; - $database->app_uuid = 'app_uuid'; $database->save($array, false); unset($array); diff --git a/app/phrases/app_defaults.php b/app/phrases/app_defaults.php index b72fd08e67..5c47ee85ee 100644 --- a/app/phrases/app_defaults.php +++ b/app/phrases/app_defaults.php @@ -86,8 +86,6 @@ if ($domains_processed == 1) { $p = permissions::new(); $p->add('phrase_detail_edit', 'temp'); - $database->app_name = 'phrases'; - $database->app_uuid = '5c6f597c-9b78-11e4-89d3-123b93f75cba'; $database->save($array, false); unset($array); @@ -122,8 +120,6 @@ if ($domains_processed == 1) { $p = permissions::new(); $p->add('phrase_detail_edit', 'temp'); - $database->app_name = 'phrases'; - $database->app_uuid = '5c6f597c-9b78-11e4-89d3-123b93f75cba'; $database->save($array, false); unset($array); diff --git a/app/phrases/phrase_edit.php b/app/phrases/phrase_edit.php index 371267c3fd..925785faa2 100644 --- a/app/phrases/phrase_edit.php +++ b/app/phrases/phrase_edit.php @@ -163,8 +163,6 @@ $p = permissions::new(); $p->add('phrase_detail_add', 'temp'); - $database->app_name = 'phrases'; - $database->app_uuid = '5c6f597c-9b78-11e4-89d3-123b93f75cba'; $database->save($array); unset($array); @@ -226,8 +224,6 @@ $p = permissions::new(); $p->add('phrase_detail_add', 'temp'); - $database->app_name = 'phrases'; - $database->app_uuid = '5c6f597c-9b78-11e4-89d3-123b93f75cba'; $database->save($array); unset($array); diff --git a/app/pin_numbers/pin_number_edit.php b/app/pin_numbers/pin_number_edit.php index 4e11baf6fc..e58d7999bc 100644 --- a/app/pin_numbers/pin_number_edit.php +++ b/app/pin_numbers/pin_number_edit.php @@ -115,8 +115,6 @@ if (!empty($_POST) && empty($_POST["persistformvar"])) { $array['pin_numbers'][0]['enabled'] = $enabled; $array['pin_numbers'][0]['description'] = $description; //save data - $database->app_name = 'pin_numbers'; - $database->app_uuid = '4b88ccfb-cb98-40e1-a5e5-33389e14a388'; $database->save($array); unset($array); //redirect diff --git a/app/provision/app_defaults.php b/app/provision/app_defaults.php index 83425417ca..e00dc60ce2 100644 --- a/app/provision/app_defaults.php +++ b/app/provision/app_defaults.php @@ -46,8 +46,6 @@ if ($domains_processed == 1) { $p = permissions::new(); $p->add('device_add', 'temp'); //execute update - $database->app_name = 'provision'; - $database->app_uuid = 'abf28ead-92ef-3de6-ebbb-023fbc2b6dd3'; $database->save($array, false); unset($array); //revoke temporary permissions @@ -71,8 +69,6 @@ if ($domains_processed == 1) { $p->add('default_setting_edit', 'temp'); //execute update - $database->app_name = 'provision'; - $database->app_uuid = 'abf28ead-92ef-3de6-ebbb-023fbc2b6dd3'; $database->save($array, false); unset($array); diff --git a/app/provision/index.php b/app/provision/index.php index a9c8c2cd7e..0d88bf138b 100644 --- a/app/provision/index.php +++ b/app/provision/index.php @@ -36,7 +36,6 @@ $file_count = 0; $row_count = 0; $device_template = ''; - $database = database::new(); //use an existing connection if possible //define PHP variables from the HTTP values if (isset($_REQUEST['address'])) { diff --git a/app/recordings/app_defaults.php b/app/recordings/app_defaults.php index 6d35521081..8763ddab7a 100644 --- a/app/recordings/app_defaults.php +++ b/app/recordings/app_defaults.php @@ -63,8 +63,6 @@ $p = permissions::new(); $p->add('recording_edit', 'temp'); //update recording record with base64 - $database->app_name = 'recordings'; - $database->app_uuid = '83913217-c7a2-9e90-925d-a866eb40b60e'; $database->save($array, false); unset($array); //revoke temporary permissions @@ -113,8 +111,6 @@ $p->add('recording_edit', 'temp'); //update recording record - $database->app_name = 'recordings'; - $database->app_uuid = '83913217-c7a2-9e90-925d-a866eb40b60e'; $database->save($array, false); unset($array); diff --git a/app/recordings/recording_edit.php b/app/recordings/recording_edit.php index 9f6c1dd501..3abd874812 100644 --- a/app/recordings/recording_edit.php +++ b/app/recordings/recording_edit.php @@ -269,8 +269,6 @@ $array['recordings'][0]['recording_description'] = $recording_description; //execute update - $database->app_name = 'recordings'; - $database->app_uuid = '83913217-c7a2-9e90-925d-a866eb40b60e'; $database->save($array); unset($array); diff --git a/app/recordings/recordings.php b/app/recordings/recordings.php index d7ee2a62ea..207dff9bb8 100644 --- a/app/recordings/recordings.php +++ b/app/recordings/recordings.php @@ -37,9 +37,6 @@ $language = new text; $text = $language->get(); -//initialize the database connection - $database = database::new(); - //get the session settings $domain_uuid = $_SESSION['domain_uuid']; $domain_name = $_SESSION['domain_name']; @@ -207,8 +204,6 @@ $p = permissions::new(); $p->add('recording_edit', 'temp'); //execute update - $database->app_name = 'recordings'; - $database->app_uuid = '83913217-c7a2-9e90-925d-a866eb40b60e'; $database->save($array); unset($array); //remove temporary permissions @@ -244,8 +239,6 @@ $p = permissions::new(); $p->add('recording_add', 'temp'); //execute insert - $database->app_name = 'recordings'; - $database->app_uuid = '83913217-c7a2-9e90-925d-a866eb40b60e'; $database->save($array); unset($array); //remove temporary permissions @@ -265,8 +258,6 @@ $p = permissions::new(); $p->add('recording_edit', 'temp'); //execute update - $database->app_name = 'recordings'; - $database->app_uuid = '83913217-c7a2-9e90-925d-a866eb40b60e'; $database->save($array); unset($array); //remove temporary permissions diff --git a/app/recordings/waveform.php b/app/recordings/waveform.php index 07a15a5555..5f058ac280 100644 --- a/app/recordings/waveform.php +++ b/app/recordings/waveform.php @@ -39,9 +39,6 @@ exit; } -//initialize the database connection - $database = database::new(); - //create the waveform file if (is_uuid($_GET['id']) || !empty($_GET['data'])) { diff --git a/app/ring_groups/app_defaults.php b/app/ring_groups/app_defaults.php index 2ee2a67d66..7a13bec15f 100644 --- a/app/ring_groups/app_defaults.php +++ b/app/ring_groups/app_defaults.php @@ -52,8 +52,6 @@ if ($domains_processed == 1) { $p = permissions::new(); $p->add('ring_group_edit', 'temp'); //execute update - $database->app_name = 'ring_groups'; - $database->app_uuid = '1d61fb65-1eec-bc73-a6ee-a6203b4fe6f2'; $database->save($array, false); unset($array); //revoke temporary permissions diff --git a/app/ring_groups/resources/dashboard/ring_group_forward.php b/app/ring_groups/resources/dashboard/ring_group_forward.php index f9d9743f99..f11947571a 100644 --- a/app/ring_groups/resources/dashboard/ring_group_forward.php +++ b/app/ring_groups/resources/dashboard/ring_group_forward.php @@ -81,8 +81,6 @@ $p = permissions::new(); $p->add('ring_group_edit', 'temp'); - $database->app_name = 'ring_groups'; - $database->app_uuid = '1d61fb65-1eec-bc73-a6ee-a6203b4fe6f2'; $database->save($array); unset($array); diff --git a/app/ring_groups/ring_group_edit.php b/app/ring_groups/ring_group_edit.php index 60869a9681..489c671e9e 100644 --- a/app/ring_groups/ring_group_edit.php +++ b/app/ring_groups/ring_group_edit.php @@ -39,9 +39,6 @@ exit; } -//connect to database - $database = database::new(); - //create the settings object $settings = new settings(['database' => $database, 'domain_uuid' => $_SESSION['domain_uuid'] ?? '', 'user_uuid' => $_SESSION['user_uuid'] ?? '']); @@ -122,8 +119,6 @@ $p->add('ring_group_user_delete', 'temp'); //execute delete - $database->app_name = 'ring_groups'; - $database->app_uuid = '1d61fb65-1eec-bc73-a6ee-a6203b4fe6f2'; $database->delete($array); unset($array); @@ -261,8 +256,6 @@ $p->add('ring_group_user_add', 'temp'); //execute delete - $database->app_name = 'ring_groups'; - $database->app_uuid = '1d61fb65-1eec-bc73-a6ee-a6203b4fe6f2'; $database->save($array); unset($array); @@ -505,8 +498,6 @@ $p->add("dialplan_edit", "temp"); //save to the data - $database->app_name = 'ring_groups'; - $database->app_uuid = '1d61fb65-1eec-bc73-a6ee-a6203b4fe6f2'; $database->save($array); $message = $database->message; diff --git a/app/sip_profiles/app_defaults.php b/app/sip_profiles/app_defaults.php index 2e57b4fc06..c78944527e 100644 --- a/app/sip_profiles/app_defaults.php +++ b/app/sip_profiles/app_defaults.php @@ -112,8 +112,6 @@ $p->add('sip_profile_setting_add', 'temp'); //execute insert - $database->app_name = 'sip_profiles'; - $database->app_uuid = '159a8da8-0e8c-a26b-6d5b-19c532b6d470'; $database->save($array, false); unset($array); @@ -174,8 +172,6 @@ $p->add('sip_profile_domain_add', 'temp'); //execute insert - $database->app_name = 'sip_profiles'; - $database->app_uuid = '159a8da8-0e8c-a26b-6d5b-19c532b6d470'; $database->save($array, false); unset($array); diff --git a/app/sip_status/sip_status.php b/app/sip_status/sip_status.php index a3d43977cc..8e1f065d32 100644 --- a/app/sip_status/sip_status.php +++ b/app/sip_status/sip_status.php @@ -42,9 +42,6 @@ $language = new text; $text = $language->get(); -//create the database object - $database = database::new(); - //create event socket $esl = event_socket::create(); if (!$esl->is_connected()) { diff --git a/app/sofia_global_settings/app_defaults.php b/app/sofia_global_settings/app_defaults.php index 0d3e03c55a..2cbfc07841 100644 --- a/app/sofia_global_settings/app_defaults.php +++ b/app/sofia_global_settings/app_defaults.php @@ -73,8 +73,6 @@ if ($domains_processed == 1) { $p->add('sofia_global_setting_add', 'temp'); //execute insert - $database->app_name = 'sofia_global_settings'; - $database->app_uuid = '240c25a3-a2cf-44ea-a300-0626eca5b945'; $database->save($array, false); unset($array); diff --git a/app/streams/stream_edit.php b/app/streams/stream_edit.php index d829e7abcd..58bcab2296 100644 --- a/app/streams/stream_edit.php +++ b/app/streams/stream_edit.php @@ -196,8 +196,6 @@ $array['streams'][0]['stream_description'] = $stream_description; //save to the data - $database->app_name = 'streams'; - $database->app_uuid = 'ffde6287-aa18-41fc-9a38-076d292e0a38'; $database->save($array); $message = $database->message; diff --git a/app/vars/app_defaults.php b/app/vars/app_defaults.php index fa632daa9f..8a759a7333 100644 --- a/app/vars/app_defaults.php +++ b/app/vars/app_defaults.php @@ -101,8 +101,6 @@ if ($domains_processed == 1) { //execute insert if (!empty($array)) { - $database->app_name = 'vars'; - $database->app_uuid = '54e08402-c1b8-0a9d-a30a-f569fc174dd8'; $database->save($array, false); } @@ -198,8 +196,6 @@ if ($domains_processed == 1) { $p->add("var_add", "temp"); //execute inserts - $database->app_name = 'vars'; - $database->app_uuid = '54e08402-c1b8-0a9d-a30a-f569fc174dd8'; $database->save($array, false); unset($array); diff --git a/app/voicemail_greetings/app_defaults.php b/app/voicemail_greetings/app_defaults.php index b8c46be0fc..b0bb79b3da 100644 --- a/app/voicemail_greetings/app_defaults.php +++ b/app/voicemail_greetings/app_defaults.php @@ -97,8 +97,6 @@ if ($domains_processed == 1) { $p->add('voicemail_greeting_add', 'temp'); //execute update - $database->app_name = 'voicemail_greetings'; - $database->app_uuid = 'e4b4fbee-9e4d-8e46-3810-91ba663db0c2'; $message = $database->save($array, false); unset($array); @@ -128,8 +126,6 @@ if ($domains_processed == 1) { $p->add('voicemail_greeting_edit', 'temp'); //execute - $database->app_name = 'voicemail_greetings'; - $database->app_uuid = 'e4b4fbee-9e4d-8e46-3810-91ba663db0c2'; $database->save($array, false); unset($array); @@ -176,8 +172,6 @@ if ($domains_processed == 1) { $p->add('voicemail_greeting_edit', 'temp'); //execute update - $database->app_name = 'voicemail_greetings'; - $database->app_uuid = 'e4b4fbee-9e4d-8e46-3810-91ba663db0c2'; $database->save($array, false); unset($array); @@ -223,8 +217,6 @@ if ($domains_processed == 1) { $p->add('voicemail_greeting_edit', 'temp'); //execute update - $database->app_name = 'voicemail_greetings'; - $database->app_uuid = 'e4b4fbee-9e4d-8e46-3810-91ba663db0c2'; $database->save($array, false); unset($array); diff --git a/app/voicemail_greetings/voicemail_greetings.php b/app/voicemail_greetings/voicemail_greetings.php index ba179cf90e..09d4a9768a 100644 --- a/app/voicemail_greetings/voicemail_greetings.php +++ b/app/voicemail_greetings/voicemail_greetings.php @@ -216,8 +216,6 @@ $p->add('voicemail_greeting_edit', 'temp'); //execute inserts/updates - $database->app_name = 'voicemail_greetings'; - $database->app_uuid = 'e4b4fbee-9e4d-8e46-3810-91ba663db0c2'; $database->save($array); unset($array); diff --git a/app/voicemails/voicemail_edit.php b/app/voicemails/voicemail_edit.php index be44a23f98..0d22b4e339 100644 --- a/app/voicemails/voicemail_edit.php +++ b/app/voicemails/voicemail_edit.php @@ -243,8 +243,6 @@ } //execute insert/update - $database->app_name = 'voicemails'; - $database->app_uuid = 'b523c2d2-64cd-46f1-9520-ca4b4098e044'; $database->save($array); unset($array); diff --git a/app/voicemails/voicemails.php b/app/voicemails/voicemails.php index 7d14bcab69..c672279793 100644 --- a/app/voicemails/voicemails.php +++ b/app/voicemails/voicemails.php @@ -45,9 +45,6 @@ $language = new text; $text = $language->get(); -//set up database object - $database = database::new(); - //get the settings $settings = new settings(['database' => $database, 'domain_uuid' => $_SESSION['domain_uuid'] ?? '', 'user_uuid' => $_SESSION['user_uuid'] ?? '']); diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php index 95c5d4b1a8..247a980cb3 100644 --- a/app/xml_cdr/xml_cdr.php +++ b/app/xml_cdr/xml_cdr.php @@ -40,9 +40,6 @@ exit; } -//connect to the database - $database = database::new(); - //set permissions $permission = array(); $permission['xml_cdr_view'] = permission_exists('xml_cdr_view'); diff --git a/app/xml_cdr/xml_cdr_details.php b/app/xml_cdr/xml_cdr_details.php index 6557a4aaae..3cbdc7c321 100644 --- a/app/xml_cdr/xml_cdr_details.php +++ b/app/xml_cdr/xml_cdr_details.php @@ -37,9 +37,6 @@ exit; } -//connect to the database - $database = database::new(); - //add multi-lingual support $language = new text; $text = $language->get(); @@ -118,10 +115,8 @@ $p->add('xml_cdr_edit', 'temp'); //remove record_path, record_name and record_length - $database->app_name = 'xml_cdr'; - $database->app_uuid = '4a085c51-7635-ff03-f67b-86e834422848'; $database->save($array, false); - $message = $database->message; + //$message = $database->message; unset($array); //remove the temporary permissions diff --git a/app/xml_cdr/xml_cdr_inc.php b/app/xml_cdr/xml_cdr_inc.php index 460c688598..9ab74f3ac0 100644 --- a/app/xml_cdr/xml_cdr_inc.php +++ b/app/xml_cdr/xml_cdr_inc.php @@ -103,9 +103,6 @@ $_GET['show'] = 'false'; } -//connect to database - $database = database::new(); - //get post or get variables from http if (!empty($_REQUEST)) { $cdr_id = $_REQUEST["cdr_id"] ?? ''; diff --git a/core/authentication/app_defaults.php b/core/authentication/app_defaults.php index ed70985cbd..ab3defe349 100644 --- a/core/authentication/app_defaults.php +++ b/core/authentication/app_defaults.php @@ -99,8 +99,6 @@ $p->add("email_template_edit", 'temp'); //save the data - $database->app_name = 'email_templates'; - $database->app_uuid = '8173e738-2523-46d5-8943-13883befd2fd'; $database->save($array); //$message = $database->message; diff --git a/core/contacts/contact_edit.php b/core/contacts/contact_edit.php index c0a7883dd4..97c8ed0446 100644 --- a/core/contacts/contact_edit.php +++ b/core/contacts/contact_edit.php @@ -572,16 +572,10 @@ $p->add('contact_user_add', 'temp'); $p->add('contact_group_add', 'temp'); - //view_array($array); - - $database->app_name = 'contacts'; - $database->app_uuid = '04481e0e-a478-c559-adad-52bd4174574c'; $database->save($array); - $message = $database->message; + //$message = $database->message; unset($array); - //view_array($message); - $p->delete('contact_add', 'temp'); $p->delete('contact_phone_add', 'temp'); $p->delete('contact_address_add', 'temp'); diff --git a/core/contacts/contact_import.php b/core/contacts/contact_import.php index 5ec1a90e1f..4aee9a78b0 100644 --- a/core/contacts/contact_import.php +++ b/core/contacts/contact_import.php @@ -382,8 +382,6 @@ //process a chunk of the array if ($row_id === 1000) { //save to the data - $database->app_name = 'contacts'; - $database->app_uuid = '04481e0e-a478-c559-adad-52bd4174574c'; $database->save($array); //clear the array @@ -405,8 +403,6 @@ //save to the data if (!empty($array)) { - $database->app_name = 'contacts'; - $database->app_uuid = '04481e0e-a478-c559-adad-52bd4174574c'; $database->save($array); unset($array); } diff --git a/core/dashboard/app_defaults.php b/core/dashboard/app_defaults.php index 9b377e8188..975ac00838 100644 --- a/core/dashboard/app_defaults.php +++ b/core/dashboard/app_defaults.php @@ -188,8 +188,6 @@ if ($domains_processed == 1) { //exit; //save the data if (!empty($array)) { - $database->app_name = 'dashboard'; - $database->app_uuid = '55533bef-4f04-434a-92af-999c1e9927f7'; $database->save($array, false); } unset($array); @@ -288,11 +286,8 @@ if ($domains_processed == 1) { //save the data if (!empty($array)) { - $database->app_name = 'dashboard'; - $database->app_uuid = '55533bef-4f04-434a-92af-999c1e9927f7'; $database->save($array, false); //$result = $database->message; - //view_array($result); } //delete the temporary permissions diff --git a/core/dashboard/dashboard_edit.php b/core/dashboard/dashboard_edit.php index 1ea64c6f32..fd330ffc70 100644 --- a/core/dashboard/dashboard_edit.php +++ b/core/dashboard/dashboard_edit.php @@ -116,8 +116,6 @@ $array['dashboards'][0]['dashboard_description'] = $dashboard_description; //save the data - $database->app_name = 'dashboard'; - $database->app_uuid = '55533bef-4f04-434a-92af-999c1e9927f7'; $result = $database->save($array); //redirect the user diff --git a/core/dashboard/dashboard_widget_edit.php b/core/dashboard/dashboard_widget_edit.php index 8928c090f2..f00db7e4c2 100644 --- a/core/dashboard/dashboard_widget_edit.php +++ b/core/dashboard/dashboard_widget_edit.php @@ -169,8 +169,6 @@ //delete the group from the widget $array['dashboard_widget_groups'][0]['dashboard_widget_group_uuid'] = $widget_group_uuid; - $database->app_name = 'dashboard'; - $database->app_uuid = '55533bef-4f04-434a-92af-999c1e9927f7'; $database->delete($array); unset($array); @@ -329,8 +327,6 @@ } //save the data - $database->app_name = 'dashboard'; - $database->app_uuid = '55533bef-4f04-434a-92af-999c1e9927f7'; $result = $database->save($array); //redirect the user diff --git a/core/dashboard/index.php b/core/dashboard/index.php index 714e3ee384..2c7a06749a 100644 --- a/core/dashboard/index.php +++ b/core/dashboard/index.php @@ -186,8 +186,6 @@ //save the data if (is_array($array)) { - $database->app_name = 'dashboard'; - $database->app_uuid = '55533bef-4f04-434a-92af-999c1e9927f7'; $database->save($array); } diff --git a/core/databases/database_edit.php b/core/databases/database_edit.php index 677b218728..706adfae0c 100644 --- a/core/databases/database_edit.php +++ b/core/databases/database_edit.php @@ -144,8 +144,6 @@ if (count($_POST)>0 && empty($_POST["persistformvar"])) { //add new uuid $array['databases'][0]['database_uuid'] = uuid(); - $database->app_name = 'databases'; - $database->app_uuid = '8d229b6d-1383-fcec-74c6-4ce1682479e2'; $database->save($array); unset($array); @@ -162,8 +160,7 @@ if (count($_POST)>0 && empty($_POST["persistformvar"])) { //add uuid to update $array['databases'][0]['database_uuid'] = $database_uuid; - $database->app_name = 'databases'; - $database->app_uuid = '8d229b6d-1383-fcec-74c6-4ce1682479e2'; + //save to the database $database->save($array); unset($array); diff --git a/core/databases/databases.php b/core/databases/databases.php index 1ae7c77037..80efa36bd0 100644 --- a/core/databases/databases.php +++ b/core/databases/databases.php @@ -38,9 +38,6 @@ exit; } -//connect to database - $database = database::new(); - //add multi-lingual support $language = new text; $text = $language->get(); diff --git a/core/default_settings/default_setting_edit.php b/core/default_settings/default_setting_edit.php index c338ffc285..e31a2f6d39 100644 --- a/core/default_settings/default_setting_edit.php +++ b/core/default_settings/default_setting_edit.php @@ -178,8 +178,6 @@ $p->add('dialplan_detail_add', 'temp'); } if (is_array($array) && sizeof($array) != 0) { - $database->app_name = 'default_settings'; - $database->app_uuid = '2c2453c0-1bea-4475-9f44-4d969650de09'; $database->save($array); unset($array); @@ -216,8 +214,6 @@ $array['default_settings'][$x]['default_setting_description'] = $default_setting_description; //save to the data - $database->app_name = 'default_settings'; - $database->app_uuid = '2c2453c0-1bea-4475-9f44-4d969650de09'; $database->save($array); $message = $database->message; diff --git a/core/default_settings/default_setting_toggle.php b/core/default_settings/default_setting_toggle.php index 24274fb8c6..9dbc71bb7e 100644 --- a/core/default_settings/default_setting_toggle.php +++ b/core/default_settings/default_setting_toggle.php @@ -60,10 +60,9 @@ //set new status $array['default_settings'][0]['default_setting_uuid'] = $default_setting_uuid; $array['default_settings'][0]['default_setting_enabled'] = $new_status; - $database->app_name = 'default_settings'; - $database->app_uuid = '2c2453c0-1bea-4475-9f44-4d969650de09'; + $database->save($array); - $message = $database->message; + //$message = $database->message; unset($array); //increment toggle total diff --git a/core/default_settings/default_settings.php b/core/default_settings/default_settings.php index e836c612a4..5d0151b295 100644 --- a/core/default_settings/default_settings.php +++ b/core/default_settings/default_settings.php @@ -142,7 +142,6 @@ $sql .= "lower(default_setting_category) = :default_setting_category "; $parameters['default_setting_category'] = strtolower($default_setting_category); } - $database = database::new(); $num_rows = $database->select($sql, $parameters ?? null, 'column'); //get the list diff --git a/core/domain_settings/domain_setting_edit.php b/core/domain_settings/domain_setting_edit.php index 9fe9a2a15c..aec302eb0a 100644 --- a/core/domain_settings/domain_setting_edit.php +++ b/core/domain_settings/domain_setting_edit.php @@ -176,8 +176,6 @@ } if (!empty($array)) { - $database->app_name = 'domain_settings'; - $database->app_uuid = 'b31e723a-bf70-670c-a49b-470d2a232f71'; $database->save($array); unset($array); @@ -223,8 +221,6 @@ $array['domain_settings'][0]['domain_setting_order'] = $domain_setting_order; $array['domain_settings'][0]['domain_setting_enabled'] = $domain_setting_enabled; $array['domain_settings'][0]['domain_setting_description'] = $domain_setting_description; - $database->app_name = 'domain_settings'; - $database->app_uuid = 'b31e723a-bf70-670c-a49b-470d2a232f71'; $database->save($array); unset($array); } @@ -296,8 +292,6 @@ //execute if (!empty($array)) { - $database->app_name = 'domain_settings'; - $database->app_uuid = 'b31e723a-bf70-670c-a49b-470d2a232f71'; $database->save($array); unset($array); diff --git a/core/domains/domain_edit.php b/core/domains/domain_edit.php index c665711410..b00315b783 100644 --- a/core/domains/domain_edit.php +++ b/core/domains/domain_edit.php @@ -143,8 +143,6 @@ $domain_array = $array; //add the new domain - $database->app_name = 'domains'; - $database->app_uuid = '8b91605b-f6d2-42e6-a56d-5d1ded01bb44'; $database->save($array); //add dialplans to the domain @@ -200,8 +198,6 @@ $array['domains'][0]['domain_name'] = $domain_name; $array['domains'][0]['domain_enabled'] = $domain_enabled; $array['domains'][0]['domain_description'] = $domain_description; - $database->app_name = 'domains'; - $database->app_uuid = '8b91605b-f6d2-42e6-a56d-5d1ded01bb44'; $database->save($array); //add dialplans to the domain @@ -484,8 +480,6 @@ $sql .= "var_value = :var_value "; $sql .= "where var_name = 'domain' "; $parameters['var_value'] = $domain_name; - $database->app_name = 'domains'; - $database->app_uuid = '8b91605b-f6d2-42e6-a56d-5d1ded01bb44'; $database->execute($sql, $parameters); unset($sql, $parameters); } diff --git a/core/email_templates/app_defaults.php b/core/email_templates/app_defaults.php index 61b811011f..12a05dc81f 100644 --- a/core/email_templates/app_defaults.php +++ b/core/email_templates/app_defaults.php @@ -602,8 +602,6 @@ $p->add("email_template_edit", 'temp'); //save the data - $database->app_name = 'email_templates'; - $database->app_uuid = '8173e738-2523-46d5-8943-13883befd2fd'; $database->save($array, false); //$message = $database->message; diff --git a/core/email_templates/email_template_edit.php b/core/email_templates/email_template_edit.php index 277462a91f..1661b68346 100644 --- a/core/email_templates/email_template_edit.php +++ b/core/email_templates/email_template_edit.php @@ -126,13 +126,11 @@ $array['email_templates'][0]['template_description'] = $template_description; //save to the data - $database->app_name = 'email_templates'; - $database->app_uuid = '8173e738-2523-46d5-8943-13883befd2fd'; if (!empty($email_template_uuid)) { $database->uuid($email_template_uuid); } $database->save($array); - $message = $database->message; + //$message = $database->message; //redirect the user if (isset($action)) { diff --git a/core/groups/app_defaults.php b/core/groups/app_defaults.php index 27206703e1..f829085e4d 100644 --- a/core/groups/app_defaults.php +++ b/core/groups/app_defaults.php @@ -86,8 +86,6 @@ if ($domains_processed == 1) { } $x++; } - $database->app_name = 'groups'; - $database->app_uuid = '2caf27b0-540a-43d5-bb9b-c9871a1e4f84'; $database->save($array, false); unset($array); } diff --git a/core/groups/group_edit.php b/core/groups/group_edit.php index 25692b91cf..e162d55ef3 100644 --- a/core/groups/group_edit.php +++ b/core/groups/group_edit.php @@ -37,9 +37,6 @@ exit; } -//connect to database - $database = database::new(); - //add multi-lingual support $language = new text; $text = $language->get(); @@ -138,8 +135,6 @@ $array['groups'][0]['group_description'] = $group_description; //save the data - $database->app_name = 'Group Manager'; - $database->app_uuid = '2caf27b0-540a-43d5-bb9b-c9871a1e4f84'; $database->save($array); //update group name in group permissions if group name changed @@ -151,8 +146,6 @@ $parameters['group_name'] = $group_name; $parameters['group_name_previous'] = $group_name_previous; $parameters['group_uuid'] = $group_uuid; - $database->app_name = 'Group Manager'; - $database->app_uuid = '2caf27b0-540a-43d5-bb9b-c9871a1e4f84'; $database->execute($sql, $parameters); unset($sql, $parameters); } diff --git a/core/groups/group_member_add.php b/core/groups/group_member_add.php index c92e33636c..bf14b98449 100644 --- a/core/groups/group_member_add.php +++ b/core/groups/group_member_add.php @@ -68,8 +68,6 @@ $p = permissions::new(); $p->add('user_group_add', 'temp'); - $database->app_name = 'groups'; - $database->app_uuid = '2caf27b0-540a-43d5-bb9b-c9871a1e4f84'; $database->save($array); unset($array); diff --git a/core/groups/group_permissions.php b/core/groups/group_permissions.php index 867460e7a4..a14d96da27 100644 --- a/core/groups/group_permissions.php +++ b/core/groups/group_permissions.php @@ -238,8 +238,6 @@ //save the save array if (!empty($array['save']) && is_array($array['save']) && @sizeof($array['save']) != 0) { - $database->app_name = 'groups'; - $database->app_uuid = '2caf27b0-540a-43d5-bb9b-c9871a1e4f84'; $database->save($array['save']); $message = $database->message; } @@ -247,8 +245,6 @@ //delete the delete array if (!empty($array['delete']) && is_array($array['delete']) && @sizeof($array['delete']) != 0) { if (permission_exists('group_permission_delete')) { - $database->app_name = 'groups'; - $database->app_uuid = '2caf27b0-540a-43d5-bb9b-c9871a1e4f84'; $database->delete($array['delete']); } } diff --git a/core/groups/permissions_copy.php b/core/groups/permissions_copy.php index db3ff6654d..c9d0aa18af 100644 --- a/core/groups/permissions_copy.php +++ b/core/groups/permissions_copy.php @@ -73,8 +73,6 @@ } $array['groups'][0]['group_name'] = $new_group_name; $array['groups'][0]['group_description'] = $new_group_desc; - $database->app_name = 'groups'; - $database->app_uuid = '2caf27b0-540a-43d5-bb9b-c9871a1e4f84'; $database->save($array); unset($array); @@ -114,8 +112,6 @@ $p->add('group_permission_add', 'temp'); //execute insert - $database->app_name = 'groups'; - $database->app_uuid = '2caf27b0-540a-43d5-bb9b-c9871a1e4f84'; $database->save($array); unset($array); diff --git a/core/menu/menu_edit.php b/core/menu/menu_edit.php index f6448122a7..abe162c478 100644 --- a/core/menu/menu_edit.php +++ b/core/menu/menu_edit.php @@ -98,8 +98,6 @@ $array['menus'][0]['menu_name'] = $menu_name; $array['menus'][0]['menu_language'] = $menu_language; $array['menus'][0]['menu_description'] = $menu_description; - $database->app_name = 'menu'; - $database->app_uuid = 'f4b3b3d2-6287-489c-2a00-64529e46f2d7'; $database->save($array); unset($array); @@ -115,8 +113,6 @@ $array['menus'][0]['menu_name'] = $menu_name; $array['menus'][0]['menu_language'] = $menu_language; $array['menus'][0]['menu_description'] = $menu_description; - $database->app_name = 'menu'; - $database->app_uuid = 'f4b3b3d2-6287-489c-2a00-64529e46f2d7'; $database->save($array); unset($array); diff --git a/core/menu/menu_item_edit.php b/core/menu/menu_item_edit.php index 47472d64b4..6d637b0c48 100644 --- a/core/menu/menu_item_edit.php +++ b/core/menu/menu_item_edit.php @@ -83,8 +83,6 @@ //delete the group from the menu item $array['menu_item_groups'][0]['menu_item_group_uuid'] = $menu_item_group_uuid; - $database->app_name = 'menu'; - $database->app_uuid = 'f4b3b3d2-6287-489c-2a00-64529e46f2d7'; $database->delete($array); unset($array); @@ -196,8 +194,6 @@ } $array['menu_items'][0]['menu_item_add_user'] = $_SESSION["username"]; $array['menu_items'][0]['menu_item_add_date'] = 'now()'; - $database->app_name = 'menu'; - $database->app_uuid = 'f4b3b3d2-6287-489c-2a00-64529e46f2d7'; $database->save($array); unset($array); } @@ -222,8 +218,6 @@ } $array['menu_items'][0]['menu_item_add_user'] = $_SESSION["username"]; $array['menu_items'][0]['menu_item_add_date'] = 'now()'; - $database->app_name = 'menu'; - $database->app_uuid = 'f4b3b3d2-6287-489c-2a00-64529e46f2d7'; $database->save($array); unset($array); } @@ -250,8 +244,6 @@ $array['menu_item_groups'][0]['menu_item_uuid'] = $menu_item_uuid; $array['menu_item_groups'][0]['group_name'] = $group_name; $array['menu_item_groups'][0]['group_uuid'] = $group_uuid; - $database->app_name = 'menu'; - $database->app_uuid = 'f4b3b3d2-6287-489c-2a00-64529e46f2d7'; $database->save($array); unset($array); } @@ -271,8 +263,6 @@ $array['menu_languages'][0]['menu_item_uuid'] = $menu_item_uuid; $array['menu_languages'][0]['menu_language'] = $menu_language; $array['menu_languages'][0]['menu_item_title'] = $menu_item_title; - $database->app_name = 'menu'; - $database->app_uuid = 'f4b3b3d2-6287-489c-2a00-64529e46f2d7'; $database->save($array); unset($array); } diff --git a/core/menu/menu_item_list.php b/core/menu/menu_item_list.php index b42a97ac92..dc534059ac 100644 --- a/core/menu/menu_item_list.php +++ b/core/menu/menu_item_list.php @@ -216,8 +216,6 @@ $array['menu_items'][0]['menu_uuid'] = $menu_uuid; $array['menu_items'][0]['menu_item_title'] = $row2['menu_item_title']; $array['menu_items'][0]['menu_item_order'] = $tmp_menu_item_order; - $database->app_name = 'menu'; - $database->app_uuid = 'f4b3b3d2-6287-489c-2a00-64529e46f2d7'; $database->save($array); unset($array); } @@ -427,8 +425,6 @@ $array['menu_items'][0]['menu_uuid'] = $menu_uuid; $array['menu_items'][0]['menu_item_title'] = $row['menu_item_title']; $array['menu_items'][0]['menu_item_order'] = $tmp_menu_item_order; - //$database->app_name = 'menu'; - //$database->app_uuid = 'f4b3b3d2-6287-489c-2a00-64529e46f2d7'; //$database->save($array); unset($array); } diff --git a/core/menu/menu_item_move_down.php b/core/menu/menu_item_move_down.php index 08b80ee5e2..9871c2bf55 100644 --- a/core/menu/menu_item_move_down.php +++ b/core/menu/menu_item_move_down.php @@ -67,8 +67,6 @@ if (count($_GET)>0) { $sql .= "and menu_item_order = :menu_item_order "; $parameters['domain_uuid'] = $domain_uuid; $parameters['menu_item_order'] = $menu_item_order + 1; - $database->app_name = 'menu'; - $database->app_uuid = 'f4b3b3d2-6287-489c-2a00-64529e46f2d7'; $database->execute($sql, $parameters); unset($sql, $parameters); @@ -79,8 +77,6 @@ if (count($_GET)>0) { $sql .= "and menu_item_id = :menu_item_id "; $parameters['domain_uuid'] = $domain_uuid; $parameters['menu_item_id'] = $menu_item_id; - $database->app_name = 'menu'; - $database->app_uuid = 'f4b3b3d2-6287-489c-2a00-64529e46f2d7'; $database->execute($sql, $parameters); unset($sql, $parameters); diff --git a/core/menu/menu_item_move_up.php b/core/menu/menu_item_move_up.php index 84dfe899b5..9b967156fb 100644 --- a/core/menu/menu_item_move_up.php +++ b/core/menu/menu_item_move_up.php @@ -58,8 +58,6 @@ if (count($_GET)>0) { $sql .= "and menu_order = :menu_order "; $parameters['domain_uuid'] = $domain_uuid; $parameters['menu_order'] = $menu_order - 1; - $database->app_name = 'menu'; - $database->app_uuid = 'f4b3b3d2-6287-489c-2a00-64529e46f2d7'; $database->execute($sql, $parameters); unset($sql, $parameters); @@ -70,8 +68,6 @@ if (count($_GET)>0) { $sql .= "and menu_item_id = :menu_item_id "; $parameters['domain_uuid'] = $domain_uuid; $parameters['menu_item_id'] = $menu_item_id; - $database->app_name = 'menu'; - $database->app_uuid = 'f4b3b3d2-6287-489c-2a00-64529e46f2d7'; $database->execute($sql, $parameters); unset($sql, $parameters); diff --git a/core/notifications/app_defaults.php b/core/notifications/app_defaults.php index 27e2e818b1..f52ac0ea9f 100644 --- a/core/notifications/app_defaults.php +++ b/core/notifications/app_defaults.php @@ -39,8 +39,6 @@ if ($domains_processed == 1) { // $p = permissions::new(); // $p->add('notification_add', 'temp'); // //execute insert - // $database->app_name = 'notifications'; - // $database->app_uuid = 'e746fbcb-f67f-4e0e-ab64-c414c01fac11'; // $database->save($array, false); // unset($array); // //revoke temporary permissions diff --git a/core/permissions/app_defaults.php b/core/permissions/app_defaults.php index b3e8fac14f..a57bef6f42 100644 --- a/core/permissions/app_defaults.php +++ b/core/permissions/app_defaults.php @@ -49,8 +49,6 @@ if ($domains_processed == 1) { $p->add('permission_add', 'temp'); //execute insert - $database->app_name = 'permissions'; - $database->app_uuid = 'ce1498a0-46e2-487d-85de-4eec7122a984'; $database->save($array, false); unset($array); diff --git a/core/software/app_defaults.php b/core/software/app_defaults.php index 62e7965bc6..569a158b42 100644 --- a/core/software/app_defaults.php +++ b/core/software/app_defaults.php @@ -51,8 +51,6 @@ if ($domains_processed == 1) { $p->add("software_edit", 'temp'); //save the data - $database->app_name = 'software'; - $database->app_uuid = 'b88c795f-7dea-4fc8-9ab7-edd555242cff'; $database->save($array, false); unset($array); diff --git a/core/upgrade/index.php b/core/upgrade/index.php index 73f35ef30c..8ada90a323 100644 --- a/core/upgrade/index.php +++ b/core/upgrade/index.php @@ -47,9 +47,6 @@ $language = new text; $text = $language->get(); -//connect to the database - $database = database::new(); - //set a default message_timeout $message_timeout = 4*1000; diff --git a/core/user_logs/user_logs.php b/core/user_logs/user_logs.php index 3e789fad63..f869278bfc 100644 --- a/core/user_logs/user_logs.php +++ b/core/user_logs/user_logs.php @@ -81,10 +81,6 @@ } } - //prepare the database object - $database->app_name = 'user_logs'; - $database->app_uuid = '582a13cf-7d75-4ea3-b2d9-60914352d76e'; - //send the array to the database class if (!empty($action) && $action == 'delete' && permission_exists('user_log_delete')) { $database->delete($array); diff --git a/core/user_settings/user_setting_edit.php b/core/user_settings/user_setting_edit.php index 11a92209ce..b69c525a08 100644 --- a/core/user_settings/user_setting_edit.php +++ b/core/user_settings/user_setting_edit.php @@ -173,8 +173,6 @@ if (!empty($_POST) && empty($_POST["persistformvar"])) { $array['dialplan_details'][0]['dialplan_detail_group'] = 0; } if (is_array($array) && sizeof($array) != 0) { - $database->app_name = 'user_settings'; - $database->app_uuid = '3a3337f7-78d1-23e3-0cfd-f14499b8ed97'; $database->save($array); unset($array); @@ -205,8 +203,6 @@ if (!empty($_POST) && empty($_POST["persistformvar"])) { $array['user_settings'][0]['user_setting_enabled'] = $user_setting_enabled; $array['user_settings'][0]['user_setting_description'] = $user_setting_description; - $database->app_name = 'user_settings'; - $database->app_uuid = '3a3337f7-78d1-23e3-0cfd-f14499b8ed97'; $database->save($array); unset($array); } @@ -266,8 +262,6 @@ if (!empty($_POST) && empty($_POST["persistformvar"])) { $p = permissions::new(); $p->add('dialplan_detail_add', 'temp'); - $database->app_name = 'user_settings'; - $database->app_uuid = '3a3337f7-78d1-23e3-0cfd-f14499b8ed97'; $database->save($array); unset($array); @@ -284,8 +278,6 @@ if (!empty($_POST) && empty($_POST["persistformvar"])) { $p = permissions::new(); $p->add('dialplan_detail_edit', 'temp'); - $database->app_name = 'user_settings'; - $database->app_uuid = '3a3337f7-78d1-23e3-0cfd-f14499b8ed97'; $database->save($array); unset($array); diff --git a/core/user_settings/user_settings.php b/core/user_settings/user_settings.php index 23473d1cf9..f6dab8db1d 100644 --- a/core/user_settings/user_settings.php +++ b/core/user_settings/user_settings.php @@ -99,8 +99,6 @@ //update setting $array['user_settings'][0]['user_setting_uuid'] = $user_setting_uuids[0]; $array['user_settings'][0]['user_setting_enabled'] = $enabled; - $database->app_name = 'user_settings'; - $database->app_uuid = '3a3337f7-78d1-23e3-0cfd-f14499b8ed97'; $database->save($array); unset($array); diff --git a/core/users/app_defaults.php b/core/users/app_defaults.php index 70e1f1b044..c9b6313b7c 100644 --- a/core/users/app_defaults.php +++ b/core/users/app_defaults.php @@ -155,8 +155,6 @@ if ($domains_processed == 1) { $p->add("default_setting_edit", 'temp'); //save to the data - $database->app_name = 'default_setting'; - $database->app_uuid = '2c2453c0-1bea-4475-9f44-4d969650de09'; $database->save($array, false); unset($array); @@ -205,8 +203,6 @@ if ($domains_processed == 1) { $p->add("email_template_edit", 'temp'); //save to the data - $database->app_name = 'email_templates'; - $database->app_uuid = '8173e738-2523-46d5-8943-13883befd2fd'; $database->save($array, false); unset($array); diff --git a/core/users/user_imports.php b/core/users/user_imports.php index 84320d5ed1..3ee5e77d2b 100644 --- a/core/users/user_imports.php +++ b/core/users/user_imports.php @@ -347,8 +347,6 @@ if ($row_id === 1000) { //save to the data - $database->app_name = 'users'; - $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; $database->save($array); //$message = $database->message; @@ -373,8 +371,6 @@ //save to the data if (!empty($array)) { - $database->app_name = 'users'; - $database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e'; $database->save($array); //$message = $database->message; unset($array); diff --git a/resources/check_auth.php b/resources/check_auth.php index 459fcc9c3d..18405cafd4 100644 --- a/resources/check_auth.php +++ b/resources/check_auth.php @@ -143,9 +143,6 @@ //if logged in, redirect to login destination if (!isset($_REQUEST["key"])) { - //create database object - $database = database::new(); - //connect to the settings object $settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid, 'user_uuid' => $user_uuid]); diff --git a/resources/footer.php b/resources/footer.php index 9c3b34eccd..530568d34a 100644 --- a/resources/footer.php +++ b/resources/footer.php @@ -30,7 +30,6 @@ //database and settings $domain_uuid = $_SESSION['domain_uuid'] ?? ''; $user_uuid = $_SESSION['user_uuid'] ?? ''; - $database = database::new(); $settings = new settings(['database' => $database, 'domain_uuid' => $domain_uuid, 'user_uuid' => $user_uuid]); //set variables if not set diff --git a/resources/functions.php b/resources/functions.php index 066ac8b22a..3e2109da89 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -360,8 +360,7 @@ if (!function_exists('permission_exists')) { function permission_exists($permission_name) { - global $domain_uuid, $user_uuid; - $database = database::new(); + global $database, $domain_uuid, $user_uuid; $permission = permissions::new($database, $domain_uuid, $user_uuid); return $permission->exists($permission_name); } @@ -383,10 +382,9 @@ if (!function_exists('superadmin_list')) { function superadmin_list() { - global $domain_uuid; + global $database, $domain_uuid; $sql = "select * from v_user_groups "; $sql .= "where group_name = 'superadmin' "; - $database = database::new(); $result = $database->select($sql, null, 'all'); $superadmin_list = "||"; if (is_array($result) && @sizeof($result) != 0) { @@ -417,7 +415,7 @@ function html_select_other($table_name, $field_name, $sql_where_optional, $field_current_value, $sql_order_by = null, $label_other = 'Other...') { //html select other: build a select box from distinct items in db with option for other - global $domain_uuid; + global $database, $domain_uuid; $table_name = preg_replace("#[^a-zA-Z0-9_]#", "", $table_name); $field_name = preg_replace("#[^a-zA-Z0-9_]#", "", $field_name); @@ -431,7 +429,6 @@ $sql = "select distinct(" . $field_name . ") as " . $field_name . " "; $sql .= "from " . $table_name . " " . $sql_where_optional . " "; $sql .= "order by " . (!empty($sql_order_by) ? $sql_order_by : $field_name . ' asc'); - $database = database::new(); $result = $database->select($sql, null, 'all'); if (is_array($result) && @sizeof($result) != 0) { foreach ($result as $field) { @@ -461,7 +458,7 @@ function html_select($table_name, $field_name, $sql_where_optional, $field_current_value, $field_value = '', $style = '', $on_change = '') { //html select: build a select box from distinct items in db - global $domain_uuid; + global $database, $domain_uuid; $table_name = preg_replace("#[^a-zA-Z0-9_]#", "", $table_name); $field_name = preg_replace("#[^a-zA-Z0-9_]#", "", $field_name); @@ -479,7 +476,6 @@ $sql = "select distinct(" . $field_name . ") as " . $field_name . " from " . $table_name . " " . $sql_where_optional . " "; } - $database = database::new(); $result = $database->select($sql, null, 'all'); if (is_array($result) && @sizeof($result) != 0) { foreach ($result as $field) { @@ -713,13 +709,12 @@ if (!function_exists('username_exists')) { function username_exists($username) { - global $domain_uuid; + global $database, $domain_uuid; $sql = "select count(*) from v_users "; $sql .= "where domain_uuid = :domain_uuid "; $sql .= "and username = :username "; $parameters['domain_uuid'] = $domain_uuid; $parameters['username'] = $username; - $database = database::new(); $num_rows = $database->select($sql, $parameters, 'column'); return $num_rows > 0 ? true : false; } @@ -729,14 +724,13 @@ if (!function_exists('add_extension_user')) { function add_extension_user($extension_uuid, $username) { - global $domain_uuid; + global $database, $domain_uuid; //get the user_uuid by using the username $sql = "select user_uuid from v_users "; $sql .= "where domain_uuid = :domain_uuid "; $sql .= "and username = :username "; $parameters['domain_uuid'] = $domain_uuid; $parameters['username'] = $username; - $database = database::new(); $user_uuid = $database->select($sql, $parameters, 'column'); unset($sql, $parameters); @@ -747,7 +741,6 @@ $sql .= "and user_uuid = :user_uuid "; $parameters['domain_uuid'] = $domain_uuid; $parameters['user_uuid'] = $user_uuid; - $database = database::new(); $num_rows = $database->select($sql, $parameters, 'column'); unset($sql, $parameters); @@ -763,9 +756,6 @@ $p = permissions::new(); $p->add('extension_user_add', 'temp'); //execute insert - $database = database::new(); - $database->app_name = 'function-add_extension_user'; - $database->app_uuid = 'e68d9689-2769-e013-28fa-6214bf47fca3'; $database->save($array); unset($array); //revoke temporary permissions @@ -779,7 +769,7 @@ if (!function_exists('user_add')) { function user_add($username, $password, $user_email = '') { - global $domain_uuid; + global $database, $domain_uuid; if (empty($username)) { return false; } @@ -812,12 +802,11 @@ $p = permissions::new(); $p->add('user_add', 'temp'); $p->add('user_group_add', 'temp'); - //execute insert - $database = database::new(); - $database->app_name = 'function-user_add'; - $database->app_uuid = '15a8d74b-ac7e-4468-add4-3e6ebdcb8e22'; + + //save the data insert $database->save($array); unset($array); + //revoke temporary permissions $p->delete('user_add', 'temp'); $p->delete('user_group_add', 'temp'); @@ -2036,8 +2025,8 @@ if (!function_exists('get_countries')) { function get_countries() { + global $database; $sql = "select * from v_countries order by country asc"; - $database = database::new(); $result = $database->select($sql, null, 'all'); unset($sql); diff --git a/resources/header.php b/resources/header.php index b158e2d01d..868bb54f72 100644 --- a/resources/header.php +++ b/resources/header.php @@ -27,9 +27,6 @@ //includes files require_once __DIR__ . "/require.php"; -//connect to the database if not initialized - $database = database::new(); - //set the domains session if (!isset($_SESSION['domains'])) { $domain = new domains(); diff --git a/resources/login.php b/resources/login.php index 0bcf21bfce..b3b0c7eda0 100644 --- a/resources/login.php +++ b/resources/login.php @@ -31,9 +31,6 @@ $language = new text; $text = $language->get(null,'core/user_settings'); -//connect to the database - $database = database::new(); - //set the current domain_uuid $domain_uuid = $_SESSION['domain_uuid'] ?? ''; diff --git a/secure/fax_to_email.php b/secure/fax_to_email.php index 4df45e51eb..7303493263 100644 --- a/secure/fax_to_email.php +++ b/secure/fax_to_email.php @@ -430,9 +430,7 @@ if (!function_exists('fax_split_dtmf')) { $p = permissions::new(); $p->add('fax_queue_add', 'temp'); - //save the data - $database->app_name = 'fax_queue'; - $database->app_uuid = '3656287f-4b22-4cf1-91f6-00386bf488f4'; + //save to the database $database->save($array); //remove temporary permisison