From c6d966395eb8da2652b46cd15f5a55f00a78879c Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 16 Sep 2023 00:22:12 -0600 Subject: [PATCH] Use settings class for app_defaults.php --- app/access_controls/app_defaults.php | 5 +- app/call_centers/app_defaults.php | 4 +- app/conference_controls/app_defaults.php | 2 +- app/conference_profiles/app_defaults.php | 2 +- app/dialplan_inbound/app_defaults.php | 81 -------------------- app/dialplans/app_defaults.php | 2 +- app/extensions/app_defaults.php | 6 +- app/modules/app_defaults.php | 4 +- app/music_on_hold/app_defaults.php | 8 +- app/number_translations/app_defaults.php | 6 +- app/phrases/app_defaults.php | 18 ++--- app/recordings/app_defaults.php | 14 ++-- app/sip_profiles/app_defaults.php | 4 - app/vars/app_defaults.php | 2 - app/voicemails/app_defaults.php | 13 ++-- core/menu/app_defaults.php | 6 +- resources/classes/domains.php | 95 +----------------------- 17 files changed, 44 insertions(+), 228 deletions(-) delete mode 100644 app/dialplan_inbound/app_defaults.php diff --git a/app/access_controls/app_defaults.php b/app/access_controls/app_defaults.php index dd3870e02c..3f35ae8a3f 100644 --- a/app/access_controls/app_defaults.php +++ b/app/access_controls/app_defaults.php @@ -34,7 +34,7 @@ if ($num_rows == 0) { //set the directory - $xml_dir = $_SESSION["switch"]["conf"]["dir"].'/autoload_configs'; + $xml_dir = $setting->get('switch','conf').'/autoload_configs'; $xml_file = $xml_dir."/acl.conf.xml"; $xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/app/switch/resources/conf/autoload_configs/acl.conf'; @@ -54,7 +54,6 @@ $xml_string .= " \n"; $xml_string .= " \n"; $xml_string .= " \n"; - //$xml_string .= " \n"; $xml_string .= " \n"; $xml_string .= " \n"; $xml_string .= "\n"; @@ -159,7 +158,7 @@ //create the event socket connection if (!$fp) { - $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); + $fp = event_socket_create($setting->get('switch','event_socket_ip_address'), $setting->get('switch','event_socket_port'), $setting->get('switch','event_socket_password')); } //reload the acl diff --git a/app/call_centers/app_defaults.php b/app/call_centers/app_defaults.php index 932ae5c102..cf65c0a84f 100644 --- a/app/call_centers/app_defaults.php +++ b/app/call_centers/app_defaults.php @@ -86,8 +86,8 @@ if ($domains_processed == 1) { //add the recording path if needed if ($row['queue_greeting'] != '') { - if (file_exists($_SESSION['switch']['recordings']['dir'].'/'.$row['domain_name'].'/'.$row['queue_greeting'])) { - $queue_greeting_path = $_SESSION['switch']['recordings']['dir'].'/'.$row['domain_name'].'/'.$row['queue_greeting']; + if (file_exists($setting->get('switch','recordings').'/'.$row['domain_name'].'/'.$row['queue_greeting'])) { + $queue_greeting_path = $setting->get('switch','recordings').'/'.$row['domain_name'].'/'.$row['queue_greeting']; } else { $queue_greeting_path = trim($row['queue_greeting']); diff --git a/app/conference_controls/app_defaults.php b/app/conference_controls/app_defaults.php index 199c0fc736..3fbe2544db 100644 --- a/app/conference_controls/app_defaults.php +++ b/app/conference_controls/app_defaults.php @@ -33,7 +33,7 @@ if ($num_rows == 0) { //set the directory - $xml_dir = $_SESSION["switch"]["conf"]["dir"].'/autoload_configs'; + $xml_dir = $setting->get('switch','conf').'/autoload_configs'; $xml_file = $xml_dir."/conference.conf"; $xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/app/switch/resources/conf/autoload_configs/conference.conf'; diff --git a/app/conference_profiles/app_defaults.php b/app/conference_profiles/app_defaults.php index e340044c6a..33f2ae52ce 100644 --- a/app/conference_profiles/app_defaults.php +++ b/app/conference_profiles/app_defaults.php @@ -33,7 +33,7 @@ if ($num_rows == 0) { //set the directory - $xml_dir = $_SESSION["switch"]["conf"]["dir"].'/autoload_configs'; + $xml_dir = $setting->get('switch','conf').'/autoload_configs'; $xml_file = $xml_dir."/conference.conf"; $xml_file_alt = $_SERVER["DOCUMENT_ROOT"].'/'.PROJECT_PATH.'/app/switch/resources/conf/autoload_configs/conference.conf'; diff --git a/app/dialplan_inbound/app_defaults.php b/app/dialplan_inbound/app_defaults.php deleted file mode 100644 index 1399321235..0000000000 --- a/app/dialplan_inbound/app_defaults.php +++ /dev/null @@ -1,81 +0,0 @@ - - Portions created by the Initial Developer are Copyright (C) 2008-2010 - the Initial Developer. All Rights Reserved. - - Contributor(s): - Mark J Crane -*/ - -//if there are multiple domains then update the public dir path to include the domain - if ($domains_processed == 1) { - if (count($_SESSION["domains"]) > 1) { - if (!empty($_SESSION['switch']['dialplan']['dir']) && is_dir($_SESSION['switch']['dialplan']['dir'].'/public')) { - //clear out the old xml files - $v_needle = '_v_'; - if($dh = opendir($_SESSION['switch']['dialplan']['dir'].'/public')) { - $files = Array(); - while($file = readdir($dh)) { - if($file != "." && $file != ".." && $file[0] != '.') { - if(is_dir($dir . "/" . $file)) { - //this is a directory - } else { - if (strpos($file, $v_needle) !== false && substr($file,-4) == '.xml') { - unlink($_SESSION['switch']['dialplan']['dir'].'/public/'.$file); - } - } - } - } - closedir($dh); - } - } - } - } - -//if the public directory doesn't exist then create it - if ($domains_processed == 1) { - if (!empty($_SESSION['switch']['dialplan']['dir'])) { - if (!is_dir($_SESSION['switch']['dialplan']['dir'].'/public')) { - mkdir($_SESSION['switch']['dialplan']['dir'].'/public', 0770, false); - } - } - } - -//if multiple domains then make sure that the dialplan/public/domain_name.xml file exists - if (count($_SESSION["domains"]) > 1) { - //make sure the public directory and xml file exist - if (!empty($_SESSION['switch']['dialplan']['dir'])) { - if (!is_dir($_SESSION['switch']['dialplan']['dir'].'/public'.$_SESSION['domains'][$domain_uuid]['domain_name'])) { - mkdir($_SESSION['switch']['dialplan']['dir'].'/public/'.$_SESSION['domains'][$domain_uuid]['domain_name'], 0770, false); - } - $file = $_SESSION['switch']['dialplan']['dir']."/public/".$_SESSION['domains'][$domain_uuid]['domain_name'].".xml"; - if (!file_exists($file)) { - $fout = fopen($file,"w"); - $xml = "\n"; - $xml .= " \n"; - $xml .= "\n"; - fwrite($fout, $xml); - fclose($fout); - unset($xml,$file); - } - } - } - -?> diff --git a/app/dialplans/app_defaults.php b/app/dialplans/app_defaults.php index c2b0f0d09d..e682eaafb5 100644 --- a/app/dialplans/app_defaults.php +++ b/app/dialplans/app_defaults.php @@ -151,7 +151,7 @@ //add not found dialplan to inbound routes /* if ($domains_processed == 1) { - if (is_readable($_SESSION['switch']['dialplan']['dir'])) { + if (is_readable($setting->get('switch','dialplan'))) { $sql = "select count(*) from v_dialplans "; $sql .= "where dialplan_uuid = 'ea5339de-1982-46ca-9695-c35176165314' "; $database = new database; diff --git a/app/extensions/app_defaults.php b/app/extensions/app_defaults.php index 58cb65d56b..1c65c04d5c 100644 --- a/app/extensions/app_defaults.php +++ b/app/extensions/app_defaults.php @@ -28,9 +28,9 @@ if ($domains_processed == 1) { //create the directory - if (!empty($_SESSION['switch']['extensions']['dir'])) { - if (!is_dir($_SESSION['switch']['extensions']['dir'])) { - mkdir($_SESSION['switch']['extensions']['dir'], 0770, false); + if (!empty($setting->get('switch','extensions'))) { + if (!is_dir($setting->get('switch','extensions'))) { + mkdir($setting->get('switch','extensions'), 0770, false); } } diff --git a/app/modules/app_defaults.php b/app/modules/app_defaults.php index d302555e7f..5527d284f7 100644 --- a/app/modules/app_defaults.php +++ b/app/modules/app_defaults.php @@ -59,8 +59,8 @@ unset($sql, $modules, $index, $row); //use the module class to get the list of modules from the db and add any missing modules - if (isset($_SESSION['switch']['mod']['dir'])) { - $module->dir = $_SESSION['switch']['mod']['dir']; + if (!empty($setting->get('switch','mod'))) { + $module->dir = $setting->get('switch','mod'); $module->get_modules(); $module->synch(); $module->xml(); diff --git a/app/music_on_hold/app_defaults.php b/app/music_on_hold/app_defaults.php index 89a1dd4797..4b68bfc653 100644 --- a/app/music_on_hold/app_defaults.php +++ b/app/music_on_hold/app_defaults.php @@ -27,13 +27,13 @@ if ($domains_processed == 1) { //set the directory - if (isset($_SESSION["switch"]["conf"])) { - $xml_dir = $_SESSION["switch"]["conf"].'/autoload_configs'; + if (!empty($setting->get('switch','conf'))) { + $xml_dir = $setting->get('switch','conf').'/autoload_configs'; $xml_file = $xml_dir."/local_stream.conf"; } //rename the file - if (isset($_SESSION["switch"]["conf"])) { + if (!empty($setting->get('switch','conf'))) { if (file_exists($xml_dir.'/local_stream.conf.xml')) { rename($xml_dir.'/local_stream.conf', $xml_dir.'/'.$xml_file); } @@ -43,7 +43,7 @@ if ($domains_processed == 1) { } //add the music_on_hold list to the database - if (isset($_SESSION["switch"]["conf"])) { + if (!empty($setting->get('switch','conf'))) { $sql = "select count(music_on_hold_uuid) from v_music_on_hold; "; $database = new database; $num_rows = $database->select($sql, null, 'column'); diff --git a/app/number_translations/app_defaults.php b/app/number_translations/app_defaults.php index 7d9da76c09..68fcced967 100644 --- a/app/number_translations/app_defaults.php +++ b/app/number_translations/app_defaults.php @@ -37,11 +37,11 @@ $number_translation->xml = file_get_contents($xml_file); $number_translation->import(); } - + //check for existing configuration - if (!empty($_SESSION['switch']['conf']['dir']) && file_exists($_SESSION['switch']['conf']['dir']."/autoload_configs/translate.conf.xml")) { + if (!empty($setting->get('switch','conf')) && file_exists($setting->get('switch','conf')."/autoload_configs/translate.conf.xml")) { //import existing data - $xml = file_get_contents($_SESSION['switch']['conf']['dir']."/autoload_configs/translate.conf.xml"); + $xml = file_get_contents($setting->get('switch','conf')."/autoload_configs/translate.conf.xml"); //convert the xml string to an xml object $xml = simplexml_load_string($xml); diff --git a/app/phrases/app_defaults.php b/app/phrases/app_defaults.php index fa31dddd71..4a211a17fe 100644 --- a/app/phrases/app_defaults.php +++ b/app/phrases/app_defaults.php @@ -28,9 +28,9 @@ if ($domains_processed == 1) { //create phrases folder and add include line in xml for each language found /* - if (!empty($_SESSION['switch']['languages']['dir'])) { - if (is_readable($_SESSION['switch']['languages']['dir'])) { - $conf_lang_folders = glob($_SESSION['switch']['languages']['dir']."/*"); + if (!empty($setting->get('switch','languages'))) { + if (is_readable($setting->get('switch','languages'))) { + $conf_lang_folders = glob($setting->get('switch','languages')."/*"); foreach ($conf_lang_folders as $conf_lang_folder) { //create phrases folder, if necessary if (!file_exists($conf_lang_folder."/phrases/")) { @@ -65,7 +65,7 @@ if ($domains_processed == 1) { */ //if base64, convert existing incompatible phrases - if (!empty($_SESSION['recordings']['storage_type']['text']) && $_SESSION['recordings']['storage_type']['text'] == 'base64') { + if (!empty($setting->get('recordings','storage_type')) && $setting->get('recordings','storage_type') == 'base64') { $sql = "select phrase_detail_uuid, phrase_detail_data "; $sql .= "from v_phrase_details where phrase_detail_function = 'play-file' "; $database = new database; @@ -74,8 +74,8 @@ if ($domains_processed == 1) { foreach ($result as $index => &$row) { $phrase_detail_uuid = $row['phrase_detail_uuid']; $phrase_detail_data = $row['phrase_detail_data']; - if (substr_count($phrase_detail_data, $_SESSION['switch']['recordings']['dir'].'/'.$domain_name) > 0) { - $phrase_detail_data = str_replace($_SESSION['switch']['recordings']['dir'].'/'.$domain_name.'/', '', $phrase_detail_data); + if (substr_count($phrase_detail_data, $setting->get('switch','recordings').'/'.$domain_name) > 0) { + $phrase_detail_data = str_replace($setting->get('switch','recordings').'/'.$domain_name.'/', '', $phrase_detail_data); } //update function and data to be base64 compatible $phrase_detail_data = "lua(streamfile.lua ".$phrase_detail_data.")"; @@ -100,7 +100,7 @@ if ($domains_processed == 1) { } //if not base64, revert base64 phrases to standard method - else if (!empty($_SESSION['recordings']['storage_type']) && $_SESSION['recordings']['storage_type']['text'] != 'base64') { + else if (!empty($setting->get('recordings','storage_type')) && $setting->get('recordings','storage_type') != 'base64') { $sql = "select phrase_detail_uuid, phrase_detail_data "; $sql .= "from v_phrase_details where "; $sql .= "phrase_detail_function = 'execute' "; @@ -115,7 +115,7 @@ if ($domains_processed == 1) { $phrase_detail_data = str_replace('lua(streamfile.lua ', '', $phrase_detail_data); $phrase_detail_data = str_replace(')', '', $phrase_detail_data); if (substr_count($phrase_detail_data, '/') === 0) { - $phrase_detail_data = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name.'/'.$phrase_detail_data; + $phrase_detail_data = $setting->get('switch','recordings').'/'.$domain_name.'/'.$phrase_detail_data; } $array['phrase_details'][$index]['phrase_detail_uuid'] = $phrase_detail_uuid; $array['phrase_details'][$index]['phrase_detail_function'] = 'play-file'; @@ -142,7 +142,7 @@ if ($domains_processed == 1) { //save_phrases_xml(); //delete the phrase from memcache - $fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']); + $fp = event_socket_create($setting->get('switch','event_socket_ip_address'), $setting->get('switch','event_socket_port'), $setting->get('switch','event_socket_password')); if ($fp) { //get phrase languages $sql = "select distinct phrase_language from v_phrases order by phrase_language asc "; diff --git a/app/recordings/app_defaults.php b/app/recordings/app_defaults.php index 0b88e2121a..ee891fd742 100644 --- a/app/recordings/app_defaults.php +++ b/app/recordings/app_defaults.php @@ -25,9 +25,9 @@ */ //if the recordings directory doesn't exist then create it - if (!empty($_SESSION['switch']['recordings']['dir']) && !empty($domain_name)) { - if (!is_readable($_SESSION['switch']['recordings']['dir']."/".$domain_name)) { - mkdir($_SESSION['switch']['recordings']['dir']."/".$domain_name."/archive", 0770, true); + if (!empty($setting->get('switch','recordings')) && !empty($domain_name)) { + if (!is_readable($setting->get('switch','recordings')."/".$domain_name)) { + mkdir($setting->get('switch','recordings')."/".$domain_name."/archive", 0770, true); } } @@ -35,7 +35,7 @@ if ($domains_processed == 1) { //if base64, populate from existing recording files, then remove - if (!empty($_SESSION['recordings']['storage_type']) && $_SESSION['recordings']['storage_type']['text'] == 'base64') { + if (!empty($setting->get('recordings','storage_type')) && $setting->get('recordings','storage_type') == 'base64') { //get recordings without base64 in db $sql = "select recording_uuid, domain_uuid, recording_filename "; $sql .= "from v_recordings "; @@ -51,7 +51,7 @@ $recording_filename = $row['recording_filename']; //set recording directory - $recording_directory = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name; + $recording_directory = $setting->get('switch','recordings').'/'.$domain_name; //encode recording file (if exists) if (file_exists($recording_directory.'/'.$recording_filename)) { @@ -79,7 +79,7 @@ unset($sql, $result, $row); } //if not base64, decode to local files, remove base64 data from db - else if (!empty($_SESSION['recordings']['storage_type']) && $_SESSION['recordings']['storage_type']['text'] != 'base64') { + else if (!empty($setting->get('recordings','storage_type')) && $setting->get('recordings','storage_type') != 'base64') { //get recordings with base64 in db $sql = "select recording_uuid, domain_uuid, recording_filename, recording_base64 "; $sql .= "from v_recordings "; @@ -95,7 +95,7 @@ $recording_base64 = $row['recording_base64']; //set recording directory - $recording_directory = $_SESSION['switch']['recordings']['dir'].'/'.$domain_name; + $recording_directory = $setting->get('switch','recordings').'/'.$domain_name; //remove local file, if any if (file_exists($recording_directory.'/'.$recording_filename)) { diff --git a/app/sip_profiles/app_defaults.php b/app/sip_profiles/app_defaults.php index 4d755b8e4f..8c7579eb55 100644 --- a/app/sip_profiles/app_defaults.php +++ b/app/sip_profiles/app_defaults.php @@ -142,8 +142,6 @@ //save the sip profile xml save_sip_profile_xml(); - //apply settings reminder - $_SESSION["reload_xml"] = true; } @@ -221,8 +219,6 @@ //save the sip profile xml save_sip_profile_xml(); - //apply settings reminder - $_SESSION["reload_xml"] = true; } diff --git a/app/vars/app_defaults.php b/app/vars/app_defaults.php index 83681e63b6..35c3ebd253 100644 --- a/app/vars/app_defaults.php +++ b/app/vars/app_defaults.php @@ -121,8 +121,6 @@ if ($domains_processed == 1) { function set_country_vars($x) { require "resources/countries.php"; - //$country_iso=$_SESSION['domain']['country']['iso_code']; - $sql = "select default_setting_value "; $sql .= "from v_default_settings "; $sql .= "where default_setting_name = 'iso_code' "; diff --git a/app/voicemails/app_defaults.php b/app/voicemails/app_defaults.php index 7148cac310..9e29cbe31f 100644 --- a/app/voicemails/app_defaults.php +++ b/app/voicemails/app_defaults.php @@ -37,18 +37,18 @@ if ($domains_processed == 1) { unset($sql, $parameters); if (!empty($voicemails) && is_array($voicemails)) { foreach($voicemails as $row) { - if (!empty($_SESSION['switch']['voicemail']['dir']) && !empty($row['voicemail_id']) && is_numeric($row['voicemail_id'])) { - if (!file_exists($_SESSION['switch']['voicemail']['dir']."/default/".$row['domain_name']."/".$row['voicemail_id'])) { - mkdir($_SESSION['switch']['voicemail']['dir']."/default/".$row['domain_name']."/".$row['voicemail_id'], 0770, true); + if (!empty($setting->get('switch','voicemail')) && !empty($row['voicemail_id']) && is_numeric($row['voicemail_id'])) { + if (!file_exists($setting->get('switch','voicemail')."/default/".$row['domain_name']."/".$row['voicemail_id'])) { + mkdir($setting->get('switch','voicemail')."/default/".$row['domain_name']."/".$row['voicemail_id'], 0770, true); } } } } //define initial, get current, define correct languages folder paths - $switch_configuration_dir = !empty($_SESSION['switch']['conf']['dir']) ? $_SESSION['switch']['conf']['dir'] : '/etc/freeswitch'; + $switch_configuration_dir = !empty($setting->get('switch','conf')) ? $setting->get('switch','conf') : '/etc/freeswitch'; $switch_languages_dir_initial = $switch_configuration_dir.'/lang'; - $switch_languages_dir_current = $_SESSION['switch']['languages']['dir'] ?? ''; + $switch_languages_dir_current = $setting->get('switch','languages') ?? ''; $switch_languages_dir_correct = $switch_configuration_dir.'/languages'; //ensure switch using languages (not lang) folder @@ -60,9 +60,6 @@ if ($domains_processed == 1) { //update default setting value if (file_exists($switch_languages_dir_correct)) { - //get the languages directory - $_SESSION['switch']['languages']['dir'] = $switch_languages_dir_correct; - //update languages with the correct path $sql = "update v_default_settings "; $sql .= "set default_setting_value = '".$switch_languages_dir_correct."', "; diff --git a/core/menu/app_defaults.php b/core/menu/app_defaults.php index 9c6a671106..9a63b64af7 100644 --- a/core/menu/app_defaults.php +++ b/core/menu/app_defaults.php @@ -26,10 +26,8 @@ //if there are no items in the menu then add the default menu if ($domains_processed == 1) { - require_once "resources/classes/menu.php"; - $o = new menu; - $o->menu_default(); - unset($o); + $menu = new menu; + $menu->menu_default(); } //if ?> diff --git a/resources/classes/domains.php b/resources/classes/domains.php index 72ad9419ab..9a6dba7342 100644 --- a/resources/classes/domains.php +++ b/resources/classes/domains.php @@ -611,9 +611,6 @@ if (!class_exists('domains')) { $config_path = $config->find(); $config->get(); - //check for default settings - $this->settings(); - //get the list of installed apps from the core and app directories (note: GLOB_BRACE doesn't work on some systems) $config_list_1 = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_config.php"); $config_list_2 = glob($_SERVER["DOCUMENT_ROOT"].PROJECT_PATH."/*/*/app_menu.php"); @@ -633,39 +630,6 @@ if (!class_exists('domains')) { $domains = $database->select($sql, null, 'all'); unset($sql); - //get the domain_settings - $sql = "select * from v_domain_settings "; - $sql .= "where domain_setting_enabled = 'true' "; - $database = new database; - $domain_settings = $database->select($sql, null, 'all'); - unset($sql); - - //get the default settings - $sql = "select * from v_default_settings "; - $sql .= "where default_setting_enabled = 'true' "; - $sql .= "and default_setting_category <> 'switch' "; - $database = new database; - $database_default_settings = $database->select($sql, null, 'all'); - unset($sql); - - //get the domain_uuid - if (is_array($domains)) { - foreach($domains as $row) { - if (count($domains) == 1) { - $_SESSION["domain_uuid"] = $row["domain_uuid"]; - $_SESSION["domain_name"] = $row['domain_name']; - } - else { - if (!empty($domain_array[0]) && (lower_case($row['domain_name']) == lower_case($domain_array[0] ?? '') || lower_case($row['domain_name']) == lower_case('www.'.$domain_array[0] ?? ''))) { - $_SESSION["domain_uuid"] = $row["domain_uuid"]; - $_SESSION["domain_name"] = $row['domain_name']; - } - $_SESSION['domains'][$row['domain_uuid']]['domain_uuid'] = $row['domain_uuid']; - $_SESSION['domains'][$row['domain_uuid']]['domain_name'] = $row['domain_name']; - } - } - } - //loop through all domains $domains_processed = 1; foreach ($domains as $domain) { @@ -676,59 +640,8 @@ if (!class_exists('domains')) { //get the context $context = $domain_name; - //get the default settings - this needs to be done to reset the session values back to the defaults for each domain in the loop - foreach($database_default_settings as $row) { - if ($row['default_setting_enabled'] == 'true') { - $name = $row['default_setting_name']; - $category = $row['default_setting_category']; - $subcategory = $row['default_setting_subcategory']; - if (empty($subcategory)) { - if ($name == "array") { - $_SESSION[$category][] = $row['default_setting_value']; - } - else { - $_SESSION[$category][$name] = $row['default_setting_value']; - } - } - else { - if ($name == "array") { - $_SESSION[$category][$subcategory][] = $row['default_setting_value']; - } - else { - $_SESSION[$category][$subcategory]['uuid'] = $row['default_setting_uuid']; - $_SESSION[$category][$subcategory][$name] = $row['default_setting_value']; - } - } - } - } - - - //set the enabled settings as a session - foreach ($domain_settings as $row) { - if ($row['domain_setting_enabled'] == 'true') { - $name = $row['domain_setting_name']; - $category = $row['domain_setting_category']; - $subcategory = $row['domain_setting_subcategory']; - if (empty($subcategory)) { - //$$category[$name] = $row['domain_setting_value']; - if ($name == "array") { - $_SESSION[$category][] = $row['domain_setting_value']; - } - else { - $_SESSION[$category][$name] = $row['domain_setting_value']; - } - } - else { - //$$category[$subcategory][$name] = $row['domain_setting_value']; - if ($name == "array") { - $_SESSION[$category][$subcategory][] = $row['domain_setting_value']; - } - else { - $_SESSION[$category][$subcategory][$name] = $row['domain_setting_value']; - } - } - } - } + //get the email queue settings + $setting = new settings(["domain_uuid" => $domain_uuid]); //get the list of installed apps from the core and mod directories and execute the php code in app_defaults.php $default_list = glob($_SERVER["DOCUMENT_ROOT"] . PROJECT_PATH . "/*/*/app_defaults.php"); @@ -740,10 +653,6 @@ if (!class_exists('domains')) { $domains_processed++; } - //clear the session variables - unset($_SESSION['domain']); - unset($_SESSION['switch']); - } //end upgrade method /**