diff --git a/app/call_center_active/call_center_active.php b/app/call_center_active/call_center_active.php index 5a87445fbd..5a2c75ffcc 100644 --- a/app/call_center_active/call_center_active.php +++ b/app/call_center_active/call_center_active.php @@ -47,7 +47,7 @@ //get the queue_name and set it as a variable $queue_name = $_GET['queue_name']; - $name = $_GET['name']; + $name = $_GET['name'] ?? null; //get a new session array unset($_SESSION['queues']); diff --git a/app/call_centers/call_center_agent_edit.php b/app/call_centers/call_center_agent_edit.php index 24d941c2f2..2d70b00953 100644 --- a/app/call_centers/call_center_agent_edit.php +++ b/app/call_centers/call_center_agent_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2020 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -87,7 +87,7 @@ //get http post variables and set them to php variables if (!empty($_POST)) { - $call_center_agent_uuid = $_POST["call_center_agent_uuid"]; + $call_center_agent_uuid = $_POST["call_center_agent_uuid"] ?? null; $user_uuid = $_POST["user_uuid"]; $agent_name = $_POST["agent_name"]; $agent_type = $_POST["agent_type"]; @@ -360,7 +360,7 @@ function check_duplicates() { //check agent id var agent_id = document.getElementById('agent_id').value; - $("#duplicate_agent_id_response").load("call_center_agent_edit.php?check=duplicate&agent_id="+agent_id+"&agent_uuid=", function() { + $("#duplicate_agent_id_response").load("call_center_agent_edit.php?check=duplicate&agent_id="+agent_id+"&agent_uuid=", function() { var duplicate_agent_id = false; if ($("#duplicate_agent_id_response").html() != '') { $('#agent_id').addClass('formfld_highlight_bad'); @@ -454,13 +454,8 @@ echo " "; echo " "; unset($users); @@ -509,31 +504,11 @@ echo "\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-status']."\n"; @@ -601,8 +576,8 @@ echo "\n"; echo "\n"; echo " \n"; echo "
\n"; echo $text['description-record_template']."\n"; @@ -635,4 +610,4 @@ //include the footer require_once "resources/footer.php"; -?> +?> \ No newline at end of file diff --git a/app/call_centers/call_center_queue_edit.php b/app/call_centers/call_center_queue_edit.php index ef6a05b64f..da8b4af44b 100644 --- a/app/call_centers/call_center_queue_edit.php +++ b/app/call_centers/call_center_queue_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2022 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -89,7 +89,7 @@ if (!empty($_POST)) { //get the post variables a run a security chack on them //$domain_uuid = $_POST["domain_uuid"]; - $dialplan_uuid = $_POST["dialplan_uuid"]; + $dialplan_uuid = $_POST["dialplan_uuid"] ?? null; $queue_name = $_POST["queue_name"]; $queue_extension = $_POST["queue_extension"]; $queue_greeting = $_POST["queue_greeting"]; @@ -110,13 +110,13 @@ $queue_discard_abandoned_after = $_POST["queue_discard_abandoned_after"]; $queue_abandoned_resume_allowed = $_POST["queue_abandoned_resume_allowed"]; $queue_cid_prefix = $_POST["queue_cid_prefix"]; - $queue_outbound_caller_id_name = $_POST["queue_outbound_caller_id_name"]; - $queue_outbound_caller_id_number = $_POST["queue_outbound_caller_id_number"]; - $queue_announce_position = $_POST["queue_announce_position"]; + $queue_outbound_caller_id_name = $_POST["queue_outbound_caller_id_name"] ?? null; + $queue_outbound_caller_id_number = $_POST["queue_outbound_caller_id_number"] ?? null; + $queue_announce_position = $_POST["queue_announce_position"] ?? null; $queue_announce_sound = $_POST["queue_announce_sound"]; $queue_announce_frequency = $_POST["queue_announce_frequency"]; $queue_cc_exit_keys = $_POST["queue_cc_exit_keys"]; - $queue_email_address = $_POST["queue_email_address"]; + $queue_email_address = $_POST["queue_email_address"] ?? null; $queue_description = $_POST["queue_description"]; //remove invalid characters @@ -362,7 +362,7 @@ if ($queue_time_base_score_sec != '') { $dialplan_xml .= " \n"; } - if ($queue_greeting_path != '') { + if (!empty($queue_greeting_path)) { $dialplan_xml .= " \n"; $greeting_array = explode(':', $queue_greeting_path); if (count($greeting_array) == 1) { @@ -446,9 +446,9 @@ remove_config_from_cache('configuration:callcenter.conf'); //add agent/tier to queue - $agent_name = $_POST["agent_name"]; - $tier_level = $_POST["tier_level"]; - $tier_position = $_POST["tier_position"]; + $agent_name = $_POST["agent_name"] ?? null; + $tier_level = $_POST["tier_level"] ?? null; + $tier_position = $_POST["tier_position"] ?? null; if (!empty($agent_name)) { //setup the event socket connection @@ -735,7 +735,7 @@ echo "\n"; $selected = false; foreach($value as $row) { - if ($queue_greeting == $row["value"]) { + if (!empty($queue_greeting) && $queue_greeting == $row["value"]) { $selected = true; echo " \n"; } @@ -890,7 +890,7 @@ } echo "\n"; - echo "\n"; + echo "\n"; echo " ".$text['label-music_on_hold']."\n"; echo "\n"; echo "\n"; @@ -1248,11 +1248,11 @@ foreach ($recordings as &$row) { $recording_name = $row["recording_name"]; $recording_filename = $row["recording_filename"]; - if ($queue_announce_sound == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename && !empty($queue_announce_sound)) { + if (!empty($queue_announce_sound) && $queue_announce_sound == $_SESSION['switch']['recordings']['dir']."/".$_SESSION['domain_name']."/".$recording_filename) { $tmp_selected = true; echo " \n"; } - else if ($queue_announce_sound == $recording_filename && !empty($queue_announce_sound)) { + else if (!empty($queue_announce_sound) && $queue_announce_sound == $recording_filename) { $tmp_selected = true; echo " \n"; } diff --git a/app/call_centers/cmd.php b/app/call_centers/cmd.php index 82777642ad..768292b9d5 100644 --- a/app/call_centers/cmd.php +++ b/app/call_centers/cmd.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2019 + Portions created by the Initial Developer are Copyright (C) 2008-2023 the Initial Developer. All Rights Reserved. Contributor(s): @@ -45,7 +45,7 @@ $cmd = $_GET['cmd']; //pre-populate the form - if (is_array($_GET) && is_uuid($_GET["id"]) && $_POST["persistformvar"] != "true") { + if (!empty($_GET) && is_array($_GET) && is_uuid($_GET["id"]) && (empty($_POST["persistformvar"]) || $_POST["persistformvar"] != "true")) { $call_center_queue_uuid = $_GET["id"]; $sql = "select queue_extension from v_call_center_queues "; $sql .= "where domain_uuid = :domain_uuid "; @@ -89,4 +89,4 @@ $_SESSION["message"] = $response; header("Location: call_center_queues.php?savemsg=".urlencode($response)); -?> +?> \ No newline at end of file diff --git a/app/call_centers/resources/classes/call_center.php b/app/call_centers/resources/classes/call_center.php index c93b77458c..c1f019c1d2 100644 --- a/app/call_centers/resources/classes/call_center.php +++ b/app/call_centers/resources/classes/call_center.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Copyright (C) 2015 - 2021 + Copyright (C) 2015 - 2023 All Rights Reserved. Contributor(s): @@ -294,8 +294,8 @@ //filter out unchecked, build where clause for below foreach ($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { - $uuids[] = "'".$record['uuid']."'"; + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { + $uuids[] = $record['uuid']; } } @@ -303,7 +303,7 @@ if (is_array($uuids) && @sizeof($uuids) != 0) { $sql = "select ".$this->uuid_prefix."uuid as uuid, dialplan_uuid, queue_name, queue_extension from v_".$this->table." "; $sql .= "where domain_uuid = :domain_uuid "; - $sql .= "and ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") "; + $sql .= "and ".$this->uuid_prefix."uuid in ('".implode("','", $uuids)."') "; $parameters['domain_uuid'] = $_SESSION['domain_uuid']; $database = new database; $rows = $database->select($sql, $parameters, 'all'); @@ -343,7 +343,7 @@ //delete the queue in the switch if ($fp) { foreach ($uuids as $uuid) { - $cmd = "api callcenter_config queue unload ".$call_center_queues[$uuid]['queue_extension']."@".$_SESSION["domin_name"]; + $cmd = "api callcenter_config queue unload ".$call_center_queues[$uuid]['queue_extension']."@".$_SESSION["domain_name"]; $response = event_socket_request($fp, $cmd); } } @@ -417,7 +417,7 @@ //filter out unchecked foreach ($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { $uuids[] = $record['uuid']; } } @@ -503,8 +503,8 @@ //get checked records foreach ($records as $x => $record) { - if ($record['checked'] == 'true' && is_uuid($record['uuid'])) { - $uuids[] = "'".$record['uuid']."'"; + if (!empty($record['checked']) && $record['checked'] == 'true' && is_uuid($record['uuid'])) { + $uuids[] = $record['uuid']; } } @@ -513,7 +513,7 @@ //primary table $sql = "select * from v_".$this->table." "; - $sql .= "where ".$this->uuid_prefix."uuid in (".implode(', ', $uuids).") "; + $sql .= "where ".$this->uuid_prefix."uuid in ('".implode("','", $uuids)."') "; $database = new database; $rows = $database->select($sql, $parameters, 'all'); if (is_array($rows) && @sizeof($rows) != 0) { @@ -627,4 +627,4 @@ $c->queue_cc_exit_keys = ""; $c->dialplan(); */ -?> +?> \ No newline at end of file