From 86bba631c1cdaf01869f48eec1d07c7fa35e5582 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 15 Apr 2020 13:11:29 -0600 Subject: [PATCH 01/30] Extensions - Edit: Hide User select if empty. --- app/extensions/extension_edit.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/extensions/extension_edit.php b/app/extensions/extension_edit.php index 0ce914f317..3454c094ea 100644 --- a/app/extensions/extension_edit.php +++ b/app/extensions/extension_edit.php @@ -969,17 +969,18 @@ echo " \n"; echo "
\n"; } - - echo " \n"; + echo " \n"; + foreach($users as $field) { + echo " \n"; + } + echo " "; + if ($action == "update") { + echo button::create(['type'=>'submit','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add']]); + } + echo "
\n"; } - echo " "; - if ($action == "update") { - echo button::create(['type'=>'submit','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add']]); - } - echo "
\n"; echo " ".$text['description-user_list']."\n"; echo "
\n"; echo " "; From c4f410aff0b58fd5e8b1f4f789a2d4a36080c4da Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 15 Apr 2020 15:07:52 -0600 Subject: [PATCH 02/30] Call Flows - List: Fix Status toggle. --- app/call_flows/call_flows.php | 2 +- app/call_flows/resources/classes/call_flows.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/call_flows/call_flows.php b/app/call_flows/call_flows.php index 55ec083021..c04299a2c1 100644 --- a/app/call_flows/call_flows.php +++ b/app/call_flows/call_flows.php @@ -245,7 +245,7 @@ } if (permission_exists('call_flow_edit')) { echo " "; - echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($row['call_flow_enabled'] == "true" ? 'true' : 'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); document.getElementById('toggle_field').value = 'call_flow_enabled';list_form_submit('form_list')"]); + echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.($row['call_flow_enabled'] == "true" ? 'true' : 'false')],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); document.getElementById('toggle_field').value = 'call_flow_enabled'; list_form_submit('form_list')"]); } else { echo " "; diff --git a/app/call_flows/resources/classes/call_flows.php b/app/call_flows/resources/classes/call_flows.php index 10320a3e07..ee92278e09 100644 --- a/app/call_flows/resources/classes/call_flows.php +++ b/app/call_flows/resources/classes/call_flows.php @@ -217,8 +217,10 @@ if (!class_exists('call_flows')) { foreach($call_flows as $uuid => $call_flow) { $array[$this->table][$x][$this->uuid_prefix.'uuid'] = $uuid; $array[$this->table][$x][$this->toggle_field] = $call_flow['state'] == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0]; - $array['dialplans'][$x]['dialplan_uuid'] = $call_flow['dialplan_uuid']; - $array['dialplans'][$x]['dialplan_enabled'] = $call_flow['state'] == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0]; + if ($this->toggle_field == 'call_flow_enabled') { + $array['dialplans'][$x]['dialplan_uuid'] = $call_flow['dialplan_uuid']; + $array['dialplans'][$x]['dialplan_enabled'] = $call_flow['state'] == $this->toggle_values[0] ? $this->toggle_values[1] : $this->toggle_values[0]; + } $x++; } From c4c5a2e84cbd8fac80b80ff5ee8cd372c1387469 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 15 Apr 2020 17:33:22 -0600 Subject: [PATCH 03/30] Devices - Edit: Better implementation of available permissions. --- app/devices/device_edit.php | 265 ++++++++++++++++++++++-------------- 1 file changed, 161 insertions(+), 104 deletions(-) diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index 6a7a05ac9e..d0a90e7e0b 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -104,8 +104,6 @@ } unset($sql, $parameters, $row); } - //get assigned user - $device_user_uuid = $_POST["device_user_uuid"]; //devices $domain_uuid = $_POST["domain_uuid"]; $device_uuid = $_POST["device_uuid"]; @@ -242,99 +240,146 @@ //prepare the array $array['devices'][0]['domain_uuid'] = $domain_uuid; $array['devices'][0]['device_uuid'] = $device_uuid; - $array['devices'][0]['device_mac_address'] = $device_mac_address; + if (permission_exists('device_mac_address')) { + $array['devices'][0]['device_mac_address'] = $device_mac_address; + } //$array['devices'][0]['device_provisioned_ip'] = $device_provisioned_ip; - $array['devices'][0]['domain_uuid'] = $domain_uuid; - $array['devices'][0]['device_label'] = $device_label; - $array['devices'][0]['device_user_uuid'] = $device_user_uuid; - $array['devices'][0]['device_username'] = $device_username; - $array['devices'][0]['device_password'] = $device_password; - $array['devices'][0]['device_vendor'] = $device_vendor; - $array['devices'][0]['device_uuid_alternate'] = $device_uuid_alternate; - $array['devices'][0]['device_model'] = $device_model; - $array['devices'][0]['device_firmware_version'] = $device_firmware_version; - $array['devices'][0]['device_enabled'] = $device_enabled; - $array['devices'][0]['device_enabled_date'] = 'now()'; - $array['devices'][0]['device_template'] = $device_template; - $array['devices'][0]['device_profile_uuid'] = $device_profile_uuid; - $array['devices'][0]['device_description'] = $device_description; + if (permission_exists('device_label')) { + $array['devices'][0]['device_label'] = $device_label; + } + if (permission_exists('device_user') && is_uuid($device_user_uuid)) { + $array['devices'][0]['device_user_uuid'] = $device_user_uuid; + } + if (permission_exists('device_username_password')) { + $array['devices'][0]['device_username'] = $device_username; + $array['devices'][0]['device_password'] = $device_password; + } + if (permission_exists('device_vendor')) { + $array['devices'][0]['device_vendor'] = $device_vendor; + } + if (permission_exists('device_alternate') && is_uuid($device_uuid_alternate)) { + $array['devices'][0]['device_uuid_alternate'] = $device_uuid_alternate; + } + if (permission_exists('device_model')) { + $array['devices'][0]['device_model'] = $device_model; + } + if (permission_exists('device_firmware')) { + $array['devices'][0]['device_firmware_version'] = $device_firmware_version; + } + if (permission_exists('device_enable')) { + $array['devices'][0]['device_enabled'] = $device_enabled; + $array['devices'][0]['device_enabled_date'] = 'now()'; + } + if (permission_exists('device_template')) { + $array['devices'][0]['device_template'] = $device_template; + } + if (permission_exists('device_profile_edit') && is_uuid($device_profile_uuid)) { + $array['devices'][0]['device_profile_uuid'] = $device_profile_uuid; + } + if (permission_exists('device_description')) { + $array['devices'][0]['device_description'] = $device_description; + } - $y = 0; - foreach ($device_lines as $row) { - if (strlen($row['line_number']) > 0) { - if (is_uuid($row["device_line_uuid"])) { - $device_line_uuid = $row["device_line_uuid"]; + if (permission_exists('device_line_edit')) { + $y = 0; + foreach ($device_lines as $row) { + if (strlen($row['line_number']) > 0) { + if (is_uuid($row["device_line_uuid"])) { + $device_line_uuid = $row["device_line_uuid"]; + } + else { + $device_line_uuid = uuid(); + } + $array['devices'][0]['device_lines'][$y]['domain_uuid'] = $domain_uuid; + $array['devices'][0]['device_lines'][$y]['device_uuid'] = $device_uuid; + $array['devices'][0]['device_lines'][$y]['device_line_uuid'] = $device_line_uuid; + $array['devices'][0]['device_lines'][$y]['line_number'] = $row["line_number"]; + $array['devices'][0]['device_lines'][$y]['server_address'] = $row["server_address"]; + if (permission_exists('device_line_outbound_proxy_primary')) { + $array['devices'][0]['device_lines'][$y]['outbound_proxy_primary'] = $row["outbound_proxy_primary"]; + } + if (permission_exists('device_line_outbound_proxy_secondary')) { + $array['devices'][0]['device_lines'][$y]['outbound_proxy_secondary'] = $row["outbound_proxy_secondary"]; + } + if (permission_exists('device_line_server_address_primary')) { + $array['devices'][0]['device_lines'][$y]['server_address_primary'] = $row["server_address_primary"]; + } + if (permission_exists('device_line_server_address_secondary')) { + $array['devices'][0]['device_lines'][$y]['server_address_secondary'] = $row["server_address_secondary"]; + } + $array['devices'][0]['device_lines'][$y]['display_name'] = $row["display_name"]; + $array['devices'][0]['device_lines'][$y]['user_id'] = $row["user_id"]; + if (permission_exists('device_line_auth_id')) { + $array['devices'][0]['device_lines'][$y]['auth_id'] = $row["auth_id"]; + } + if (permission_exists('device_line_password')) { + $array['devices'][0]['device_lines'][$y]['password'] = $row["password"]; + } + $array['devices'][0]['device_lines'][$y]['shared_line'] = $row["shared_line"]; + $array['devices'][0]['device_lines'][$y]['enabled'] = $row["enabled"]; + $array['devices'][0]['device_lines'][$y]['sip_port'] = $row["sip_port"]; + $array['devices'][0]['device_lines'][$y]['sip_transport'] = $row["sip_transport"]; + $array['devices'][0]['device_lines'][$y]['register_expires'] = $row["register_expires"]; + $y++; } - else { - $device_line_uuid = uuid(); - } - $array['devices'][0]['device_lines'][$y]['domain_uuid'] = $domain_uuid; - $array['devices'][0]['device_lines'][$y]['device_uuid'] = $device_uuid; - $array['devices'][0]['device_lines'][$y]['device_line_uuid'] = $device_line_uuid; - $array['devices'][0]['device_lines'][$y]['line_number'] = $row["line_number"]; - $array['devices'][0]['device_lines'][$y]['server_address'] = $row["server_address"]; - $array['devices'][0]['device_lines'][$y]['outbound_proxy_primary'] = $row["outbound_proxy_primary"]; - $array['devices'][0]['device_lines'][$y]['outbound_proxy_secondary'] = $row["outbound_proxy_secondary"]; - $array['devices'][0]['device_lines'][$y]['server_address_primary'] = $row["server_address_primary"]; - $array['devices'][0]['device_lines'][$y]['server_address_secondary'] = $row["server_address_secondary"]; - $array['devices'][0]['device_lines'][$y]['display_name'] = $row["display_name"]; - $array['devices'][0]['device_lines'][$y]['user_id'] = $row["user_id"]; - $array['devices'][0]['device_lines'][$y]['auth_id'] = $row["auth_id"]; - $array['devices'][0]['device_lines'][$y]['password'] = $row["password"]; - $array['devices'][0]['device_lines'][$y]['shared_line'] = $row["shared_line"]; - $array['devices'][0]['device_lines'][$y]['enabled'] = $row["enabled"]; - $array['devices'][0]['device_lines'][$y]['sip_port'] = $row["sip_port"]; - $array['devices'][0]['device_lines'][$y]['sip_transport'] = $row["sip_transport"]; - $array['devices'][0]['device_lines'][$y]['register_expires'] = $row["register_expires"]; - $y++; } } - $y = 0; - foreach ($device_keys as $row) { - if (strlen($row['device_key_category']) > 0) { - if (is_uuid($row["device_key_uuid"])) { - $device_key_uuid = $row["device_key_uuid"]; + if (permission_exists('device_key_edit')) { + $y = 0; + foreach ($device_keys as $row) { + if (strlen($row['device_key_category']) > 0) { + if (is_uuid($row["device_key_uuid"])) { + $device_key_uuid = $row["device_key_uuid"]; + } + else { + $device_key_uuid = uuid(); + } + $array['devices'][0]['device_keys'][$y]['domain_uuid'] = $domain_uuid; + $array['devices'][0]['device_keys'][$y]['device_uuid'] = $device_uuid; + $array['devices'][0]['device_keys'][$y]['device_key_uuid'] = $device_key_uuid; + $array['devices'][0]['device_keys'][$y]['device_key_category'] = $row["device_key_category"]; + $array['devices'][0]['device_keys'][$y]['device_key_vendor'] = $row["device_key_vendor"]; + if (permission_exists('device_key_id')) { + $array['devices'][0]['device_keys'][$y]['device_key_id'] = $row["device_key_id"]; + } + $array['devices'][0]['device_keys'][$y]['device_key_type'] = $row["device_key_type"]; + if (permission_exists('device_key_line')) { + $array['devices'][0]['device_keys'][$y]['device_key_line'] = $row["device_key_line"]; + } + $array['devices'][0]['device_keys'][$y]['device_key_value'] = $row["device_key_value"]; + if (permission_exists('device_key_extension')) { + $array['devices'][0]['device_keys'][$y]['device_key_extension'] = $row["device_key_extension"]; + } + //$array['devices'][0]['device_keys'][$y]['device_key_protected'] = $row["device_key_protected"]; + $array['devices'][0]['device_keys'][$y]['device_key_label'] = $row["device_key_label"]; + $array['devices'][0]['device_keys'][$y]['device_key_icon'] = $row["device_key_icon"]; + $y++; } - else { - $device_key_uuid = uuid(); - } - $array['devices'][0]['device_keys'][$y]['domain_uuid'] = $domain_uuid; - $array['devices'][0]['device_keys'][$y]['device_uuid'] = $device_uuid; - $array['devices'][0]['device_keys'][$y]['device_key_uuid'] = $device_key_uuid; - $array['devices'][0]['device_keys'][$y]['device_key_category'] = $row["device_key_category"]; - $array['devices'][0]['device_keys'][$y]['device_key_vendor'] = $row["device_key_vendor"]; - $array['devices'][0]['device_keys'][$y]['device_key_id'] = $row["device_key_id"]; - $array['devices'][0]['device_keys'][$y]['device_key_type'] = $row["device_key_type"]; - $array['devices'][0]['device_keys'][$y]['device_key_line'] = $row["device_key_line"]; - $array['devices'][0]['device_keys'][$y]['device_key_value'] = $row["device_key_value"]; - $array['devices'][0]['device_keys'][$y]['device_key_extension'] = $row["device_key_extension"]; - //$array['devices'][0]['device_keys'][$y]['device_key_protected'] = $row["device_key_protected"]; - $array['devices'][0]['device_keys'][$y]['device_key_label'] = $row["device_key_label"]; - $array['devices'][0]['device_keys'][$y]['device_key_icon'] = $row["device_key_icon"]; - $y++; } } - $y = 0; - foreach ($device_settings as $row) { - if (strlen($row['device_setting_subcategory']) > 0) { - if (is_uuid($row["device_setting_uuid"])) { - $device_setting_uuid = $row["device_setting_uuid"]; + if (permission_exists('device_setting_edit')) { + $y = 0; + foreach ($device_settings as $row) { + if (strlen($row['device_setting_subcategory']) > 0) { + if (is_uuid($row["device_setting_uuid"])) { + $device_setting_uuid = $row["device_setting_uuid"]; + } + else { + $device_setting_uuid = uuid(); + } + $array['devices'][0]['device_settings'][$y]['domain_uuid'] = $domain_uuid; + $array['devices'][0]['device_settings'][$y]['device_uuid'] = $device_uuid; + $array['devices'][0]['device_settings'][$y]['device_setting_uuid'] = $device_setting_uuid; + $array['devices'][0]['device_settings'][$y]['device_setting_category'] = $row["device_setting_category"]; + $array['devices'][0]['device_settings'][$y]['device_setting_subcategory'] = $row["device_setting_subcategory"]; + $array['devices'][0]['device_settings'][$y]['device_setting_name'] = $row["device_setting_name"]; + $array['devices'][0]['device_settings'][$y]['device_setting_value'] = $row["device_setting_value"]; + $array['devices'][0]['device_settings'][$y]['device_setting_enabled'] = $row["device_setting_enabled"]; + $array['devices'][0]['device_settings'][$y]['device_setting_description'] = $row["device_setting_description"]; + $y++; } - else { - $device_setting_uuid = uuid(); - } - $array['devices'][0]['device_settings'][$y]['domain_uuid'] = $domain_uuid; - $array['devices'][0]['device_settings'][$y]['device_uuid'] = $device_uuid; - $array['devices'][0]['device_settings'][$y]['device_setting_uuid'] = $device_setting_uuid; - $array['devices'][0]['device_settings'][$y]['device_setting_category'] = $row["device_setting_category"]; - $array['devices'][0]['device_settings'][$y]['device_setting_subcategory'] = $row["device_setting_subcategory"]; - $array['devices'][0]['device_settings'][$y]['device_setting_name'] = $row["device_setting_name"]; - $array['devices'][0]['device_settings'][$y]['device_setting_value'] = $row["device_setting_value"]; - $array['devices'][0]['device_settings'][$y]['device_setting_enabled'] = $row["device_setting_enabled"]; - $array['devices'][0]['device_settings'][$y]['device_setting_description'] = $row["device_setting_description"]; - $y++; } } @@ -906,7 +951,7 @@ echo "\n"; } - if (permission_exists('device_line_view')) { + if (permission_exists('device_line_edit')) { echo " "; echo " ".$text['label-lines'].""; echo " "; @@ -1159,9 +1204,13 @@ if ($vendor_count == 0) { echo " \n"; echo " ".$text['label-device_key_category']."\n"; - echo " ".$text['label-device_key_id']."\n"; + if (permission_exists('device_key_id')) { + echo " ".$text['label-device_key_id']."\n"; + } echo " ".$text['label-device_key_type']."\n"; - echo " ".$text['label-device_key_line']."\n"; + if (permission_exists('device_key_line')) { + echo " ".$text['label-device_key_line']."\n"; + } echo " ".$text['label-device_key_value']."\n"; if (permission_exists('device_key_extension')) { echo " ".$text['label-device_key_extension']."\n"; @@ -1183,13 +1232,17 @@ if ($previous_device_key_vendor != $row['device_key_vendor']) { echo " \n"; echo " ".$text['label-device_key_category']."\n"; - echo " ".$text['label-device_key_id']."\n"; + if (permission_exists('device_key_id')) { + echo " ".$text['label-device_key_id']."\n"; + } if ($vendor_count > 1 && strlen($row['device_key_vendor']) > 0) { echo " ".ucwords($row['device_key_vendor'])."\n"; } else { echo " ".$text['label-device_key_type']."\n"; } - echo " ".$text['label-device_key_line']."\n"; + if (permission_exists('device_key_line')) { + echo " ".$text['label-device_key_line']."\n"; + } echo " ".$text['label-device_key_value']."\n"; if (permission_exists('device_key_extension')) { echo " ".$text['label-device_key_extension']."\n"; @@ -1333,15 +1386,17 @@ echo " \n"; echo "\n"; - echo "\n"; - $selected = "selected='selected'"; - echo " \n"; + echo " \n"; + for ($i = 1; $i <= 255; $i++) { + echo " \n"; + } + echo " \n"; + echo "\n"; } - echo " \n"; - echo "\n"; echo "\n"; //echo " \n"; @@ -1381,14 +1436,16 @@ } echo "\n"; echo "\n"; - echo "\n"; - echo " \n"; + echo " \n"; + for ($l = 0; $l <= 12; $l++) { + echo " \n"; + } + echo " \n"; + echo "\n"; } - echo " \n"; - echo "\n"; echo "\n"; echo " \n"; From 221560d0836a2562a6c84201f90e4508bc8a8a8c Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 16 Apr 2020 14:36:00 -0600 Subject: [PATCH 04/30] Update switch.conf.xml --- resources/templates/conf/autoload_configs/switch.conf.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/templates/conf/autoload_configs/switch.conf.xml b/resources/templates/conf/autoload_configs/switch.conf.xml index dbeee854aa..a543cfce7e 100644 --- a/resources/templates/conf/autoload_configs/switch.conf.xml +++ b/resources/templates/conf/autoload_configs/switch.conf.xml @@ -151,7 +151,7 @@ - + From aec01070494194ef497efe4dbc2f90880ce947bf Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 16 Apr 2020 16:52:58 -0600 Subject: [PATCH 05/30] Update app_config.php --- core/users/app_config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/users/app_config.php b/core/users/app_config.php index ab28445906..931b782218 100644 --- a/core/users/app_config.php +++ b/core/users/app_config.php @@ -99,7 +99,7 @@ $apps[$x]['default_settings'][$y]['default_setting_category'] = "users"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "password_length"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "20"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "12"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "The default length of characters in a user password."; $y++; From b0abe3a5319c7cfeafeeb5cdb21f24616cc41c12 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 16 Apr 2020 17:05:07 -0600 Subject: [PATCH 06/30] Update user_edit.php --- core/users/user_edit.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/users/user_edit.php b/core/users/user_edit.php index 8a2d3a27cd..b1e94d138f 100644 --- a/core/users/user_edit.php +++ b/core/users/user_edit.php @@ -1032,8 +1032,8 @@ echo "\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-enabled']."\n"; @@ -1079,4 +1079,4 @@ //include the footer require_once "resources/footer.php"; -?> \ No newline at end of file +?> From f8d4ff3fd3ca66ec4195df1968a230bada480a20 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 16 Apr 2020 17:07:07 -0600 Subject: [PATCH 07/30] Update app_config.php --- app/extensions/app_config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/extensions/app_config.php b/app/extensions/app_config.php index 52edbc9356..b83732025c 100644 --- a/app/extensions/app_config.php +++ b/app/extensions/app_config.php @@ -230,7 +230,7 @@ $apps[$x]['default_settings'][$y]['default_setting_category'] = "extension"; $apps[$x]['default_settings'][$y]['default_setting_subcategory'] = "password_length"; $apps[$x]['default_settings'][$y]['default_setting_name'] = "numeric"; - $apps[$x]['default_settings'][$y]['default_setting_value'] = "10"; + $apps[$x]['default_settings'][$y]['default_setting_value'] = "20"; $apps[$x]['default_settings'][$y]['default_setting_enabled'] = "true"; $apps[$x]['default_settings'][$y]['default_setting_description'] = "Set the length for generated passwords for extensions."; $y++; From ac85543881105a94bc8efd9cd5f8c32ca1090f2e Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Thu, 16 Apr 2020 17:11:48 -0600 Subject: [PATCH 08/30] Update user_edit.php --- core/users/user_edit.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/core/users/user_edit.php b/core/users/user_edit.php index b1e94d138f..f2e4a211ec 100644 --- a/core/users/user_edit.php +++ b/core/users/user_edit.php @@ -1059,16 +1059,7 @@ } echo " From 2648ef26727193d299ef5af2acb2bcc3d21def67 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 18 Apr 2020 16:47:46 -0600 Subject: [PATCH 27/30] Functions: Increase TLD character length on email address validation. --- resources/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/functions.php b/resources/functions.php index a954b71943..6bb3113db6 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -1019,7 +1019,7 @@ function number_pad($number,$n) { // validate email address syntax if(!function_exists('valid_email')) { function valid_email($email) { - $regex = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]+(\.[A-z0-9]{2,6})?$/'; + $regex = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]+(\.[A-z0-9]{2,7})?$/'; if ($email != "" && preg_match($regex, $email) == 1) { return true; // email address has valid syntax } @@ -1349,7 +1349,7 @@ function number_pad($number,$n) { include_once("resources/phpmailer/class.phpmailer.php"); include_once("resources/phpmailer/class.smtp.php"); - $regexp = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]+\.[A-z0-9]{2,6}$/'; + $regexp = '/^[A-z0-9][\w.-]*@[A-z0-9][\w\-\.]+\.[A-z0-9]{2,7}$/'; $mail = new PHPMailer(); $mail -> IsSMTP(); From 1506505ec62cb1842820d3a063a47fee4d8aa91c Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sun, 19 Apr 2020 21:06:06 -0600 Subject: [PATCH 28/30] Update check_auth.php --- resources/check_auth.php | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/resources/check_auth.php b/resources/check_auth.php index 00d8b38b66..82ff6090b6 100644 --- a/resources/check_auth.php +++ b/resources/check_auth.php @@ -39,7 +39,6 @@ if (!isset($_SESSION)) { session_start(); } //define variables - if (!isset($_SESSION['login']['destination']['url'])) { $_SESSION['login']['destination']['url'] = null; } if (!isset($_SESSION['template_content'])) { $_SESSION["template_content"] = null; } //if the username is not provided then send to login.php @@ -260,12 +259,6 @@ header("Location: ".$path); exit(); } - else if ($_SESSION['login']['destination']['url'] != '') { - if (isset($_SESSION["username"]) && (strlen($_SESSION["username"]) > 0)) { - header("Location: ".$_SESSION['login']['destination']['url']); - exit(); - } - } } //get the domains @@ -286,9 +279,4 @@ date_default_timezone_set($_SESSION["time_zone"]["user"]); } -//hide the path unless logged in as a superadmin. - if (!if_group("superadmin")) { - $v_path_show = false; - } - ?> From 3d31bbac3514ab9f5ca4104663d62c31156ce0a2 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 21 Apr 2020 13:43:32 -0600 Subject: [PATCH 29/30] Update call_center_queue_edit.php --- app/call_centers/call_center_queue_edit.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/call_centers/call_center_queue_edit.php b/app/call_centers/call_center_queue_edit.php index 2ee3b540b1..e911918859 100644 --- a/app/call_centers/call_center_queue_edit.php +++ b/app/call_centers/call_center_queue_edit.php @@ -250,11 +250,13 @@ $queue_timeout_data = implode($action_array); //add the recording path if needed - if (file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$queue_greeting)) { - $queue_greeting_path = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$queue_greeting; - } - else if (trim($queue_greeting) != '') { - $queue_greeting_path = $queue_greeting; + if ($queue_greeting != '') { + if (file_exists($_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$queue_greeting)) { + $queue_greeting_path = $_SESSION['switch']['recordings']['dir'].'/'.$_SESSION['domain_name'].'/'.$queue_greeting; + } + else { + $queue_greeting_path = trim($queue_greeting); + } } //prepare the array From d456f95cee4650fbba467e399dcfd48cd6b4d0fa Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Tue, 21 Apr 2020 14:43:00 -0600 Subject: [PATCH 30/30] Update callcenter.conf.lua --- .../resources/scripts/configuration/callcenter.conf.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua index 3b25f0e370..269963c56b 100644 --- a/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua +++ b/app/scripts/resources/scripts/app/xml_handler/resources/scripts/configuration/callcenter.conf.lua @@ -179,7 +179,7 @@ --get and then set the complete agent_contact with the call_timeout and when necessary confirm --confirm = "group_confirm_file=custom/press_1_to_accept_this_call.wav,group_confirm_key=1"; --if you change this variable also change app/call_center/call_center_agent_edit.php - confirm = "group_confirm_file=custom/press_1_to_accept_this_call.wav,group_confirm_key=1,group_confirm_read_timeout=2000,leg_timeout="..agent_call_timeout; + confirm = "group_confirm_file=ivr/ivr-accept_reject_voicemail.wav,group_confirm_key=1,group_confirm_read_timeout=2000,leg_timeout="..agent_call_timeout; if (string.find(agent_contact, '}') == nil) then --not found if (string.find(agent_contact, 'sofia/gateway') == nil) then @@ -187,10 +187,6 @@ agent_contact = "{call_timeout="..agent_call_timeout..",domain_name="..domain_name..",domain_uuid="..domain_uuid..",sip_h_caller_destination=${caller_destination}}"..agent_contact; else --add the call_timeout and confirm - tmp_pos = string.find(agent_contact, "}"); - tmp_first = string.sub(agent_contact, 0, tmp_pos); - tmp_last = string.sub(agent_contact, tmp_pos); - agent_contact = tmp_first..',call_timeout='..agent_call_timeout..tmp_last; agent_contact = "{"..confirm..",call_timeout="..agent_call_timeout..",domain_name="..domain_name..",domain_uuid="..domain_uuid..",sip_h_caller_destination=${caller_destination}}"..agent_contact; end else