diff --git a/app/call_centers/call_center_queue_edit.php b/app/call_centers/call_center_queue_edit.php index 090acb2caf..71a064ebc1 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-2018 + Portions created by the Initial Developer are Copyright (C) 2008-2019 the Initial Developer. All Rights Reserved. Contributor(s): @@ -242,14 +242,14 @@ } //build the xml dialplan - $dialplan_xml = "\n"; + $dialplan_xml = "\n"; $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; - $dialplan_xml .= " \n"; + $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; $dialplan_xml .= " \n"; - $dialplan_xml .= " \n"; + $dialplan_xml .= " \n"; if (strlen($queue_cid_prefix) > 0) { $dialplan_xml .= " \n"; } @@ -338,16 +338,22 @@ callcenter_config tier set position [queue_name] [agent_name] [position] */ //add the agent - $cmd = "api callcenter_config tier add ".$call_center_queue_uuid." ".$call_center_agent_uuid." ".$tier_level." ".$tier_position; - $response = event_socket_request($fp, $cmd); + if (is_uuid($call_center_queue_uuid) && is_uuid($call_center_agent_uuid) && is_numeric($tier_level) && is_numeric($tier_position)) { + $cmd = "api callcenter_config tier add ".$call_center_queue_uuid." ".$call_center_agent_uuid." ".$tier_level." ".$tier_position; + $response = event_socket_request($fp, $cmd); + } usleep(200); //agent set level - $cmd = "api callcenter_config tier set level ".$call_center_queue_uuid." ".$call_center_agent_uuid." ".$tier_level; - $response = event_socket_request($fp, $cmd); + if (is_uuid($call_center_queue_uuid) && is_uuid($call_center_agent_uuid) && is_numeric($tier_level)) { + $cmd = "api callcenter_config tier set level ".$call_center_queue_uuid." ".$call_center_agent_uuid." ".$tier_level; + $response = event_socket_request($fp, $cmd); + } usleep(200); //agent set position - $cmd = "api callcenter_config tier set position ".$call_center_queue_uuid." ".$call_center_agent_uuid." ".$tier_position; - $response = event_socket_request($fp, $cmd); + if (is_uuid($call_center_queue_uuid) && is_uuid($call_center_agent_uuid) && is_numeric($tier_position)) { + $cmd = "api callcenter_config tier set position ".$call_center_queue_uuid." ".$call_center_agent_uuid." ".$tier_position; + $response = event_socket_request($fp, $cmd); + } usleep(200); } } @@ -359,7 +365,9 @@ remove_config_from_cache('configuration:callcenter.conf'); //redirect the user - header("Location: call_center_queue_edit.php?id=".escape($call_center_queue_uuid)); + if (is_uuid($call_center_queue_uuid)) { + header("Location: call_center_queue_edit.php?id=".urlencode($call_center_queue_uuid)); + } return; } //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) @@ -450,7 +458,7 @@ $agents = $database->select($sql, $parameters, 'all'); unset($sql, $parameters); - //get the sounds +//get the sounds $sounds = new sounds; $sounds = $sounds->get(); @@ -477,6 +485,11 @@ $document['title'] = $text['title-call_center_queue_edit']; } +//only allow a uuid + if (!is_uuid($call_center_queue_uuid)) { + $call_center_queue_uuid = null; + } + //show the content echo "
\n"; echo "\n"; @@ -492,12 +505,12 @@ if ($action == "update") { echo "    "; if (permission_exists('call_center_wallboard')) { - echo " \n"; + echo " \n"; } - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; echo "    "; } echo " \n"; @@ -641,60 +654,62 @@ echo " \n"; echo " \n"; $x = 0; - foreach($tiers as $field) { - echo " \n"; - echo " \n"; + echo " \n"; - echo " \n"; + echo " "; + echo " \n"; + echo " \n"; - echo " \n"; + echo " \n"; + echo " \n"; + $assigned_agents[] = $field['agent_name']; + $x++; } - echo " \n"; - echo " \n"; - echo " \n"; - echo " \n"; - $assigned_agents[] = $field['agent_name']; - $x++; + unset ($tiers); + echo "
"; - if (strlen($field['call_center_tier_uuid']) > 0) { - echo " \n"; - } - echo "
"; + if (strlen($field['call_center_tier_uuid']) > 0) { + echo " \n"; } - echo " \n"; - } - echo " "; - echo " "; - echo " \n"; - echo " "; + echo " \n"; + echo " \n"; - echo " \n"; + echo " \n"; + echo " "; + if (permission_exists('call_center_tier_delete')) { + echo " $v_link_label_delete"; + } + echo "
"; - if (permission_exists('call_center_tier_delete')) { - echo " $v_link_label_delete"; - } - echo "
\n"; + echo "
\n"; + echo " ".$text['description-tiers']."\n"; + echo "
\n"; + echo " "; + echo ""; } - unset ($tiers); - echo " \n"; - echo "
\n"; - echo " ".$text['description-tiers']."\n"; - echo "
\n"; - echo " "; - echo ""; } echo "\n";