diff --git a/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt b/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt index 1de81dd0..bc4380a9 100644 --- a/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt +++ b/agc_2-X/branches/agc_2.0.4/extras/phone_codes_GMT.txt @@ -218,7 +218,7 @@ code country areacode state GMT DST DST_RANGE GEOGRAPHIC DESCRIPTION TZ_CODE PHP 1 USA 573 MO -6 Y SSM-FSN Missouri CST America/Chicago 1 USA 574 IN -5 Y SSM-FSN Indiana EST America/New_York 1 USA 575 NM -7 Y SSM-FSN New Mexico MST America/Denver -1 CAN 579 QU -5 Y SSM-FSN Quebec EST America/Toronto +1 CAN 579 QC -5 Y SSM-FSN Quebec EST America/Toronto 1 USA 580 OK -6 Y SSM-FSN Oklahoma CST America/Chicago 1 CAN 581 QC -5 Y SSM-FSN Quebec EST America/Toronto 1 USA 582 PA -5 Y SSM-FSN Pennsylvania EST America/New_York diff --git a/agc_2-X/trunk/UPGRADE b/agc_2-X/trunk/UPGRADE index 8ce7d55a..42cf16cf 100644 --- a/agc_2-X/trunk/UPGRADE +++ b/agc_2-X/trunk/UPGRADE @@ -896,6 +896,9 @@ OTHER CHANGES: 255. Added ADAPT_PERCENTMAX Dial Method campaign option. +256. Added In-Group "Transfer Talk Minimum" features, allowing for restruction + on agent screen transfers before talk time threshold. + diff --git a/agc_2-X/trunk/experimental/VCA/VCA_db_schema.sql b/agc_2-X/trunk/experimental/VCA/VCA_db_schema.sql index 129f1c74..c1dd4a7b 100644 --- a/agc_2-X/trunk/experimental/VCA/VCA_db_schema.sql +++ b/agc_2-X/trunk/experimental/VCA/VCA_db_schema.sql @@ -43,3 +43,8 @@ CREATE TABLE `vicidial_vca_log` ( CREATE TABLE vicidial_vca_log_archive LIKE vicidial_vca_log; ALTER TABLE vicidial_vca_log_archive MODIFY vca_log_id INT(9) UNSIGNED NOT NULL; + +ALTER TABLE vicidial_vca_log ADD sig_id VARCHAR(36) DEFAULT '', ADD +sig_min_dist FLOAT DEFAULT 0, ADD sig_match_ms FLOAT DEFAULT 0; +ALTER TABLE vicidial_vca_log_archive ADD sig_id VARCHAR(36) DEFAULT '', +ADD sig_min_dist FLOAT DEFAULT 0, ADD sig_match_ms FLOAT DEFAULT 0; diff --git a/agc_2-X/trunk/www/agc/DQ_dispo.php b/agc_2-X/trunk/www/agc/DQ_dispo.php index de329ebc..b7be200d 100644 --- a/agc_2-X/trunk/www/agc/DQ_dispo.php +++ b/agc_2-X/trunk/www/agc/DQ_dispo.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed to be used in the "Dispo Call URL" field of a campaign # It should take in the 'lead_id' and 'dispo' to check for the campaign's @@ -28,6 +28,7 @@ # # CHANGES # 230511-1100 - First Build +# 260302-1211 - Code updates for PHP8 compatibility # $api_script = 'DQdispo'; @@ -41,24 +42,29 @@ $filetime = date("H:i:s"); $IP = getenv ("REMOTE_ADDR"); $BR = getenv ("HTTP_USER_AGENT"); -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_AUTH_USER=(array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : ""); +$PHP_AUTH_PW=(array_key_exists('PHP_AUTH_PW', $_SERVER) ? $_SERVER['PHP_AUTH_PW'] : ""); if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id="";} if (isset($_GET["campaign_id"])) {$campaign_id=$_GET["campaign_id"];} elseif (isset($_POST["campaign_id"])) {$campaign_id=$_POST["campaign_id"];} + else {$campaign_id="";} if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} + else {$dispo="";} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} + else {$DB="";} if (isset($_GET["log_to_file"])) {$log_to_file=$_GET["log_to_file"];} elseif (isset($_POST["log_to_file"])) {$log_to_file=$_POST["log_to_file"];} - -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); + else {$log_to_file="";} #$DB = '1'; # DEBUG override $US = '_'; @@ -99,6 +105,7 @@ if ($qm_conf_ct > 0) $SSdemographic_quotas = $row[4]; } if ($SSallow_web_debug < 1) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); if ($SSdemographic_quotas < 1) { diff --git a/agc_2-X/trunk/www/agc/abandon_check_queue.php b/agc_2-X/trunk/www/agc/abandon_check_queue.php index 17e99577..cbd5e83e 100644 --- a/agc_2-X/trunk/www/agc/abandon_check_queue.php +++ b/agc_2-X/trunk/www/agc/abandon_check_queue.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed to be used as a "No Agent Call URL" option for an # In-Group. It will take the lead_id and check to see if it is already in the @@ -27,6 +27,7 @@ # # CHANGES # 230308-0844 - First Build +# 260302-1404 - Code updates for PHP8 compatibility # $api_script = 'abandonchk'; @@ -40,24 +41,33 @@ $filetime = date("H:i:s"); $IP = getenv ("REMOTE_ADDR"); $BR = getenv ("HTTP_USER_AGENT"); -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_AUTH_USER=(array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : ""); +$PHP_AUTH_PW=(array_key_exists('PHP_AUTH_PW', $_SERVER) ? $_SERVER['PHP_AUTH_PW'] : ""); + if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id="";} if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} + else {$dispo="";} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} + else {$DB="";} if (isset($_GET["log_to_file"])) {$log_to_file=$_GET["log_to_file"];} elseif (isset($_POST["log_to_file"])) {$log_to_file=$_POST["log_to_file"];} + else {$log_to_file="";} if (isset($_GET["source"])) {$source=$_GET["source"];} elseif (isset($_POST["source"])) {$source=$_POST["source"];} - -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); + else {$source="";} +if (isset($_GET["sale_status"])) {$sale_status=$_GET["sale_status"];} + elseif (isset($_POST["sale_status"])) {$sale_status=$_POST["sale_status"];} + else {$sale_status="";} #$DB = '1'; # DEBUG override $US = '_'; @@ -100,7 +110,8 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[2]; $SSallow_web_debug = $row[3]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; diff --git a/agc_2-X/trunk/www/agc/active_list_refresh.php b/agc_2-X/trunk/www/agc/active_list_refresh.php index 7af95d9c..0fb8d749 100644 --- a/agc_2-X/trunk/www/agc/active_list_refresh.php +++ b/agc_2-X/trunk/www/agc/active_list_refresh.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to serve updates of the live data to the display scripts # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -51,10 +51,11 @@ # 210825-0908 - Fix for XSS security issue # 220220-0922 - Added allow_web_debug system setting # 250717-1030 - Fix for debug issue +# 260303-0719 - Code updates for PHP8 compatibility # -$version = '0.0.22'; -$build = '250717-1030'; +$version = '0.0.23'; +$build = '260303-0719'; $php_script = 'active_list_refresh.php'; $SSagent_debug_logging=0; $startMS = microtime(); @@ -65,18 +66,20 @@ require_once("functions.php"); ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} + else {$server_ip="";} if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} + else {$session_name="";} if (isset($_GET["format"])) {$format=$_GET["format"];} elseif (isset($_POST["format"])) {$format=$_POST["format"];} if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["order"])) {$order=$_GET["order"];} elseif (isset($_POST["order"])) {$order=$_POST["order"];} if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} @@ -91,22 +94,26 @@ if (isset($_GET["selectfontsize"])) {$selectfontsize=$_GET["selectfontsize"]; elseif (isset($_POST["selectfontsize"])) {$selectfontsize=$_POST["selectfontsize"];} if (isset($_GET["selectedext"])) {$selectedext=$_GET["selectedext"];} elseif (isset($_POST["selectedext"])) {$selectedext=$_POST["selectedext"];} + else {$selectedext="";} if (isset($_GET["selectedtrunk"])) {$selectedtrunk=$_GET["selectedtrunk"];} elseif (isset($_POST["selectedtrunk"])) {$selectedtrunk=$_POST["selectedtrunk"];} + else {$selectedtrunk="";} if (isset($_GET["selectedlocal"])) {$selectedlocal=$_GET["selectedlocal"];} elseif (isset($_POST["selectedlocal"])) {$selectedlocal=$_POST["selectedlocal"];} + else {$selectedlocal="";} if (isset($_GET["textareaheight"])) {$textareaheight=$_GET["textareaheight"];} elseif (isset($_POST["textareaheight"])) {$textareaheight=$_POST["textareaheight"];} if (isset($_GET["textareawidth"])) {$textareawidth=$_GET["textareawidth"];} elseif (isset($_POST["textareawidth"])) {$textareawidth=$_POST["textareawidth"];} if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} + else {$field_name="";} ### security strip all non-alphanumeric characters out of the variables ### $user=preg_replace("/\'|\"|\\\\|;| /","",$user); $pass=preg_replace("/\'|\"|\\\\|;| /","",$pass); - # default optional vars if not set +if (!isset($mel)) {$mel=0;} if (!isset($ADD)) {$ADD="1";} if (!isset($order)) {$order='desc';} if (!isset($format)) {$format="text";} @@ -146,7 +153,8 @@ if ($qm_conf_ct > 0) $SSagent_debug_logging = $row[3]; $SSallow_web_debug = $row[4]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0; $format="text";} +if (!isset($DB)) {$DB = 0;} $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -319,6 +327,7 @@ if ($ADD==1) ###################### if ($ADD==2) { + if (!isset($pt)) {$pt='pt';} if (!$field_name) {$field_name = 'busyext';} if ($format=='table') {echo "\n";} if ($format=='menu') {echo "
\n";} if ($format=='menu') {echo "
\n";} if ($format=='menu') {echo "
"; echo "\n"; -echo ""; -echo ""; +echo ""; +echo ""; echo ""; echo ""; @@ -765,6 +773,7 @@ echo "\n"; echo "
"._QXZ("Chatting with").":
".$chat_managers_array[$priority_chat]."
"._QXZ("Chat started").":
".$chat_start_date_array[$priority_chat]."
"._QXZ("Chatting with").":
".(isset($chat_managers_array[$priority_chat]) ? $chat_managers_array[$priority_chat] : "")."
"._QXZ("Chat started").":
".(isset($chat_start_date_array[$priority_chat]) ? $chat_start_date_array[$priority_chat] : "")."
"._QXZ("Your active chats").":
\n"; echo "
\n"; echo "
    "; + $sid=0; if (empty($chat_managers_array)) { echo "\t
  • "._QXZ("NO OPEN CHATS")."
  • \n"; } else { diff --git a/agc_2-X/trunk/www/agc/alt_display.php b/agc_2-X/trunk/www/agc/alt_display.php index facbbec5..98629c8d 100644 --- a/agc_2-X/trunk/www/agc/alt_display.php +++ b/agc_2-X/trunk/www/agc/alt_display.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed to display agent screen information outside of the agent screen # To use this script, you must set the options.php setting $alt_display_enabled = '1'; @@ -26,10 +26,11 @@ # 231214-0912 - Added notification_data action # 240320-1047 - Added input filtering for error output # 240805-0121 - Updates to notification_data function +# 260303-0729 - Code updates for PHP8 compatibility # -$version = '2.14-10'; -$build = '240805-0121'; +$version = '2.14-11'; +$build = '260303-0729'; $php_script = 'alt_display.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=11; @@ -47,27 +48,44 @@ require_once("functions.php"); ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} +if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} if (isset($_GET["calls_in_queue_option"])) {$calls_in_queue_option=$_GET["calls_in_queue_option"];} elseif (isset($_POST["calls_in_queue_option"])) {$calls_in_queue_option=$_POST["calls_in_queue_option"];} + else {$calls_in_queue_option="";} if (isset($_GET["calls_in_queue_display"])) {$calls_in_queue_display=$_GET["calls_in_queue_display"];} elseif (isset($_POST["calls_in_queue_display"])) {$calls_in_queue_display=$_POST["calls_in_queue_display"];} + else {$calls_in_queue_display="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} + else {$server_ip="";} +if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} + elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} + else {$session_name="";} + # default optional vars if not set if (!isset($stage)) {$stage="default";} if (!isset($ACTION)) {$ACTION="top_panel";} +# for vicidial_ajax_log +if (!isset($lead_id)) {$lead_id=0;} $user = preg_replace("/\'|\"|\\\\|;/","",$user); -$stage = preg_replace("/[^-_0-9a-zA-Z]/","",$stage); -$ACTION = preg_replace('/[^-_0-9a-zA-Z]/','',$ACTION); -$calls_in_queue_option = preg_replace('/[^-_0-9a-zA-Z]/','',$calls_in_queue_option); -$calls_in_queue_display = preg_replace('/[^-_0-9a-zA-Z]/','',$calls_in_queue_display); -$DB = preg_replace('/[^-_0-9a-zA-Z]/','',$DB); +# Commented out vars moved further down +# $stage = preg_replace("/[^-_0-9a-zA-Z]/","",$stage); +# $ACTION = preg_replace('/[^-_0-9a-zA-Z]/','',$ACTION); +$lead_id = preg_replace('/[^0-9]/', '', $lead_id); +# $calls_in_queue_option = preg_replace('/[^-_0-9a-zA-Z]/','',$calls_in_queue_option); +# $calls_in_queue_display = preg_replace('/[^-_0-9a-zA-Z]/','',$calls_in_queue_display); +$session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); +$server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); $PHP_SELF=$_SERVER['PHP_SELF']; $PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF); @@ -83,7 +101,7 @@ if (file_exists('options.php')) header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0 - +$alt_display_enabled=1; $user="6666"; if ($alt_display_enabled < 1) { $user = preg_replace('/[^-_0-9\p{L}]/u','',$user); @@ -183,19 +201,29 @@ if ($qm_conf_ct > 0) $SScall_quota_lead_ranking = $row[20]; $SSallow_web_debug = $row[21]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} ##### END SETTINGS LOOKUP ##### ########################################### if ($non_latin < 1) { $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user); - $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); + # $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); + $DB = preg_replace('/[^-_0-9a-zA-Z]/','',$DB); + $stage = preg_replace("/[^-_0-9a-zA-Z]/","",$stage); + $ACTION = preg_replace('/[^-_0-9a-zA-Z]/','',$ACTION); + $calls_in_queue_option = preg_replace('/[^-_0-9a-zA-Z]/','',$calls_in_queue_option); + $calls_in_queue_display = preg_replace('/[^-_0-9a-zA-Z]/','',$calls_in_queue_display); } else { $user = preg_replace('/[^-_0-9\p{L}]/u','',$user); - $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); + # $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); + $DB = preg_replace('/[^-_0-9\p{L}]/u','',$DB); + $stage = preg_replace("/[^-_0-9\p{L}]/u","",$stage); + $ACTION = preg_replace('/[^-_0-9\p{L}]/u','',$ACTION); + $calls_in_queue_option = preg_replace('/[^-_0-9\p{L}]/u','',$calls_in_queue_option); + $calls_in_queue_display = preg_replace('/[^-_0-9\p{L}]/u','',$calls_in_queue_display); } if (strlen($SSagent_debug_logging) > 1) diff --git a/agc_2-X/trunk/www/agc/api.php b/agc_2-X/trunk/www/agc/api.php index 65495b6d..f968d923 100644 --- a/agc_2-X/trunk/www/agc/api.php +++ b/agc_2-X/trunk/www/agc/api.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed as an API(Application Programming Interface) to allow # other programs to interact with the VICIDIAL Agent screen @@ -118,10 +118,11 @@ # 240429-2220 - Added PARK_XFER|GRAB_XFER options for park_call function # 250122-1010 - Allow for letters in phone_number variable, for AGENTDIRECT transfers # 250830-2102 - Added stereo_recording function +# 260302-1142 - Code updates for PHP8 compatibility # -$version = '2.14-83'; -$build = '250830-2102'; +$version = '2.14-84'; +$build = '260302-1142'; $php_script = 'api.php'; $startMS = microtime(); @@ -147,162 +148,241 @@ if ( (strlen($query_string) > 0) and (strlen($POST_URI) > 2) ) ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["agent_user"])) {$agent_user=$_GET["agent_user"];} elseif (isset($_POST["agent_user"])) {$agent_user=$_POST["agent_user"];} + else {$agent_user="";} if (isset($_GET["function"])) {$function=$_GET["function"];} elseif (isset($_POST["function"])) {$function=$_POST["function"];} + else {$function="";} if (isset($_GET["value"])) {$value=$_GET["value"];} elseif (isset($_POST["value"])) {$value=$_POST["value"];} + else {$value="";} if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} + else {$vendor_id="";} if (isset($_GET["focus"])) {$focus=$_GET["focus"];} elseif (isset($_POST["focus"])) {$focus=$_POST["focus"];} + else {$focus="";} if (isset($_GET["preview"])) {$preview=$_GET["preview"];} elseif (isset($_POST["preview"])) {$preview=$_POST["preview"];} + else {$preview="";} if (isset($_GET["notes"])) {$notes=$_GET["notes"];} elseif (isset($_POST["notes"])) {$notes=$_POST["notes"];} + else {$notes="";} if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} + else {$phone_code="";} if (isset($_GET["search"])) {$search=$_GET["search"];} elseif (isset($_POST["search"])) {$search=$_POST["search"];} + else {$search="";} if (isset($_GET["group_alias"])) {$group_alias=$_GET["group_alias"];} elseif (isset($_POST["group_alias"])) {$group_alias=$_POST["group_alias"];} + else {$group_alias="";} if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} + else {$dial_prefix="";} if (isset($_GET["source"])) {$source=$_GET["source"];} elseif (isset($_POST["source"])) {$source=$_POST["source"];} + else {$source="";} if (isset($_GET["format"])) {$format=$_GET["format"];} elseif (isset($_POST["format"])) {$format=$_POST["format"];} + else {$format="";} if (isset($_GET["vtiger_callback"])) {$vtiger_callback=$_GET["vtiger_callback"];} elseif (isset($_POST["vtiger_callback"])) {$vtiger_callback=$_POST["vtiger_callback"];} + else {$vtiger_callback="";} if (isset($_GET["blended"])) {$blended=$_GET["blended"];} elseif (isset($_POST["blended"])) {$blended=$_POST["blended"];} + else {$blended="";} if (isset($_GET["ingroup_choices"])) {$ingroup_choices=$_GET["ingroup_choices"];} elseif (isset($_POST["ingroup_choices"])) {$ingroup_choices=$_POST["ingroup_choices"];} + else {$ingroup_choices="";} if (isset($_GET["set_as_default"])) {$set_as_default=$_GET["set_as_default"];} elseif (isset($_POST["set_as_default"])) {$set_as_default=$_POST["set_as_default"];} + else {$set_as_default="";} if (isset($_GET["alt_user"])) {$alt_user=$_GET["alt_user"];} elseif (isset($_POST["alt_user"])) {$alt_user=$_POST["alt_user"];} + else {$alt_user="";} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id="";} if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + else {$phone_number="";} if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];} elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];} + else {$vendor_lead_code="";} if (isset($_GET["source_id"])) {$source_id=$_GET["source_id"];} elseif (isset($_POST["source_id"])) {$source_id=$_POST["source_id"];} + else {$source_id="";} if (isset($_GET["gmt_offset_now"])) {$gmt_offset_now=$_GET["gmt_offset_now"];} elseif (isset($_POST["gmt_offset_now"])) {$gmt_offset_now=$_POST["gmt_offset_now"];} + else {$gmt_offset_now="";} if (isset($_GET["title"])) {$title=$_GET["title"];} elseif (isset($_POST["title"])) {$title=$_POST["title"];} + else {$title="";} if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} + else {$first_name="";} if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} + else {$middle_initial="";} if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} + else {$last_name="";} if (isset($_GET["address1"])) {$address1=$_GET["address1"];} elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} + else {$address1="";} if (isset($_GET["address2"])) {$address2=$_GET["address2"];} elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} + else {$address2="";} if (isset($_GET["address3"])) {$address3=$_GET["address3"];} elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} + else {$address3="";} if (isset($_GET["city"])) {$city=$_GET["city"];} elseif (isset($_POST["city"])) {$city=$_POST["city"];} + else {$city="";} if (isset($_GET["state"])) {$state=$_GET["state"];} elseif (isset($_POST["state"])) {$state=$_POST["state"];} + else {$state="";} if (isset($_GET["province"])) {$province=$_GET["province"];} elseif (isset($_POST["province"])) {$province=$_POST["province"];} + else {$province="";} if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} + else {$postal_code="";} if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} + else {$country_code="";} if (isset($_GET["gender"])) {$gender=$_GET["gender"];} elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];} + else {$gender="";} if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} + else {$date_of_birth="";} if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} + else {$alt_phone="";} if (isset($_GET["email"])) {$email=$_GET["email"];} elseif (isset($_POST["email"])) {$email=$_POST["email"];} + else {$email="";} if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} + else {$security_phrase="";} if (isset($_GET["comments"])) {$comments=$_GET["comments"];} elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} + else {$comments="";} if (isset($_GET["rank"])) {$rank=$_GET["rank"];} elseif (isset($_POST["rank"])) {$rank=$_POST["rank"];} + else {$rank="";} if (isset($_GET["owner"])) {$owner=$_GET["owner"];} elseif (isset($_POST["owner"])) {$owner=$_POST["owner"];} + else {$owner="";} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} + else {$stage="";} if (isset($_GET["status"])) {$status=$_GET["status"];} elseif (isset($_POST["status"])) {$status=$_POST["status"];} + else {$status="";} if (isset($_GET["close_window_link"])) {$close_window_link=$_GET["close_window_link"];} elseif (isset($_POST["close_window_link"])) {$close_window_link=$_POST["close_window_link"];} + else {$close_window_link="";} if (isset($_GET["dnc_check"])) {$dnc_check=$_GET["dnc_check"];} elseif (isset($_POST["dnc_check"])) {$dnc_check=$_POST["dnc_check"];} + else {$dnc_check="";} if (isset($_GET["campaign_dnc_check"])) {$campaign_dnc_check=$_GET["campaign_dnc_check"];} elseif (isset($_POST["campaign_dnc_check"])) {$campaign_dnc_check=$_POST["campaign_dnc_check"];} + else {$campaign_dnc_check="";} if (isset($_GET["dial_override"])) {$dial_override=$_GET["dial_override"];} elseif (isset($_POST["dial_override"])) {$dial_override=$_POST["dial_override"];} + else {$dial_override="";} if (isset($_GET["consultative"])) {$consultative=$_GET["consultative"];} elseif (isset($_POST["consultative"])) {$consultative=$_POST["consultative"];} + else {$consultative="";} if (isset($_GET["alt_dial"])) {$alt_dial=$_GET["alt_dial"];} elseif (isset($_POST["alt_dial"])) {$alt_dial=$_POST["alt_dial"];} + else {$alt_dial="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["callback_datetime"])) {$callback_datetime=$_GET["callback_datetime"];} elseif (isset($_POST["callback_datetime"])) {$callback_datetime=$_POST["callback_datetime"];} + else {$callback_datetime="";} if (isset($_GET["callback_type"])) {$callback_type=$_GET["callback_type"];} elseif (isset($_POST["callback_type"])) {$callback_type=$_POST["callback_type"];} + else {$callback_type="";} if (isset($_GET["callback_comments"])) {$callback_comments=$_GET["callback_comments"];} elseif (isset($_POST["callback_comments"])) {$callback_comments=$_POST["callback_comments"];} + else {$callback_comments="";} if (isset($_GET["qm_dispo_code"])) {$qm_dispo_code=$_GET["qm_dispo_code"];} elseif (isset($_POST["qm_dispo_code"])) {$qm_dispo_code=$_POST["qm_dispo_code"];} + else {$qm_dispo_code="";} if (isset($_GET["agent_debug"])) {$agent_debug=$_GET["agent_debug"];} elseif (isset($_POST["agent_debug"])) {$agent_debug=$_POST["agent_debug"];} + else {$agent_debug="";} if (isset($_GET["dial_ingroup"])) {$dial_ingroup=$_GET["dial_ingroup"];} elseif (isset($_POST["dial_ingroup"])) {$dial_ingroup=$_POST["dial_ingroup"];} + else {$dial_ingroup="";} if (isset($_GET["cid_choice"])) {$cid_choice=$_GET["cid_choice"];} elseif (isset($_POST["cid_choice"])) {$cid_choice=$_POST["cid_choice"];} + else {$cid_choice="";} if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} + else {$outbound_cid="";} if (isset($_GET["duration"])) {$duration=$_GET["duration"];} elseif (isset($_POST["duration"])) {$duration=$_POST["duration"];} + else {$duration="";} if (isset($_GET["recipient"])) {$recipient=$_GET["recipient"];} elseif (isset($_POST["recipient"])) {$recipient=$_POST["recipient"];} + else {$recipient="";} if (isset($_GET["recipient_type"])) {$recipient_type=$_GET["recipient_type"];} elseif (isset($_POST["recipient_type"])) {$recipient_type=$_POST["recipient_type"];} + else {$recipient_type="";} if (isset($_GET["show_confetti"])) {$show_confetti=$_GET["show_confetti"];} elseif (isset($_POST["show_confetti"])) {$show_confetti=$_POST["show_confetti"];} + else {$show_confetti="";} if (isset($_GET["maxParticleCount"])) {$maxParticleCount=$_GET["maxParticleCount"];} elseif (isset($_POST["maxParticleCount"])) {$maxParticleCount=$_POST["maxParticleCount"];} + else {$maxParticleCount="";} if (isset($_GET["particleSpeed"])) {$particleSpeed=$_GET["particleSpeed"];} elseif (isset($_POST["particleSpeed"])) {$particleSpeed=$_POST["particleSpeed"];} + else {$particleSpeed="";} if (isset($_GET["notification_date"])) {$notification_date=$_GET["notification_date"];} elseif (isset($_POST["notification_date"])) {$notification_date=$_POST["notification_date"];} + else {$notification_date="";} if (isset($_GET["notification_text"])) {$notification_text=$_GET["notification_text"];} elseif (isset($_POST["notification_text"])) {$notification_text=$_POST["notification_text"];} + else {$notification_text="";} if (isset($_GET["notification_retry"])) {$notification_retry=$_GET["notification_retry"];} elseif (isset($_POST["notification_retry"])) {$notification_retry=$_POST["notification_retry"];} + else {$notification_retry="";} if (isset($_GET["text_size"])) {$text_size=$_GET["text_size"];} elseif (isset($_POST["text_size"])) {$text_size=$_POST["text_size"];} + else {$text_size="";} if (isset($_GET["text_font"])) {$text_font=$_GET["text_font"];} elseif (isset($_POST["text_font"])) {$text_font=$_POST["text_font"];} + else {$text_font="";} if (isset($_GET["text_weight"])) {$text_weight=$_GET["text_weight"];} elseif (isset($_POST["text_weight"])) {$text_weight=$_POST["text_weight"];} + else {$text_weight="";} if (isset($_GET["text_color"])) {$text_color=$_GET["text_color"];} elseif (isset($_POST["text_color"])) {$text_color=$_POST["text_color"];} + else {$text_color="";} if (isset($_GET["multi_dial_phones"])) {$multi_dial_phones=$_GET["multi_dial_phones"];} elseif (isset($_POST["multi_dial_phones"])) {$multi_dial_phones=$_POST["multi_dial_phones"];} + else {$multi_dial_phones="";} if (isset($_GET["md_check"])) {$md_check=$_GET["md_check"];} elseif (isset($_POST["md_check"])) {$md_check=$_POST["md_check"];} + else {$md_check="";} if (isset($_GET["tw_check"])) {$tw_check=$_GET["tw_check"];} elseif (isset($_POST["tw_check"])) {$tw_check=$_POST["tw_check"];} + else {$tw_check="";} -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); +if (!isset($ACTION)) {$ACTION="";} +if (!isset($result_reason)) {$result_reason="";} +if (!isset($data)) {$data="";} # if options file exists, use the override values for the above variables # see the options-example.php file for more information @@ -337,7 +417,8 @@ if ($qm_conf_ct > 0) $SSagent_notifications = $row[6]; $SSstereo_recording = $row[7]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language,api_list_restrict,api_allowed_functions,user_group from vicidial_users where user='$user';"; @@ -353,6 +434,13 @@ if ($sl_ct > 0) $VUapi_allowed_functions = $row[2]; $VUuser_group = $row[3]; } +else + { + $VUapi_list_restrict=""; + $VUapi_allowed_functions=""; + $VUuser_group=""; + } + ##### END SETTINGS LOOKUP ##### ########################################### @@ -574,6 +662,7 @@ if ($function == 'version') { $data = _QXZ("VERSION:")." $version|"._QXZ("BUILD:")." $build|"._QXZ("DATE:")." $NOW_TIME|"._QXZ("EPOCH:")." $StarTtime"; $result = _QXZ("SUCCESS"); + $result_reason = ""; echo "$data\n"; api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); exit; @@ -609,7 +698,6 @@ if ( ($function == 'coffee') or ($function == 'start_coffee') or ($function == ' ################################################################################ ### BEGIN - user validation section (most functions run through this first) ################################################################################ - if ($ACTION == 'LogiNCamPaigns') { $skip_user_validation=1; @@ -753,11 +841,11 @@ if ($function == 'webserver') $data .= "set.timezone: " . date('e') . "\n"; $data .= "abbr.timezone: " . date('T') . "\n"; $data .= "dst.timezone: " . date('I') . "\n"; - $data .= "uname: " . php_uname('e') . "\n"; + $data .= "uname: " . php_uname('a') . "\n"; $data .= _QXZ("host name: ") . php_uname('n') . "\n"; - $data .= _QXZ("server name: ") . $_SERVER['SERVER_NAME'] . "\n"; + $data .= _QXZ("server name: ") . (array_key_exists('SERVER_NAME', $_SERVER) ? $_SERVER['SERVER_NAME'] : "") . "\n"; $data .= _QXZ("php version: ") . phpversion() . "\n"; - $data .= _QXZ("apache version: ") . apache_get_version() . "\n"; + # $data .= _QXZ("apache version: ") . apache_get_version() . "\n"; $data .= _QXZ("apache processes: ") . $processes . "\n"; $data .= _QXZ("system load average: ") . $load[0] . "\n"; $data .= _QXZ("disk free space: ") . disk_free_space('/') . "\n"; @@ -2949,7 +3037,7 @@ if ($function == 'update_fields') if ($lead_id > 0) { $fieldsSQL=''; - $fieldsLISTS=''; + $fieldsLIST=''; $field_set=0; $agent_update=0; if (preg_match('/phone_code/',$query_string)) @@ -3278,7 +3366,8 @@ if ($function == 'refresh_panel') $row=mysqli_fetch_row($rslt); if ($row[0] > 0) { - $fieldsLISTS=''; + $fieldsLIST=''; + $field_set=0; $agent_update=0; if (preg_match('/formreload/i',$query_string)) @@ -5483,7 +5572,7 @@ if ($function == 'send_notification') api_log($link,$api_logging,$api_script,$user,$recipient,$function,$recipient_type,$result,$result_reason,$source,$data); exit; } - if ($DBX) {echo "$rt_stmt";} + if ($DB) {echo "$rt_stmt";} } if ($recipient && $recipient_type) @@ -5596,7 +5685,7 @@ if ($function == 'send_notification') if (!$duration || !$maxParticleCount || !$particleSpeed) { $confetti_stmt="select * from vicidial_settings_containers where container_id='CONFETTI_SETTINGS'"; - if ($DBX) {echo $confetti_stmt."
    \n";} + if ($DB) {echo $confetti_stmt."
    \n";} $confetti_rslt=mysql_to_mysqli($confetti_stmt, $link); if (mysqli_num_rows($confetti_rslt)>0) @@ -5702,6 +5791,7 @@ exit; ##### Logging ##### function api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data) { + global $DB; if ($api_logging > 0) { global $startMS, $query_string, $ip; @@ -5725,7 +5815,7 @@ function api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$val $TOTALrun = ($runS + $runM); $VULhostname = php_uname('n'); - $VULservername = $_SERVER['SERVER_NAME']; + $VULservername = (array_key_exists('SERVER_NAME', $_SERVER) ? $_SERVER['SERVER_NAME'] : ""); if (strlen($VULhostname)<1) {$VULhostname='X';} if (strlen($VULservername)<1) {$VULservername='X';} diff --git a/agc_2-X/trunk/www/agc/astguiclient.php b/agc_2-X/trunk/www/agc/astguiclient.php index b7bce6c8..5bd8b39c 100644 --- a/agc_2-X/trunk/www/agc/astguiclient.php +++ b/agc_2-X/trunk/www/agc/astguiclient.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # make sure you have added a user to the vicidial_users MySQL table with at least # user_level 1 or greater to access this page. Also you need to have the login @@ -74,10 +74,11 @@ # 210616-2053 - Added optional CORS support, see options.php for details # 220220-0938 - Added allow_web_debug system setting # 230418-1009 - Added astguiclient_disabled options.php setting, disabled by default +# 260302-1403 - Code updates for PHP8 compatibility # -$version = '2.2.6-7'; -$build = '230418-1009'; +$version = '2.2.6-8'; +$build = '260302-1403'; $php_script = 'astguiclient.php'; $astguiclient_disabled = '1'; @@ -87,24 +88,35 @@ require_once("functions.php"); ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} + else {$phone_login="";} if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} + else {$phone_pass="";} if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} - if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } - if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } + else {$relogin="";} +if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} + elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} + else {$force_logout="";} +if (isset($_GET["ADD"])) {$ADD=$_GET["ADD"];} + elseif (isset($_POST["ADD"])) {$ADD=$_POST["ADD"];} + else {$ADD="";} +if (!isset($phone_login)) + { + if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} + elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + } +if (!isset($phone_pass)) + { + if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} + elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + } $forever_stop=0; $user_abb = "$user$user$user$user"; @@ -112,12 +124,13 @@ while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) {$user_abb = preg_replace("/^./","",$user_abb); $forever_stop++;} ### security strip all non-alphanumeric characters out of the variables ### -$DB=preg_replace("/[^0-9a-z]/","",$DB); -$phone_login=preg_replace("/[^-_0-9a-zA-Z]/","",$phone_login); -$phone_pass=preg_replace("/[^-_0-9a-zA-Z]/","",$phone_pass); +# Moved down for non_latin scrub +# $phone_login=preg_replace("/[^-_0-9a-zA-Z]/","",$phone_login); +# $phone_pass=preg_replace("/[^-_0-9a-zA-Z]/","",$phone_pass); $user=preg_replace("/\'|\"|\\\\|;| /","",$user); $pass=preg_replace("/\'|\"|\\\\|;| /","",$pass); -$relogin=preg_replace("/[^-_0-9a-zA-Z]/","",$relogin); +# $relogin=preg_replace("/[^-_0-9a-zA-Z]/","",$relogin); +$ADD=preg_replace("/[^0-9]/","",$ADD); # if options file exists, use the override values for the above variables # see the options-example.php file for more information @@ -148,7 +161,9 @@ if ($qm_conf_ct > 0) $SSdefault_language = $row[3]; $SSallow_web_debug = $row[4]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); + $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -171,11 +186,17 @@ if ($non_latin < 1) { $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user); $pass=preg_replace("/[^-_0-9a-zA-Z]/","",$pass); + $phone_login=preg_replace("/[^-_0-9a-zA-Z]/","",$phone_login); + $phone_pass=preg_replace("/[^-_0-9a-zA-Z]/","",$phone_pass); + $relogin=preg_replace("/[^-_0-9a-zA-Z]/","",$relogin); } else { $user = preg_replace('/[^-_0-9\p{L}]/u','',$user); $pass = preg_replace('/[^-_0-9\p{L}]/u','',$pass); + $phone_login=preg_replace("/[^-_0-9\p{L}]/u","",$phone_login); + $phone_pass=preg_replace("/[^-_0-9\p{L}]/u","",$phone_pass); + $relogin=preg_replace("/[^-_0-9\p{L}]/u","",$relogin); } if ($force_logout) @@ -440,6 +461,9 @@ else $rslt=mysql_to_mysqli($stmt, $link); $row=mysqli_fetch_row($rslt); $favorites_present=$row[0]; + $favorites_count=0; + $favorites_list=''; + $favorites_listX=''; if ($favorites_present > 0) { $stmt="SELECT extensions_list from phone_favorites where extension='$extension' and server_ip = '$server_ip';"; diff --git a/agc_2-X/trunk/www/agc/call_log_display.php b/agc_2-X/trunk/www/agc/call_log_display.php index a2b8008f..ee72e629 100644 --- a/agc_2-X/trunk/www/agc/call_log_display.php +++ b/agc_2-X/trunk/www/agc/call_log_display.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send the inbound and outbound calls for a specific phone # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -44,10 +44,11 @@ # 210616-2102 - Added optional CORS support, see options.php for details # 210825-0903 - Fix for XSS security issue # 220220-0920 - Added allow_web_debug system setting +# 260302-1402 - Code updates for PHP8 compatibility # -$version = '2.14-24'; -$build = '220220-0920'; +$version = '2.14-25'; +$build = '260302-1402'; $php_script = 'call_log_display.php'; $SSagent_debug_logging=0; $startMS = microtime(); @@ -58,18 +59,28 @@ require_once("functions.php"); ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} + else {$server_ip="";} if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} + else {$session_name="";} if (isset($_GET["format"])) {$format=$_GET["format"];} elseif (isset($_POST["format"])) {$format=$_POST["format"];} if (isset($_GET["exten"])) {$exten=$_GET["exten"];} elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} + else {$exten="";} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} + else {$protocol="";} +if (isset($_GET["in_limit"])) {$in_limit=$_GET["in_limit"];} + elseif (isset($_POST["in_limit"])) {$in_limit=$_POST["in_limit"];} +if (isset($_GET["out_limit"])) {$out_limit=$_GET["out_limit"];} + elseif (isset($_POST["out_limit"])) {$out_limit=$_POST["out_limit"];} $user=preg_replace("/\'|\"|\\\\|;| /","",$user); $pass=preg_replace("/\'|\"|\\\\|;| /","",$pass); @@ -109,7 +120,8 @@ if ($qm_conf_ct > 0) $SSagent_debug_logging = $row[3]; $SSallow_web_debug = $row[4]; } -if ($SSallow_web_debug < 1) {$DB=0; $format="text";} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0; $format="text";} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -125,23 +137,29 @@ if ($sl_ct > 0) ##### END SETTINGS LOOKUP ##### ########################################### -$session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); -$server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); +# $session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); +# $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); $exten = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$exten); $protocol = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$protocol); $in_limit = preg_replace('/[^0-9]/','',$in_limit); $out_limit = preg_replace('/[^0-9]/','',$out_limit); -$format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); +# $format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); if ($non_latin < 1) { $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user); $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); + $session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); + $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); + $format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); } else { $user = preg_replace('/[^-_0-9\p{L}]/u','',$user); $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); + $session_name = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$session_name); + $server_ip = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$server_ip); + $format = preg_replace('/[^-_0-9\p{L}]/u','',$format); } if (strlen($SSagent_debug_logging) > 1) @@ -275,7 +293,7 @@ if ($format=='debug') echo "\n\n\n"; } -if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);} +if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,"",$php_script,$user,"",0,$session_name,$stmt);} # ACTION, stage, lead_id are never defined in this script exit; ?> diff --git a/agc_2-X/trunk/www/agc/chat_db_query.php b/agc_2-X/trunk/www/agc/chat_db_query.php index eefdc4ba..dc946f7a 100644 --- a/agc_2-X/trunk/www/agc/chat_db_query.php +++ b/agc_2-X/trunk/www/agc/chat_db_query.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Joe Johnson, Matt Florell LICENSE: AGPLv2 # # Called by vdc_chat_display.php and vicidial_chat_agent.js. This contains all actions taken by the # agent's interface when chatting with customers, other agents, and managers, through @@ -27,6 +27,7 @@ # 210616-2055 - Added optional CORS support, see options.php for details # 220219-2336 - Added allow_web_debug system setting # 220518-2212 - Small fix for encrypted auth +# 260302-1425 - Code updates for PHP8 compatibility # $php_script = 'chat_db_query.php'; @@ -40,64 +41,89 @@ $style_array=array("", "italics", "bold italics"); if (isset($_GET["action"])) {$action=$_GET["action"];} elseif (isset($_POST["action"])) {$action=$_POST["action"];} + else {$action="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["chat_id"])) {$chat_id=$_GET["chat_id"];} elseif (isset($_POST["chat_id"])) {$chat_id=$_POST["chat_id"];} + else {$chat_id="";} if (isset($_GET["chat_group_id"])) {$chat_group_id=$_GET["chat_group_id"];} elseif (isset($_POST["chat_group_id"])) {$chat_group_id=$_POST["chat_group_id"];} + else {$chat_group_id="";} if (isset($_GET["chat_level"])) {$chat_level=$_GET["chat_level"];} elseif (isset($_POST["chat_level"])) {$chat_level=$_POST["chat_level"];} + else {$chat_level="";} if (isset($_GET["chat_creator"])) {$chat_creator=$_GET["chat_creator"];} elseif (isset($_POST["chat_creator"])) {$chat_creator=$_POST["chat_creator"];} + else {$chat_creator="";} if (isset($_GET["chat_member_name"])) {$chat_member_name=$_GET["chat_member_name"];} elseif (isset($_POST["chat_member_name"])) {$chat_member_name=$_POST["chat_member_name"];} + else {$chat_member_name="";} if (isset($_GET["chat_message"])) {$chat_message=$_GET["chat_message"];} elseif (isset($_POST["chat_message"])) {$chat_message=$_POST["chat_message"];} + else {$chat_message="";} if (isset($_GET["email"])) {$email=$_GET["email"];} elseif (isset($_POST["email"])) {$email=$_POST["email"];} + else {$email="";} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id=0;} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} + else {$server_ip="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} + else {$group_id="";} if (isset($_GET["keepalive"])) {$keepalive=$_GET["keepalive"];} elseif (isset($_POST["keepalive"])) {$keepalive=$_POST["keepalive"];} + else {$keepalive="";} if (isset($_GET["current_message_count"])) {$current_message_count=$_GET["current_message_count"];} elseif (isset($_POST["current_message_count"])) {$current_message_count=$_POST["current_message_count"];} + else {$current_message_count="";} if (isset($_GET["manager_chat_id"])) {$manager_chat_id=$_GET["manager_chat_id"];} elseif (isset($_POST["manager_chat_id"])) {$manager_chat_id=$_POST["manager_chat_id"];} + else {$manager_chat_id="";} if (isset($_GET["manager_chat_subid"])) {$manager_chat_subid=$_GET["manager_chat_subid"];} elseif (isset($_POST["manager_chat_subid"])) {$manager_chat_subid=$_POST["manager_chat_subid"];} + else {$manager_chat_subid="";} if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];} elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} + else {$field_name="";} if (isset($_GET["agent_manager"])) {$agent_manager=$_GET["agent_manager"];} elseif (isset($_POST["agent_manager"])) {$agent_manager=$_POST["agent_manager"];} + else {$agent_manager="";} if (isset($_GET["agent_to_add"])) {$agent_to_add=$_GET["agent_to_add"];} elseif (isset($_POST["agent_to_add"])) {$agent_to_add=$_POST["agent_to_add"];} + else {$agent_to_add="";} if (isset($_GET["agent_user"])) {$agent_user=$_GET["agent_user"];} elseif (isset($_POST["agent_user"])) {$agent_user=$_POST["agent_user"];} + else {$agent_user="";} if (isset($_GET["agent_override"])) {$agent_override=$_GET["agent_override"];} elseif (isset($_POST["agent_override"])) {$agent_override=$_POST["agent_override"];} + else {$agent_override="";} if (isset($_GET["hangup_override"])) {$hangup_override=$_GET["hangup_override"];} elseif (isset($_POST["hangup_override"])) {$hangup_override=$_POST["hangup_override"];} + else {$hangup_override="";} if (isset($_GET["manager_message"])) {$manager_message=$_GET["manager_message"];} elseif (isset($_POST["manager_message"])) {$manager_message=$_POST["manager_message"];} + else {$manager_message="";} if (isset($_GET["ChatReloadIDNumber"])) {$ChatReloadIDNumber=$_GET["ChatReloadIDNumber"];} elseif (isset($_POST["ChatReloadIDNumber"])) {$ChatReloadIDNumber=$_POST["ChatReloadIDNumber"];} + else {$ChatReloadIDNumber="";} if (isset($_GET["chat_xfer_type"])) {$chat_xfer_type=$_GET["chat_xfer_type"];} elseif (isset($_POST["chat_xfer_type"])) {$chat_xfer_type=$_POST["chat_xfer_type"];} + else {$chat_xfer_type="";} if (isset($_GET["chat_xfer_value"])) {$chat_xfer_value=$_GET["chat_xfer_value"];} elseif (isset($_POST["chat_xfer_value"])) {$chat_xfer_value=$_POST["chat_xfer_value"];} + else {$chat_xfer_value="";} -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); - -if (!$user) {echo "No user, no using."; exit;} +if (!isset($user)) {echo "No user, no using."; exit;} if (file_exists('options.php')) {require('options.php');} @@ -125,7 +151,8 @@ if ($qm_conf_ct > 0) $SSallow_web_debug = $row[5]; } $VUselected_language = $SSdefault_language; -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); ##### END SETTINGS LOOKUP ##### ########################################### @@ -145,13 +172,13 @@ $chat_xfer_value = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$chat_xfer_value); $email = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$email); $field_name = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$field_name); $manager_chat_subid = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$manager_chat_subid); -$action=preg_replace("/[^-_0-9a-zA-Z]/","",$action); -$keepalive=preg_replace("/[^-_0-9a-zA-Z]/","",$keepalive); +# $action=preg_replace("/[^-_0-9a-zA-Z]/","",$action); +# $keepalive=preg_replace("/[^-_0-9a-zA-Z]/","",$keepalive); $chat_message = preg_replace("/\"|\\\\|;/","",$chat_message); -$current_message_count=preg_replace("/[^-_0-9a-zA-Z]/","",$current_message_count); -$agent_override = preg_replace('/[^-_0-9\p{L}]/u',"",$agent_override); -$hangup_override = preg_replace('/[^-_0-9\p{L}]/u',"",$hangup_override); -$ChatReloadIDNumber=preg_replace("/[^-_0-9a-zA-Z]/","",$ChatReloadIDNumber); +# $current_message_count=preg_replace("/[^-_0-9a-zA-Z]/","",$current_message_count); +# $agent_override = preg_replace('/[^-_0-9\p{L}]/u',"",$agent_override); +# $hangup_override = preg_replace('/[^-_0-9\p{L}]/u',"",$hangup_override); +# $ChatReloadIDNumber=preg_replace("/[^-_0-9a-zA-Z]/","",$ChatReloadIDNumber); $manager_message = preg_replace("/\"|\\\\|;/","",$manager_message); if ($non_latin < 1) @@ -159,12 +186,24 @@ if ($non_latin < 1) $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user); $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); $chat_member_name = preg_replace('/[^- \.\,\_0-9a-zA-Z]/',"",$chat_member_name); + $action=preg_replace("/[^-_0-9a-zA-Z]/","",$action); + $keepalive=preg_replace("/[^-_0-9a-zA-Z]/","",$keepalive); + $current_message_count=preg_replace("/[^-_0-9a-zA-Z]/","",$current_message_count); + $agent_override = preg_replace('/[^-_0-9a-zA-Z]/',"",$agent_override); + $hangup_override = preg_replace('/[^-_0-9a-zA-Z]/',"",$hangup_override); + $ChatReloadIDNumber=preg_replace("/[^-_0-9a-zA-Z]/","",$ChatReloadIDNumber); } else { $user = preg_replace('/[^-_0-9\p{L}]/u','',$user); $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); $chat_member_name = preg_replace('/[^- \.\,\_0-9\p{L}]/u',"",$chat_member_name); + $action=preg_replace("/[^-_0-9\p{L}]/u","",$action); + $keepalive=preg_replace("/[^-_0-9\p{L}]/u","",$keepalive); + $current_message_count=preg_replace("/[^-_0-9\p{L}]/u","",$current_message_count); + $agent_override = preg_replace('/[^-_0-9\p{L}]/u',"",$agent_override); + $hangup_override = preg_replace('/[^-_0-9\p{L}]/u',"",$hangup_override); + $ChatReloadIDNumber=preg_replace("/[^-_0-9\p{L}]/u","",$ChatReloadIDNumber); } $auth=0; @@ -255,7 +294,7 @@ if ($action=="CreateAgentToAgentChat" && $agent_manager && $agent_user && $manag if ($action=="DisplayMgrAgentChat" && $manager_chat_id && $manager_chat_subid && $user) { $stmt="select vm.message_posted_by, vm.message, vm.message_date, vu.full_name, vm.manager, vm.manager_chat_subid, vmc.chat_start_date, vm.message_posted_by from vicidial_manager_chats vmc, vicidial_manager_chat_log vm, vicidial_users vu where vmc.manager_chat_id='$manager_chat_id' and vmc.manager_chat_id=vm.manager_chat_id and vm.manager_chat_subid='$manager_chat_subid' and vm.user=vu.user and vm.user='$user' order by vm.manager_chat_subid asc, message_date desc"; $rslt=mysql_to_mysqli($stmt, $link); - if ($debug==1) {echo "$stmt
    \n";} + if ($DB) {echo "$stmt
    \n";} # Mark messages as viewed by user (not manager, even if manager is agent at the time) $upd_stmt="update vicidial_manager_chat_log set message_viewed_date=now() where message_viewed_date is null and manager_chat_id='$manager_chat_id' and manager_chat_subid='$manager_chat_subid' and user='$user'"; @@ -305,8 +344,8 @@ if ($action=="DisplayMgrAgentChat" && $manager_chat_id && $manager_chat_subid && } while($row=mysqli_fetch_row($rslt)) { - if (!$chat_start_date) {$chat_start_date=$row[6];} - if (!$manager) {$manager=$row[4];} + if (!isset($chat_start_date)) {$chat_start_date=$row[6];} + if (!isset($manager)) {$manager=$row[4];} if ($backlog_limit>0) { # Current agent is always the blue text @@ -796,7 +835,7 @@ if ($action=="assign_chat" && $chat_id) { # Assign available vicidial_agent to c ###### CUSTOMER-AGENT CHAT FUNCTIONS ###### if ($action=="start_chat" && $user && $server_ip) { - if (!$chat_group_id) { + if (!isset($chat_group_id)) { echo "NO_GROUP"; } else { $user_stmt="select if(user_nickname!='' and user_nickname is not null, user_nickname, full_name) from vicidial_users where user='$user'"; @@ -985,7 +1024,7 @@ if ($action=="update_agent_chat_window" && $chat_id) { } ## GRAB CHAT MESSAGES AND DISPLAY THEM - if (!$user_level || $user_level==0) {$user_level_clause=" and chat_level='0' ";} else {$user_level_clause="";} + if (!isset($user_level) || $user_level==0) {$user_level_clause=" and chat_level='0' ";} else {$user_level_clause="";} $stmt="select * from vicidial_chat_log where chat_id='$chat_id' $user_level_clause order by message_time asc"; @@ -1239,7 +1278,7 @@ if ($action=="end_chat" && $chat_id && $chat_creator && $user && $server_ip) { # HTML to display after ending chat - will only display again if no lead_id, i.e. no customer involved and no dispositioning needed. echo "|"; - if (!$lead_id) { + if (!isset($lead_id)) { $upd_stmt="UPDATE vicidial_live_agents set status='PAUSED',comments='',external_hangup=0,external_status='',external_pause='',external_dial='',last_state_change='$NOW_TIME',pause_code='' where user='$user' and server_ip='$server_ip' and status='INCALL' and comments='CHAT'"; $upd_rslt=mysql_to_mysqli($upd_stmt, $link); @@ -1330,7 +1369,7 @@ if ($action=="show_live_chats" && $user) { $chat_member=$row[1]; $chat_member_name=$row[2]; $empty_chat_creator=$row[3]; - if (!$active_chats[$chat_id]) { + if (!isset($active_chats[$chat_id])) { $active_chats[$chat_id][]=array("$chat_member", "$chat_member_name", "absent", "$empty_chat_creator"); } } diff --git a/agc_2-X/trunk/www/agc/conf_exten_check.php b/agc_2-X/trunk/www/agc/conf_exten_check.php index 09d27f55..ae4bdb5d 100644 --- a/agc_2-X/trunk/www/agc/conf_exten_check.php +++ b/agc_2-X/trunk/www/agc/conf_exten_check.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the meetme conference has live channels connected and which they are # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -96,15 +96,17 @@ # 230412-1020 - Added code for send_notification API function # 230420-2020 - Added latency logging # 230616-1810 - Added dead_count checking and 1-second delay in DEAD call logging and dead call log reversal +# 260302-1359 - Code updates for PHP8 compatibility # -$version = '2.14-70'; -$build = '230616-1810'; +$version = '2.14-71'; +$build = '260302-1359'; $php_script = 'conf_exten_check.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=51; $one_mysql_log=0; $DB=0; +$stage=""; $VD_login=0; $SSagent_debug_logging=0; $dead_logging_version=1; @@ -121,12 +123,16 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} + else {$server_ip="";} if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} + else {$session_name="";} if (isset($_GET["format"])) {$format=$_GET["format"];} elseif (isset($_POST["format"])) {$format=$_POST["format"];} if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} @@ -135,46 +141,68 @@ if (isset($_GET["client"])) {$client=$_GET["client"];} elseif (isset($_POST["client"])) {$client=$_POST["client"];} if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} + else {$conf_exten="";} if (isset($_GET["exten"])) {$exten=$_GET["exten"];} elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} + else {$exten="";} if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} + else {$auto_dial_level="";} if (isset($_GET["campagentstdisp"])) {$campagentstdisp=$_GET["campagentstdisp"];} elseif (isset($_POST["campagentstdisp"])) {$campagentstdisp=$_POST["campagentstdisp"];} + else {$campagentstdisp="";} if (isset($_GET["bcrypt"])) {$bcrypt=$_GET["bcrypt"];} elseif (isset($_POST["bcrypt"])) {$bcrypt=$_POST["bcrypt"];} if (isset($_GET["clicks"])) {$clicks=$_GET["clicks"];} elseif (isset($_POST["clicks"])) {$clicks=$_POST["clicks"];} + else {$clicks="";} if (isset($_GET["customer_chat_id"])) {$customer_chat_id=$_GET["customer_chat_id"];} elseif (isset($_POST["customer_chat_id"])) {$customer_chat_id=$_POST["customer_chat_id"];} + else {$customer_chat_id="";} if (isset($_GET["live_call_seconds"])) {$live_call_seconds=$_GET["live_call_seconds"];} elseif (isset($_POST["live_call_seconds"])) {$live_call_seconds=$_POST["live_call_seconds"];} + else {$live_call_seconds=0;} if (isset($_GET["xferchannel"])) {$xferchannel=$_GET["xferchannel"];} elseif (isset($_POST["xferchannel"])) {$xferchannel=$_POST["xferchannel"];} + else {$xferchannel="";} if (isset($_GET["check_for_answer"])) {$check_for_answer=$_GET["check_for_answer"];} elseif (isset($_POST["check_for_answer"])) {$check_for_answer=$_POST["check_for_answer"];} + else {$check_for_answer="";} if (isset($_GET["MDnextCID"])) {$MDnextCID=$_GET["MDnextCID"];} elseif (isset($_POST["MDnextCID"])) {$MDnextCID=$_POST["MDnextCID"];} + else {$MDnextCID="";} if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} + else {$campaign="";} if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + else {$phone_number="";} if (isset($_GET["visibility"])) {$visibility=$_GET["visibility"];} elseif (isset($_POST["visibility"])) {$visibility=$_POST["visibility"];} + else {$visibility="";} if (isset($_GET["active_ingroup_dial"])) {$active_ingroup_dial=$_GET["active_ingroup_dial"];} elseif (isset($_POST["active_ingroup_dial"])) {$active_ingroup_dial=$_POST["active_ingroup_dial"];} + else {$active_ingroup_dial="";} if (isset($_GET["latency"])) {$latency=$_GET["latency"];} elseif (isset($_POST["latency"])) {$latency=$_POST["latency"];} + else {$latency="";} if (isset($_GET["dead_count"])) {$dead_count=$_GET["dead_count"];} elseif (isset($_POST["dead_count"])) {$dead_count=$_POST["dead_count"];} - -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); + else {$dead_count="";} # default optional vars if not set if (!isset($format)) {$format="text";} if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($client)) {$client="agc";} if ($bcrypt == 'OFF') {$bcrypt=0;} +if (!isset($lead_id)) {$lead_id=0;} + +$StarTtime = date("U"); +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$FILE_TIME = date("Ymd_His"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} +$random = (rand(1000000, 9999999) + 10000000); # if options file exists, use the override values for the above variables # see the options-example.php file for more information @@ -208,7 +236,8 @@ if ($qm_conf_ct > 0) $SSallow_web_debug = $row[4]; $SSagent_notifications = $row[5]; } -if ($SSallow_web_debug < 1) {$DB=0; $format='text';} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0; $format="text";} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -224,26 +253,26 @@ if ($sl_ct > 0) ##### END SETTINGS LOOKUP ##### ########################################### -$session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); -$server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); -$conf_exten = preg_replace("/[^-_0-9a-zA-Z]/","",$conf_exten); +# $session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); +# $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); +# $conf_exten = preg_replace("/[^-_0-9a-zA-Z]/","",$conf_exten); $exten = preg_replace("/\'|\"|\\\\|;/","",$exten); $clicks = preg_replace("/\'|\"|\\\\|;/","",$clicks); -$customer_chat_id = preg_replace("/[^0-9a-zA-Z]/","",$customer_chat_id); +# $customer_chat_id = preg_replace("/[^0-9a-zA-Z]/","",$customer_chat_id); $visibility = preg_replace("/\'|\"|\\\\|;/","",$visibility); -$MDnextCID = preg_replace("/[^-_0-9a-zA-Z]/","",$MDnextCID); -$live_call_seconds = preg_replace("/[^-_0-9a-zA-Z]/","",$live_call_seconds); -$bcrypt = preg_replace("/[^-_0-9a-zA-Z]/","",$bcrypt); -$format = preg_replace("/[^-_0-9a-zA-Z]/","",$format); -$ACTION = preg_replace("/[^-_0-9a-zA-Z]/","",$ACTION); -$auto_dial_level = preg_replace("/[^-\._0-9a-zA-Z]/","",$auto_dial_level); -$check_for_answer = preg_replace("/[^-_0-9a-zA-Z]/","",$check_for_answer); -$client = preg_replace("/[^-_0-9a-zA-Z]/","",$client); -$campagentstdisp = preg_replace("/[^-_0-9a-zA-Z]/","",$campagentstdisp); -$phone_number = preg_replace("/[^-_0-9a-zA-Z]/","",$phone_number); +# $MDnextCID = preg_replace("/[^-_0-9a-zA-Z]/","",$MDnextCID); +# $live_call_seconds = preg_replace("/[^-_0-9a-zA-Z]/","",$live_call_seconds); +# $bcrypt = preg_replace("/[^-_0-9a-zA-Z]/","",$bcrypt); +# $format = preg_replace("/[^-_0-9a-zA-Z]/","",$format); +# $ACTION = preg_replace("/[^-_0-9a-zA-Z]/","",$ACTION); +# $auto_dial_level = preg_replace("/[^-\._0-9a-zA-Z]/","",$auto_dial_level); +# $check_for_answer = preg_replace("/[^-_0-9a-zA-Z]/","",$check_for_answer); +# $client = preg_replace("/[^-_0-9a-zA-Z]/","",$client); +# $campagentstdisp = preg_replace("/[^-_0-9a-zA-Z]/","",$campagentstdisp); +# $phone_number = preg_replace("/[^-_0-9a-zA-Z]/","",$phone_number); $xferchannel = preg_replace("/\'|\"|\\\\|;/","",$xferchannel); -$latency = preg_replace("/[^-_0-9a-zA-Z]/","",$latency); -$dead_count = preg_replace("/[^-_0-9a-zA-Z]/","",$dead_count); +# $latency = preg_replace("/[^-_0-9a-zA-Z]/","",$latency); +# $dead_count = preg_replace("/[^-_0-9a-zA-Z]/","",$dead_count); if ($non_latin < 1) { @@ -251,6 +280,22 @@ if ($non_latin < 1) $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); $campaign = preg_replace("/[^-_0-9a-zA-Z]/","",$campaign); $active_ingroup_dial = preg_replace("/[^-_0-9a-zA-Z]/","",$active_ingroup_dial); + $session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); + $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); + $conf_exten = preg_replace("/[^-_0-9a-zA-Z]/","",$conf_exten); + $customer_chat_id = preg_replace("/[^0-9a-zA-Z]/","",$customer_chat_id); + $MDnextCID = preg_replace("/[^-_0-9a-zA-Z]/","",$MDnextCID); + $live_call_seconds = preg_replace("/[^-_0-9a-zA-Z]/","",$live_call_seconds); + $bcrypt = preg_replace("/[^-_0-9a-zA-Z]/","",$bcrypt); + $format = preg_replace("/[^-_0-9a-zA-Z]/","",$format); + $ACTION = preg_replace("/[^-_0-9a-zA-Z]/","",$ACTION); + $auto_dial_level = preg_replace("/[^-\._0-9a-zA-Z]/","",$auto_dial_level); + $check_for_answer = preg_replace("/[^-_0-9a-zA-Z]/","",$check_for_answer); + $client = preg_replace("/[^-_0-9a-zA-Z]/","",$client); + $campagentstdisp = preg_replace("/[^-_0-9a-zA-Z]/","",$campagentstdisp); + $phone_number = preg_replace("/[^-_0-9a-zA-Z]/","",$phone_number); + $latency = preg_replace("/[^-_0-9a-zA-Z]/","",$latency); + $dead_count = preg_replace("/[^-_0-9a-zA-Z]/","",$dead_count); } else { @@ -258,6 +303,22 @@ else $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); $campaign = preg_replace('/[^-_0-9\p{L}]/u', '', $campaign); $active_ingroup_dial = preg_replace('/[^-_0-9\p{L}]/u',"",$active_ingroup_dial); + $session_name = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$session_name); + $server_ip = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$server_ip); + $conf_exten = preg_replace("/[^-_0-9\p{L}]/u","",$conf_exten); + $customer_chat_id = preg_replace("/[^0-9\p{L}]/u","",$customer_chat_id); + $MDnextCID = preg_replace("/[^-_0-9\p{L}]/u","",$MDnextCID); + $live_call_seconds = preg_replace("/[^-_0-9\p{L}]/u","",$live_call_seconds); + $bcrypt = preg_replace("/[^-_0-9\p{L}]/u","",$bcrypt); + $format = preg_replace("/[^-_0-9\p{L}]/u","",$format); + $ACTION = preg_replace("/[^-_0-9\p{L}]/u","",$ACTION); + $auto_dial_level = preg_replace("/[^-\._0-9\p{L}]/u","",$auto_dial_level); + $check_for_answer = preg_replace("/[^-_0-9\p{L}]/u","",$check_for_answer); + $client = preg_replace("/[^-_0-9\p{L}]/u","",$client); + $campagentstdisp = preg_replace("/[^-_0-9\p{L}]/u","",$campagentstdisp); + $phone_number = preg_replace("/[^-_0-9\p{L}]/u","",$phone_number); + $latency = preg_replace("/[^-_0-9\p{L}]/u","",$latency); + $dead_count = preg_replace("/[^-_0-9\p{L}]/u","",$dead_count); } if (strlen($SSagent_debug_logging) > 1) @@ -271,14 +332,6 @@ $Alogin_notes=''; $RingCalls='N'; $DiaLCalls='N'; -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$FILE_TIME = date("Ymd_His"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} -$random = (rand(1000000, 9999999) + 10000000); - - $auth=0; $auth_message = user_authorization($user,$pass,'',0,$bcrypt,0,0,'conf_exten_check'); if ($auth_message == 'GOOD') @@ -349,16 +402,17 @@ if ($ACTION == 'refresh') } else { + $Astatus=''; + $Aagent_log_id=''; + $Acallerid=''; + $Acampaign_id=''; + if ($client == 'vdc') { $Acount=0; $Scount=0; $AexternalDEAD=0; - $Aagent_log_id=''; - $Acallerid=''; $DEADcustomer=0; - $Astatus=''; - $Acampaign_id=''; ### see if the agent has a record in the vicidial_live_agents table $stmt="SELECT count(*) from vicidial_live_agents where user='$user' and server_ip='$server_ip';"; @@ -758,7 +812,8 @@ if ($ACTION == 'refresh') ### see if chats/emails are enabled, and if so how many of each are waiting # 03041 and 03042 are the error logs for this - + $live_agents_comments=''; + $chat_email_stmt="select allow_chats, allow_emails from system_settings;"; $chat_email_rslt=mysql_to_mysqli($chat_email_stmt, $link); $chat_email_row=mysqli_fetch_row($chat_email_rslt); @@ -1683,12 +1738,12 @@ if (strlen($visibility) > 1) while($vc < $visibility_details_ct) { $visibility_data = explode(' ',$visibility_details[$vc]); - $visibility_type = $visibility_data[0]; - $visibility_length = $visibility_data[1]; - $visibility_start_epoch = $visibility_data[2]; - $visibility_end_epoch = $visibility_data[3]; + $visibility_type = (isset($visibility_data[0]) ? $visibility_data[0] : ""); + $visibility_length = (isset($visibility_data[1]) ? $visibility_data[1] : ""); + $visibility_start_epoch = (isset($visibility_data[2]) ? $visibility_data[2] : ""); + $visibility_end_epoch = (isset($visibility_data[3]) ? $visibility_data[3] : ""); #$visibility_length = ($StarTtime - $visibility_data[2]); - $agent_log_id = $visibility_data[4]; + $agent_log_id = (isset($visibility_data[4]) ? $visibility_data[4] : ""); if (strlen($visibility_type) > 1) { @@ -1715,9 +1770,17 @@ if ($SSagent_debug_logging > 0) { $click_data = explode('-----',$clicks_details[$cd]); $click_time = $click_data[0]; - $click_function_data = explode('---',$click_data[1]); - $click_function = $click_function_data[0]; - $click_options = $click_function_data[1]; + if (isset($click_data[1])) + { + $click_function_data = explode('---',$click_data[1]); + $click_function = (isset($click_function_data[0]) ? $click_function_data[0] : ""); + $click_options = (isset($click_function_data[1]) ? $click_function_data[1] : ""); + } + else + { + $click_function=''; + $click_options=''; + } $stmtA="INSERT INTO vicidial_ajax_log set user='$user',start_time='$click_time',db_time=NOW(),run_time='0',php_script='vicidial.php',action='$click_function',lead_id='$lead_id',stage='$cd|$click_options',session_name='$session_name',last_sql='';"; $rslt=mysql_to_mysqli($stmtA, $link); diff --git a/agc_2-X/trunk/www/agc/deactivate_lead.php b/agc_2-X/trunk/www/agc/deactivate_lead.php index 277ee6d4..c8e69e05 100644 --- a/agc_2-X/trunk/www/agc/deactivate_lead.php +++ b/agc_2-X/trunk/www/agc/deactivate_lead.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed to be used in the "Dispo URL" field of a campaign # or in-group. It should take in the campaign_id to check for the same source_id @@ -35,6 +35,7 @@ # 210615-1036 - Default security fixes, CVE-2021-28854 # 210616-2050 - Added optional CORS support, see options.php for details # 220219-2320 - Added allow_web_debug system setting +# 260302-1358 - Code updates for PHP8 compatibility # $api_script = 'deactivate'; @@ -48,30 +49,37 @@ $filetime = date("H:i:s"); $IP = getenv ("REMOTE_ADDR"); $BR = getenv ("HTTP_USER_AGENT"); -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_AUTH_USER=(array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : ""); +$PHP_AUTH_PW=(array_key_exists('PHP_AUTH_PW', $_SERVER) ? $_SERVER['PHP_AUTH_PW'] : ""); if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id=0;} if (isset($_GET["search_field"])) {$search_field=$_GET["search_field"];} elseif (isset($_POST["search_field"])) {$search_field=$_POST["search_field"];} + else {$search_field="";} if (isset($_GET["campaign_check"])) {$campaign_check=$_GET["campaign_check"];} elseif (isset($_POST["campaign_check"])) {$campaign_check=$_POST["campaign_check"];} + else {$campaign_check="";} if (isset($_GET["sale_status"])) {$sale_status=$_GET["sale_status"];} elseif (isset($_POST["sale_status"])) {$sale_status=$_POST["sale_status"];} + else {$sale_status="";} if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} + else {$dispo="";} if (isset($_GET["new_status"])) {$new_status=$_GET["new_status"];} elseif (isset($_POST["new_status"])) {$new_status=$_POST["new_status"];} + else {$new_status="";} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["log_to_file"])) {$log_to_file=$_GET["log_to_file"];} elseif (isset($_POST["log_to_file"])) {$log_to_file=$_POST["log_to_file"];} - -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); + else {$log_to_file=0;} #$DB = '1'; # DEBUG override $US = '_'; @@ -109,7 +117,8 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[2]; $SSallow_web_debug = $row[3]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} else {$DB=$SSallow_web_debug;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -127,7 +136,7 @@ if ($sl_ct > 0) $search_field = preg_replace("/\'|\"|\\\\|;| /","",$search_field); $lead_id = preg_replace('/[^0-9]/','',$lead_id); -$log_to_file = preg_replace('/[^-_0-9a-zA-Z]/', '', $log_to_file); +$log_to_file = preg_replace('/[^0-9]/', '', $log_to_file); if ($non_latin < 1) { @@ -168,7 +177,9 @@ if (preg_match("/$TD$dispo$TD/",$sale_status)) exit; } - $stmt = "SELECT $search_field FROM vicidial_list where lead_id='$lead_id';"; + $search_fieldSQL = $search_field; + if (strlen($search_field) < 1) {$search_fieldSQL = "''";} + $stmt = "SELECT $search_fieldSQL FROM vicidial_list where lead_id='$lead_id';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} $sv_ct = mysqli_num_rows($rslt); diff --git a/agc_2-X/trunk/www/agc/dispo_add_FPG.php b/agc_2-X/trunk/www/agc/dispo_add_FPG.php index 5d7c33c2..c8ae4347 100644 --- a/agc_2-X/trunk/www/agc/dispo_add_FPG.php +++ b/agc_2-X/trunk/www/agc/dispo_add_FPG.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed to be used in the "Dispo URL" field of a campaign # or in-group. It adds the phone_number of the call to a designated inbound @@ -24,6 +24,7 @@ # 210615-1039 - Default security fixes, CVE-2021-28854 # 210616-2049 - Added optional CORS support, see options.php for details # 220219-2317 - Added allow_web_debug system setting +# 260302-1357 - Code updates for PHP8 compatibility # $api_script = 'add_FPG'; @@ -37,28 +38,34 @@ $filetime = date("H:i:s"); $IP = getenv ("REMOTE_ADDR"); $BR = getenv ("HTTP_USER_AGENT"); -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_AUTH_USER=(array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : ""); +$PHP_AUTH_PW=(array_key_exists('PHP_AUTH_PW', $_SERVER) ? $_SERVER['PHP_AUTH_PW'] : ""); if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + else {$phone_number="";} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id=0;} if (isset($_GET["sale_status"])) {$sale_status=$_GET["sale_status"];} elseif (isset($_POST["sale_status"])) {$sale_status=$_POST["sale_status"];} + else {$sale_status="";} if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} + else {$dispo="";} if (isset($_GET["FPG_id"])) {$FPG_id=$_GET["FPG_id"];} elseif (isset($_POST["FPG_id"])) {$FPG_id=$_POST["FPG_id"];} + else {$FPG_id="";} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["log_to_file"])) {$log_to_file=$_GET["log_to_file"];} elseif (isset($_POST["log_to_file"])) {$log_to_file=$_POST["log_to_file"];} - -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); + else {$log_to_file=0;} #$DB = '1'; # DEBUG override $US = '_'; @@ -98,7 +105,8 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[2]; $SSallow_web_debug = $row[3]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -114,10 +122,10 @@ if ($sl_ct > 0) ##### END SETTINGS LOOKUP ##### ########################################### -$phone_number = preg_replace('/[^-_0-9a-zA-Z]/','',$phone_number); +# $phone_number = preg_replace('/[^-_0-9a-zA-Z]/','',$phone_number); $FPG_id = preg_replace("/\'|\"|\\\\|;| /","",$FPG_id); $lead_id = preg_replace('/[^0-9]/','',$lead_id); -$log_to_file = preg_replace('/[^-_0-9a-zA-Z]/', '', $log_to_file); +$log_to_file = preg_replace('/[^0-9]/', '', $log_to_file); if ($non_latin < 1) { @@ -125,6 +133,7 @@ if ($non_latin < 1) $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); $sale_status = preg_replace('/[^-_0-9a-zA-Z]/', '', $sale_status); $dispo = preg_replace('/[^-_0-9a-zA-Z]/', '', $dispo); + $phone_number = preg_replace('/[^-_0-9a-zA-Z]/','',$phone_number); } else { @@ -132,6 +141,7 @@ else $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); $sale_status = preg_replace('/[^-_0-9\p{L}]/u', '', $sale_status); $dispo = preg_replace('/[^-_0-9\p{L}]/u', '', $dispo); + $phone_number = preg_replace('/[^-_0-9\p{L}]/u','',$phone_number); } if ($DB>0) {echo "$lead_id|$search_field|$campaign_check|$sale_status|$dispo|$new_status|$user|$pass|$DB|$log_to_file|\n";} diff --git a/agc_2-X/trunk/www/agc/dispo_change_status.php b/agc_2-X/trunk/www/agc/dispo_change_status.php index 644c9dfe..f349c987 100644 --- a/agc_2-X/trunk/www/agc/dispo_change_status.php +++ b/agc_2-X/trunk/www/agc/dispo_change_status.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed to be used in the "Dispo URL" field of a campaign # or in-group. It can update the status of a lead to a new status if the lead @@ -28,6 +28,7 @@ # 210615-1035 - Default security fixes, CVE-2021-28854 # 210616-2047 - Added optional CORS support, see options.php for details # 220219-2314 - Added allow_web_debug system setting +# 260302-1356 - Code updates for PHP8 compatibility # $api_script = 'dispo_change_status'; @@ -41,34 +42,43 @@ $filetime = date("H:i:s"); $IP = getenv ("REMOTE_ADDR"); $BR = getenv ("HTTP_USER_AGENT"); -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_AUTH_USER=(array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : ""); +$PHP_AUTH_PW=(array_key_exists('PHP_AUTH_PW', $_SERVER) ? $_SERVER['PHP_AUTH_PW'] : ""); if (isset($_GET["logged_status"])) {$logged_status=$_GET["logged_status"];} elseif (isset($_POST["logged_status"])) {$logged_status=$_POST["logged_status"];} + else {$logged_status="";} if (isset($_GET["logged_count"])) {$logged_count=$_GET["logged_count"];} elseif (isset($_POST["logged_count"])) {$logged_count=$_POST["logged_count"];} + else {$logged_count=0;} if (isset($_GET["new_status"])) {$new_status=$_GET["new_status"];} elseif (isset($_POST["new_status"])) {$new_status=$_POST["new_status"];} + else {$new_status="";} if (isset($_GET["days_search"])) {$days_search=$_GET["days_search"];} elseif (isset($_POST["days_search"])) {$days_search=$_POST["days_search"];} + else {$days_search=0;} if (isset($_GET["archive_search"])) {$archive_search=$_GET["archive_search"];} elseif (isset($_POST["archive_search"])) {$archive_search=$_POST["archive_search"];} + else {$archive_search='N';} if (isset($_GET["in_out_search"])) {$in_out_search=$_GET["in_out_search"];} elseif (isset($_POST["in_out_search"])) {$in_out_search=$_POST["in_out_search"];} + else {$in_out_search='BOTH';} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id=0;} if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} + else {$dispo="";} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["log_to_file"])) {$log_to_file=$_GET["log_to_file"];} elseif (isset($_POST["log_to_file"])) {$log_to_file=$_POST["log_to_file"];} - -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); + else {$log_to_file=0;} #$DB = '1'; # DEBUG override $US = '_'; @@ -85,8 +95,6 @@ $user=preg_replace("/\'|\"|\\\\|;| /","",$user); $pass=preg_replace("/\'|\"|\\\\|;| /","",$pass); # set defaults for variables not set -if (strlen($days_search) < 1) - {$days_search = 0;} if ( ($archive_search != 'Y') and ($archive_search != 'N') ) {$archive_search = 'N';} if ( ($in_out_search != 'IN') and ($in_out_search != 'OUT') and ($in_out_search != 'BOTH') ) @@ -115,7 +123,8 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[2]; $SSallow_web_debug = $row[3]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -133,10 +142,18 @@ if ($sl_ct > 0) $lead_id = preg_replace('/[^0-9]/','',$lead_id); $logged_count = preg_replace('/[^0-9]/','',$logged_count); $days_search = preg_replace('/[^0-9]/','',$days_search); -$archive_search = preg_replace('/[^-_0-9a-zA-Z]/','',$archive_search); -$in_out_search = preg_replace('/[^-_0-9a-zA-Z]/','',$in_out_search); +# $archive_search = preg_replace('/[^-_0-9a-zA-Z]/','',$archive_search); +# $in_out_search = preg_replace('/[^-_0-9a-zA-Z]/','',$in_out_search); $log_to_file = preg_replace('/[^0-9]/','',$log_to_file); +if (strlen($days_search) < 1) + {$days_search = 0;} +if (strlen($lead_id) < 1) + {$lead_id = 0;} +if (strlen($logged_count) < 1) + {$logged_count = 0;} + + if ($non_latin < 1) { $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user); @@ -144,6 +161,8 @@ if ($non_latin < 1) $logged_status = preg_replace('/[^-_0-9a-zA-Z]/','',$logged_status); $new_status = preg_replace('/[^-_0-9a-zA-Z]/','',$new_status); $dispo = preg_replace('/[^-_0-9a-zA-Z]/', '', $dispo); + $archive_search = preg_replace('/[^-_0-9a-zA-Z]/','',$archive_search); + $in_out_search = preg_replace('/[^-_0-9a-zA-Z]/','',$in_out_search); } else { @@ -152,11 +171,13 @@ else $logged_status = preg_replace('/[^-_0-9\p{L}]/u','',$logged_status); $new_status = preg_replace('/[^-_0-9\p{L}]/u','',$new_status); $dispo = preg_replace('/[^-_0-9\p{L}]/u', '', $dispo); + $archive_search = preg_replace('/[^-_0-9\p{L}]/u','',$archive_search); + $in_out_search = preg_replace('/[^-_0-9\p{L}]/u','',$in_out_search); } if ($DB>0) {echo "$lead_id|$dispo|$logged_status|$logged_count|$new_status|$days_search|$archive_search|$in_out_search|$user|$pass|$DB|$log_to_file|\n";} -if ( (strlen($logged_status) > 0) and (strlen($logged_count) > 0) and (strlen($new_status) > 0) ) +if ( (strlen($logged_status) > 0) and ($logged_count > 0) and (strlen($new_status) > 0) ) {$match_found=1;} if ($match_found > 0) @@ -206,7 +227,7 @@ if ($match_found > 0) exit; } - if (strlen($lead_id) > 0) + if ($lead_id > 0) { $days_searchSQL=''; $days_search_date=''; diff --git a/agc_2-X/trunk/www/agc/dispo_list_quota.php b/agc_2-X/trunk/www/agc/dispo_list_quota.php index e7ddad5f..914c1c44 100644 --- a/agc_2-X/trunk/www/agc/dispo_list_quota.php +++ b/agc_2-X/trunk/www/agc/dispo_list_quota.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed to be used in the "Dispo URL" field of a campaign # or in-group. It can check to see if a list should be set to active=N if the @@ -24,6 +24,7 @@ # CHANGES # 210813-1340 - First Build # 220219-2311 - Added allow_web_debug system setting +# 260302-1219 - Code updates for PHP8 compatibility # $api_script = 'dispo_list_quota'; @@ -37,34 +38,43 @@ $filetime = date("H:i:s"); $IP = getenv ("REMOTE_ADDR"); $BR = getenv ("HTTP_USER_AGENT"); -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_AUTH_USER=(array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : ""); +$PHP_AUTH_PW=(array_key_exists('PHP_AUTH_PW', $_SERVER) ? $_SERVER['PHP_AUTH_PW'] : ""); if (isset($_GET["quota_status"])) {$quota_status=$_GET["quota_status"];} elseif (isset($_POST["quota_status"])) {$quota_status=$_POST["quota_status"];} + else {$quota_status="";} if (isset($_GET["logged_count"])) {$logged_count=$_GET["logged_count"];} elseif (isset($_POST["logged_count"])) {$logged_count=$_POST["logged_count"];} + else {$logged_count=0;} if (isset($_GET["list_quota_field"])) {$list_quota_field=$_GET["list_quota_field"];} elseif (isset($_POST["list_quota_field"])) {$list_quota_field=$_POST["list_quota_field"];} + else {$list_quota_field="";} if (isset($_GET["list_quota_count"])) {$list_quota_count=$_GET["list_quota_count"];} elseif (isset($_POST["list_quota_count"])) {$list_quota_count=$_POST["list_quota_count"];} + else {$list_quota_count="";} if (isset($_GET["clear_from_hopper"])) {$clear_from_hopper=$_GET["clear_from_hopper"];} elseif (isset($_POST["clear_from_hopper"])) {$clear_from_hopper=$_POST["clear_from_hopper"];} + else {$clear_from_hopper=0;} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id=0;} if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} + else {$list_id="";} if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} + else {$dispo="";} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["log_to_file"])) {$log_to_file=$_GET["log_to_file"];} elseif (isset($_POST["log_to_file"])) {$log_to_file=$_POST["log_to_file"];} - -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); + else {$log_to_file=0;} #$DB = '1'; # DEBUG override $US = '_'; @@ -80,6 +90,7 @@ $k=0; $user=preg_replace("/\'|\"|\\\\|;| /","",$user); $pass=preg_replace("/\'|\"|\\\\|;| /","",$pass); +/* These don't seem to be used # set defaults for variables not set if (strlen($days_search) < 1) {$days_search = 0;} @@ -87,6 +98,7 @@ if ( ($archive_search != 'Y') and ($archive_search != 'N') ) {$archive_search = 'N';} if ( ($in_out_search != 'IN') and ($in_out_search != 'OUT') and ($in_out_search != 'BOTH') ) {$in_out_search = 'BOTH';} +*/ # if options file exists, use the override values for the above variables # see the options-example.php file for more information @@ -111,7 +123,8 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[2]; $SSallow_web_debug = $row[3]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -129,10 +142,10 @@ if ($sl_ct > 0) $lead_id = preg_replace('/[^0-9]/','',$lead_id); $list_id = preg_replace('/[^_0-9]/', '', $list_id); $log_to_file = preg_replace('/[^0-9]/','',$log_to_file); -$list_quota_field = preg_replace('/[^-_0-9a-zA-Z]/', '', $list_quota_field); -$list_quota_count = preg_replace('/[^-_0-9a-zA-Z]/', '', $list_quota_count); +# $list_quota_field = preg_replace('/[^-_0-9a-zA-Z]/', '', $list_quota_field); +# $list_quota_count = preg_replace('/[^-_0-9a-zA-Z]/', '', $list_quota_count); $clear_from_hopper = preg_replace('/[^0-9]/','',$clear_from_hopper); -$logged_count = preg_replace('/[^-_0-9a-zA-Z]/', '', $logged_count); +# $logged_count = preg_replace('/[^-_0-9a-zA-Z]/', '', $logged_count); if ($non_latin < 1) { @@ -140,6 +153,9 @@ if ($non_latin < 1) $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); $quota_status = preg_replace('/[^-_0-9a-zA-Z]/','',$quota_status); $dispo = preg_replace('/[^-_0-9a-zA-Z]/', '', $dispo); + $list_quota_field = preg_replace('/[^-_0-9a-zA-Z]/', '', $list_quota_field); + $list_quota_count = preg_replace('/[^-_0-9a-zA-Z]/', '', $list_quota_count); + $logged_count = preg_replace('/[^-_0-9a-zA-Z]/', '', $logged_count); } else { @@ -147,6 +163,9 @@ else $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); $quota_status = preg_replace('/[^-_0-9\p{L}]/u','',$quota_status); $dispo = preg_replace('/[^-_0-9\p{L}]/u','',$dispo); + $list_quota_field = preg_replace('/[^-_0-9\p{L}]/u', '', $list_quota_field); + $list_quota_count = preg_replace('/[^-_0-9\p{L}]/u', '', $list_quota_count); + $logged_count = preg_replace('/[^-_0-9\p{L}]/u', '', $logged_count); } if ($DB>0) {echo "$lead_id|$list_id|$dispo|$quota_status|$list_quota_field|$list_quota_count|$clear_from_hopper|$user|$pass|$DB|$log_to_file|\n";} diff --git a/agc_2-X/trunk/www/agc/dispo_move_list.php b/agc_2-X/trunk/www/agc/dispo_move_list.php index debf1b5d..cbc81a74 100644 --- a/agc_2-X/trunk/www/agc/dispo_move_list.php +++ b/agc_2-X/trunk/www/agc/dispo_move_list.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed to be used in the "Dispo URL" field of a campaign # or in-group (although it can also be used in the "No Agent Call URL" field). @@ -68,6 +68,7 @@ # 210615-1038 - Default security fixes, CVE-2021-28854 # 210616-2046 - Added optional CORS support, see options.php for details # 220219-2253 - Added allow_web_debug system setting +# 260302-1218 - Code updates for PHP8 compatibility # $api_script = 'movelist'; @@ -81,52 +82,70 @@ $filetime = date("H:i:s"); $IP = getenv ("REMOTE_ADDR"); $BR = getenv ("HTTP_USER_AGENT"); -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_AUTH_USER=(array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : ""); +$PHP_AUTH_PW=(array_key_exists('PHP_AUTH_PW', $_SERVER) ? $_SERVER['PHP_AUTH_PW'] : ""); if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id=0;} if (isset($_GET["sale_status"])) {$sale_status=$_GET["sale_status"];} elseif (isset($_POST["sale_status"])) {$sale_status=$_POST["sale_status"];} + else {$sale_status="";} if (isset($_GET["exclude_status"])) {$exclude_status=$_GET["exclude_status"];} elseif (isset($_POST["exclude_status"])) {$exclude_status=$_POST["exclude_status"];} + else {$exclude_status="";} if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} + else {$dispo="";} if (isset($_GET["new_list_id"])) {$new_list_id=$_GET["new_list_id"];} elseif (isset($_POST["new_list_id"])) {$new_list_id=$_POST["new_list_id"];} + else {$new_list_id="";} if (isset($_GET["reset_dialed"])) {$reset_dialed=$_GET["reset_dialed"];} elseif (isset($_POST["reset_dialed"])) {$reset_dialed=$_POST["reset_dialed"];} + else {$reset_dialed="";} if (isset($_GET["talk_time"])) {$talk_time=$_GET["talk_time"];} elseif (isset($_POST["talk_time"])) {$talk_time=$_POST["talk_time"];} + else {$talk_time=0;} if (isset($_GET["talk_time_trigger"])) {$talk_time_trigger=$_GET["talk_time_trigger"];} elseif (isset($_POST["talk_time_trigger"])) {$talk_time_trigger=$_POST["talk_time_trigger"];} + else {$talk_time_trigger=0;} if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} + else {$called_count=0;} if (isset($_GET["called_count_trigger"])) {$called_count_trigger=$_GET["called_count_trigger"];} elseif (isset($_POST["called_count_trigger"])) {$called_count_trigger=$_POST["called_count_trigger"];} + else {$called_count_trigger=0;} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["log_to_file"])) {$log_to_file=$_GET["log_to_file"];} elseif (isset($_POST["log_to_file"])) {$log_to_file=$_POST["log_to_file"];} + else {$log_to_file=0;} if (isset($_GET["populate_sp_old_list"])) {$populate_sp_old_list=$_GET["populate_sp_old_list"];} elseif (isset($_POST["populate_sp_old_list"])) {$populate_sp_old_list=$_POST["populate_sp_old_list"];} + else {$populate_sp_old_list="";} if (isset($_GET["populate_comm_old_date"])) {$populate_comm_old_date=$_GET["populate_comm_old_date"];} elseif (isset($_POST["populate_comm_old_date"])) {$populate_comm_old_date=$_POST["populate_comm_old_date"];} + else {$populate_comm_old_date="";} if (isset($_GET["lead_age"])) {$lead_age=$_GET["lead_age"];} elseif (isset($_POST["lead_age"])) {$lead_age=$_POST["lead_age"];} + else {$lead_age=0;} if (isset($_GET["entry_date"])) {$entry_date=$_GET["entry_date"];} elseif (isset($_POST["entry_date"])) {$entry_date=$_POST["entry_date"];} + else {$entry_date="";} if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} + else {$list_id="";} if (isset($_GET["list_id_trigger"])) {$list_id_trigger=$_GET["list_id_trigger"];} elseif (isset($_POST["list_id_trigger"])) {$list_id_trigger=$_POST["list_id_trigger"];} + else {$list_id_trigger="";} if (isset($_GET["multi_trigger"])) {$multi_trigger=$_GET["multi_trigger"];} elseif (isset($_POST["multi_trigger"])) {$multi_trigger=$_POST["multi_trigger"];} - -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); + else {$multi_trigger="";} #$DB = '1'; # DEBUG override $US = '_'; @@ -169,7 +188,8 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[2]; $SSallow_web_debug = $row[3]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -185,21 +205,26 @@ if ($sl_ct > 0) ##### END SETTINGS LOOKUP ##### ########################################### -$lead_age = preg_replace('/[^_0-9]/', '', $lead_age); -$lead_id = preg_replace('/[^_0-9]/', '', $lead_id); +$lead_age = preg_replace('/[^0-9]/', '', $lead_age); +$lead_id = preg_replace('/[^0-9]/', '', $lead_id); $list_id = preg_replace('/[^_0-9]/', '', $list_id); $new_list_id = preg_replace('/[^_0-9]/', '', $new_list_id); $list_id_trigger = preg_replace('/[^_0-9]/', '', $list_id_trigger); $multi_trigger=preg_replace("/\'|\"|\\\\|;| /","",$multi_trigger); -$log_to_file = preg_replace('/[^-_0-9a-zA-Z]/', '', $log_to_file); -$called_count = preg_replace('/[^-_0-9a-zA-Z]/', '', $called_count); -$called_count_trigger = preg_replace('/[^-_0-9a-zA-Z]/', '', $called_count_trigger); -$talk_time = preg_replace('/[^-_0-9a-zA-Z]/', '', $talk_time); -$talk_time_trigger = preg_replace('/[^-_0-9a-zA-Z]/', '', $talk_time_trigger); -$reset_dialed = preg_replace('/[^-_0-9a-zA-Z]/', '', $reset_dialed); -$entry_date = preg_replace('/[^- \:_0-9a-zA-Z]/', '', $entry_date); -$populate_sp_old_list = preg_replace('/[^-_0-9a-zA-Z]/', '', $populate_sp_old_list); -$populate_comm_old_date = preg_replace('/[^-_0-9a-zA-Z]/', '', $populate_comm_old_date); +$log_to_file = preg_replace('/[^0-9]/', '', $log_to_file); +$called_count = preg_replace('/[^0-9]/', '', $called_count); +$called_count_trigger = preg_replace('/[^0-9]/', '', $called_count_trigger); +$talk_time = preg_replace('/[^0-9]/', '', $talk_time); +$talk_time_trigger = preg_replace('/[^0-9]/', '', $talk_time_trigger); +# $reset_dialed = preg_replace('/[^-_0-9a-zA-Z]/', '', $reset_dialed); +# $entry_date = preg_replace('/[^- \:_0-9a-zA-Z]/', '', $entry_date); +# $populate_sp_old_list = preg_replace('/[^-_0-9a-zA-Z]/', '', $populate_sp_old_list); +# $populate_comm_old_date = preg_replace('/[^-_0-9a-zA-Z]/', '', $populate_comm_old_date); + +if (strlen($lead_age)==0) {$lead_age=0;} +if (strlen($called_count_trigger)==0) {$called_count_trigger=0;} +if (strlen($talk_time)==0) {$talk_time=0;} +if (strlen($talk_time_trigger)==0) {$talk_time_trigger=0;} if ($non_latin < 1) { @@ -208,6 +233,10 @@ if ($non_latin < 1) $exclude_status = preg_replace('/[^-_0-9a-zA-Z]/', '', $exclude_status); $sale_status = preg_replace('/[^-_0-9a-zA-Z]/', '', $sale_status); $dispo = preg_replace('/[^-_0-9a-zA-Z]/', '', $dispo); + $reset_dialed = preg_replace('/[^-_0-9a-zA-Z]/', '', $reset_dialed); + $entry_date = preg_replace('/[^- \:_0-9a-zA-Z]/', '', $entry_date); + $populate_sp_old_list = preg_replace('/[^-_0-9a-zA-Z]/', '', $populate_sp_old_list); + $populate_comm_old_date = preg_replace('/[^-_0-9a-zA-Z]/', '', $populate_comm_old_date); } else { @@ -216,6 +245,10 @@ else $exclude_status = preg_replace('/[^-_0-9\p{L}]/u', '', $exclude_status); $sale_status = preg_replace('/[^-_0-9\p{L}]/u', '', $sale_status); $dispo = preg_replace('/[^-_0-9\p{L}]/u', '', $dispo); + $reset_dialed = preg_replace('/[^-_0-9\p{L}]/u', '', $reset_dialed); + $entry_date = preg_replace('/[^- \:_0-9\p{L}]/u', '', $entry_date); + $populate_sp_old_list = preg_replace('/[^-_0-9\p{L}]/u', '', $populate_sp_old_list); + $populate_comm_old_date = preg_replace('/[^-_0-9\p{L}]/u', '', $populate_comm_old_date); } @@ -317,7 +350,7 @@ else $sale_status=''; $exclude_status=''; $talk_time_trigger=''; - $called_count_trigger=''; + $called_count_trigger=0; $new_list_id=''; $reset_dialed=''; while( ($match_found < 1) and ($k < 99) ) @@ -326,7 +359,7 @@ else $sale_status=''; $exclude_status=''; $talk_time_trigger=''; - $called_count_trigger=''; + $called_count_trigger=0; $lead_age=0; $statusfield = "sale_status_$k"; $excludefield = "exclude_status_$k"; @@ -342,18 +375,24 @@ else elseif (isset($_POST["$counttriggerfield"])) {$called_count_trigger=$_POST["$counttriggerfield"];} if (isset($_GET["$agetriggerfield"])) {$lead_age=$_GET["$agetriggerfield"];} elseif (isset($_POST["$agetriggerfield"])) {$lead_age=$_POST["$agetriggerfield"];} + else {$lead_age=0;} if (isset($_GET["$statusfield"])) {$sale_status=$_GET["$statusfield"];} elseif (isset($_POST["$statusfield"])) {$sale_status=$_POST["$statusfield"];} if (isset($_GET["$listtriggerfield"])) {$list_id_trigger=$_GET["$listtriggerfield"];} elseif (isset($_POST["$listtriggerfield"])) {$list_id_trigger=$_POST["$listtriggerfield"];} + else {$list_id_trigger="";} $sale_status = "$TD$sale_status$TD"; - $lead_age = preg_replace('/[^_0-9]/', '', $lead_age); + $lead_age = preg_replace('/[^0-9]/', '', $lead_age); $list_id_trigger = preg_replace('/[^_0-9]/', '', $list_id_trigger); - $called_count_trigger = preg_replace('/[^-_0-9a-zA-Z]/', '', $called_count_trigger); - $talk_time_trigger = preg_replace('/[^-_0-9a-zA-Z]/', '', $talk_time_trigger); + $called_count_trigger = preg_replace('/[^0-9]/', '', $called_count_trigger); + $talk_time_trigger = preg_replace('/[^0-9]/', '', $talk_time_trigger); $sale_status = preg_replace('/[^-_0-9\p{L}]/u', '', $sale_status); $exclude_status = preg_replace('/[^-_0-9\p{L}]/u', '', $exclude_status); + if (strlen($lead_age)==0) {$lead_age=0;} + if (strlen($called_count_trigger)==0) {$called_count_trigger=0;} + if (strlen($talk_time_trigger)==0) {$talk_time_trigger=0;} + if ($lead_age > 0) { if (strlen($entry_date) < 10) @@ -392,6 +431,7 @@ else elseif (isset($_POST["$newlistfield"])) {$new_list_id=$_POST["$newlistfield"];} if (isset($_GET["$resetfield"])) {$reset_dialed=$_GET["$resetfield"];} elseif (isset($_POST["$resetfield"])) {$reset_dialed=$_POST["$resetfield"];} + else {$reset_dialed="";} $new_list_id = preg_replace('/[^_0-9]/', '', $new_list_id); $reset_dialed = preg_replace('/[^-_0-9a-zA-Z]/', '', $reset_dialed); @@ -460,7 +500,7 @@ if ($match_found > 0) exit; } - if ( (strlen($lead_id) > 0) and (strlen($new_list_id) > 2) ) + if ( ($lead_id > 0) and (strlen($new_list_id) > 2) ) { $search_count=0; $stmt = "SELECT count(*) FROM vicidial_list where lead_id='$lead_id' and list_id!='$new_list_id';"; diff --git a/agc_2-X/trunk/www/agc/dispo_move_list_SC.php b/agc_2-X/trunk/www/agc/dispo_move_list_SC.php index 40209a00..523bf551 100644 --- a/agc_2-X/trunk/www/agc/dispo_move_list_SC.php +++ b/agc_2-X/trunk/www/agc/dispo_move_list_SC.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed to be used in the "Dispo URL" field of a campaign # or in-group (although it can also be used in the "No Agent Call URL" field). @@ -48,6 +48,7 @@ # # CHANGES # 250701-1357 - First Build +# 260303-0716 - Code updates for PHP8 compatibility # $api_script = 'mvlistSC'; @@ -61,26 +62,35 @@ $filetime = date("H:i:s"); $IP = getenv ("REMOTE_ADDR"); $BR = getenv ("HTTP_USER_AGENT"); -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_AUTH_USER=(array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : ""); +$PHP_AUTH_PW=(array_key_exists('PHP_AUTH_PW', $_SERVER) ? $_SERVER['PHP_AUTH_PW'] : ""); if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id="";} if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} + else {$list_id="";} if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} + else {$dispo="";} if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} + else {$called_count="";} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["container_id"])) {$container_id=$_GET["container_id"];} elseif (isset($_POST["container_id"])) {$container_id=$_POST["container_id"];} + else {$container_id="";} if (isset($_GET["log_to_file"])) {$log_to_file=$_GET["log_to_file"];} elseif (isset($_POST["log_to_file"])) {$log_to_file=$_POST["log_to_file"];} + else {$log_to_file=0;} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} +/* if (isset($_GET["talk_time"])) {$talk_time=$_GET["talk_time"];} elseif (isset($_POST["talk_time"])) {$talk_time=$_POST["talk_time"];} if (isset($_GET["entry_date"])) {$entry_date=$_GET["entry_date"];} @@ -89,16 +99,15 @@ if (isset($_GET["populate_sp_old_list"])) {$populate_sp_old_list=$_GET["popula elseif (isset($_POST["populate_sp_old_list"])) {$populate_sp_old_list=$_POST["populate_sp_old_list"];} if (isset($_GET["populate_comm_old_date"])) {$populate_comm_old_date=$_GET["populate_comm_old_date"];} elseif (isset($_POST["populate_comm_old_date"])) {$populate_comm_old_date=$_POST["populate_comm_old_date"];} - -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); +*/ #$DB = '1'; # DEBUG override $US = '_'; $TD = '---'; $STARTtime = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); -$original_sale_status = $sale_status; -$sale_status = "$TD$sale_status$TD"; +# $original_sale_status = $sale_status; +# $sale_status = "$TD$sale_status$TD"; $search_value=''; $match_found=0; $primary_match_found=0; @@ -133,7 +142,8 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[2]; $SSallow_web_debug = $row[3]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -151,12 +161,14 @@ if ($sl_ct > 0) $lead_id = preg_replace('/[^_0-9]/', '', $lead_id); $list_id = preg_replace('/[^_0-9]/', '', $list_id); -$log_to_file = preg_replace('/[^-_0-9a-zA-Z]/', '', $log_to_file); -$called_count = preg_replace('/[^-_0-9a-zA-Z]/', '', $called_count); +$log_to_file = preg_replace('/[^0-9]/', '', $log_to_file); +$called_count = preg_replace('/[^0-9]/', '', $called_count); +/* $talk_time = preg_replace('/[^-_0-9a-zA-Z]/', '', $talk_time); -$entry_date = preg_replace('/[^- \:_0-9a-zA-Z]/', '', $entry_date); +$entry_date = preg_replace('/[^-_0-9a-zA-Z]/', '', $entry_date); $populate_sp_old_list = preg_replace('/[^-_0-9a-zA-Z]/', '', $populate_sp_old_list); $populate_comm_old_date = preg_replace('/[^-_0-9a-zA-Z]/', '', $populate_comm_old_date); +*/ if ($non_latin < 1) { @@ -270,7 +282,7 @@ $sea=0; $DMLrecords=0; $lead_moved=0; $search_count=0; -while ($DMLsettings_ct >= $sea) +while ($DMLsettings_ct > $sea) { if (strlen($DMLsettings[$sea]) > 7) { diff --git a/agc_2-X/trunk/www/agc/dispo_reset_lead.php b/agc_2-X/trunk/www/agc/dispo_reset_lead.php index 237f2420..72675de3 100644 --- a/agc_2-X/trunk/www/agc/dispo_reset_lead.php +++ b/agc_2-X/trunk/www/agc/dispo_reset_lead.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed to be used in the "Dispo URL" field of a campaign # or in-group (although it can also be used in the "No Agent Call URL" field). @@ -35,6 +35,7 @@ # # CHANGES # 230204-0812 - First Build +# 260302-1217 - Code updates for PHP8 compatibility # $api_script = 'resetlead'; @@ -48,30 +49,38 @@ $filetime = date("H:i:s"); $IP = getenv ("REMOTE_ADDR"); $BR = getenv ("HTTP_USER_AGENT"); -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_AUTH_USER=(array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : ""); +$PHP_AUTH_PW=(array_key_exists('PHP_AUTH_PW', $_SERVER) ? $_SERVER['PHP_AUTH_PW'] : ""); if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id=0;} if (isset($_GET["sale_status"])) {$sale_status=$_GET["sale_status"];} elseif (isset($_POST["sale_status"])) {$sale_status=$_POST["sale_status"];} + else {$sale_status="";} if (isset($_GET["exclude_status"])) {$exclude_status=$_GET["exclude_status"];} elseif (isset($_POST["exclude_status"])) {$exclude_status=$_POST["exclude_status"];} + else {$exclude_status="";} if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} + else {$dispo="";} if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} + else {$called_count=0;} if (isset($_GET["called_count_trigger"])) {$called_count_trigger=$_GET["called_count_trigger"];} elseif (isset($_POST["called_count_trigger"])) {$called_count_trigger=$_POST["called_count_trigger"];} + else {$called_count_trigger=0;} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["log_to_file"])) {$log_to_file=$_GET["log_to_file"];} elseif (isset($_POST["log_to_file"])) {$log_to_file=$_POST["log_to_file"];} + else {$log_to_file=0;} -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); #$DB = '1'; # DEBUG override $US = '_'; @@ -113,7 +122,8 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[2]; $SSallow_web_debug = $row[3]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -129,9 +139,9 @@ if ($sl_ct > 0) ########################################### $lead_id = preg_replace('/[^_0-9]/', '', $lead_id); -$log_to_file = preg_replace('/[^-_0-9a-zA-Z]/', '', $log_to_file); -$called_count = preg_replace('/[^-_0-9a-zA-Z]/', '', $called_count); -$called_count_trigger = preg_replace('/[^-_0-9a-zA-Z]/', '', $called_count_trigger); +$log_to_file = preg_replace('/[^0-9]/', '', $log_to_file); +$called_count = preg_replace('/[^0-9]/', '', $called_count); +$called_count_trigger = preg_replace('/[^-0-9]/', '', $called_count_trigger); if ($non_latin < 1) { diff --git a/agc_2-X/trunk/www/agc/dispo_send_email.php b/agc_2-X/trunk/www/agc/dispo_send_email.php index 20855630..e65a3b90 100644 --- a/agc_2-X/trunk/www/agc/dispo_send_email.php +++ b/agc_2-X/trunk/www/agc/dispo_send_email.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed to be used in the "Dispo URL" field of a campaign # or in-group. It will send out an email to a fixed email address as defined @@ -52,6 +52,7 @@ # 230113-0839 - Added dialed_number & dialed_label to allowed variables in email subject and body # 230420-1620 - Added email_display_name as a container option for the email sender # 230518-1035 - Added in-group and campaign custom fields 1-5, for script/webform/dispo-call-url use +# 260302-1214 - Code updates for PHP8 compatibility # $api_script = 'send_email'; @@ -65,96 +66,136 @@ $filetime = date("H:i:s"); $IP = getenv ("REMOTE_ADDR"); $BR = getenv ("HTTP_USER_AGENT"); -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_AUTH_USER=(array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : ""); +$PHP_AUTH_PW=(array_key_exists('PHP_AUTH_PW', $_SERVER) ? $_SERVER['PHP_AUTH_PW'] : ""); if (isset($_GET["call_id"])) {$call_id=$_GET["call_id"];} elseif (isset($_POST["call_id"])) {$call_id=$_POST["call_id"];} + else {$call_id="";} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id="";} if (isset($_GET["sale_status"])) {$sale_status=$_GET["sale_status"];} elseif (isset($_POST["sale_status"])) {$sale_status=$_POST["sale_status"];} + else {$sale_status="";} if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} + else {$dispo="";} if (isset($_GET["container_id"])) {$container_id=$_GET["container_id"];} elseif (isset($_POST["container_id"])) {$container_id=$_POST["container_id"];} + else {$container_id="";} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} + else {$stage="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} + else {$call_notes="";} if (isset($_GET["additional_notes"])) {$additional_notes=$_GET["additional_notes"];} elseif (isset($_POST["additional_notes"])) {$additional_notes=$_POST["additional_notes"];} + else {$additional_notes="";} if (isset($_GET["log_to_file"])) {$log_to_file=$_GET["log_to_file"];} elseif (isset($_POST["log_to_file"])) {$log_to_file=$_POST["log_to_file"];} + else {$log_to_file=0;} if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} + else {$called_count=0;} if (isset($_GET["called_count_trigger"])) {$called_count_trigger=$_GET["called_count_trigger"];} elseif (isset($_POST["called_count_trigger"])) {$called_count_trigger=$_POST["called_count_trigger"];} + else {$called_count_trigger=0;} if (isset($_GET["email_to"])) {$email_to=$_GET["email_to"];} elseif (isset($_POST["email_to"])) {$email_to=$_POST["email_to"];} + else {$email_to="";} if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} + else {$channel_group="";} if (isset($_GET["email_attachment_1"])) {$email_attachment_1=$_GET["email_attachment_1"];} elseif (isset($_POST["email_attachment_1"])) {$email_attachment_1=$_POST["email_attachment_1"];} + else {$email_attachment_1="";} if (isset($_GET["email_attachment_2"])) {$email_attachment_2=$_GET["email_attachment_2"];} elseif (isset($_POST["email_attachment_2"])) {$email_attachment_2=$_POST["email_attachment_2"];} + else {$email_attachment_2="";} if (isset($_GET["email_attachment_3"])) {$email_attachment_3=$_GET["email_attachment_3"];} elseif (isset($_POST["email_attachment_3"])) {$email_attachment_3=$_POST["email_attachment_3"];} + else {$email_attachment_3="";} if (isset($_GET["email_attachment_4"])) {$email_attachment_4=$_GET["email_attachment_4"];} elseif (isset($_POST["email_attachment_4"])) {$email_attachment_4=$_POST["email_attachment_4"];} + else {$email_attachment_4="";} if (isset($_GET["email_attachment_5"])) {$email_attachment_5=$_GET["email_attachment_5"];} elseif (isset($_POST["email_attachment_5"])) {$email_attachment_5=$_POST["email_attachment_5"];} + else {$email_attachment_5="";} if (isset($_GET["email_attachment_6"])) {$email_attachment_6=$_GET["email_attachment_6"];} elseif (isset($_POST["email_attachment_6"])) {$email_attachment_6=$_POST["email_attachment_6"];} + else {$email_attachment_6="";} if (isset($_GET["email_attachment_7"])) {$email_attachment_7=$_GET["email_attachment_7"];} elseif (isset($_POST["email_attachment_7"])) {$email_attachment_7=$_POST["email_attachment_7"];} + else {$email_attachment_7="";} if (isset($_GET["email_attachment_8"])) {$email_attachment_8=$_GET["email_attachment_8"];} elseif (isset($_POST["email_attachment_8"])) {$email_attachment_8=$_POST["email_attachment_8"];} + else {$email_attachment_8="";} if (isset($_GET["email_attachment_9"])) {$email_attachment_9=$_GET["email_attachment_9"];} elseif (isset($_POST["email_attachment_9"])) {$email_attachment_9=$_POST["email_attachment_9"];} + else {$email_attachment_9="";} if (isset($_GET["email_attachment_10"])) {$email_attachment_10=$_GET["email_attachment_10"];} elseif (isset($_POST["email_attachment_10"])) {$email_attachment_10=$_POST["email_attachment_10"];} + else {$email_attachment_10="";} if (isset($_GET["email_attachment_11"])) {$email_attachment_11=$_GET["email_attachment_11"];} elseif (isset($_POST["email_attachment_11"])) {$email_attachment_11=$_POST["email_attachment_11"];} + else {$email_attachment_11="";} if (isset($_GET["email_attachment_12"])) {$email_attachment_12=$_GET["email_attachment_12"];} elseif (isset($_POST["email_attachment_12"])) {$email_attachment_12=$_POST["email_attachment_12"];} + else {$email_attachment_12="";} if (isset($_GET["email_attachment_13"])) {$email_attachment_13=$_GET["email_attachment_13"];} elseif (isset($_POST["email_attachment_13"])) {$email_attachment_13=$_POST["email_attachment_13"];} + else {$email_attachment_13="";} if (isset($_GET["email_attachment_14"])) {$email_attachment_14=$_GET["email_attachment_14"];} elseif (isset($_POST["email_attachment_14"])) {$email_attachment_14=$_POST["email_attachment_14"];} + else {$email_attachment_14="";} if (isset($_GET["email_attachment_15"])) {$email_attachment_15=$_GET["email_attachment_15"];} elseif (isset($_POST["email_attachment_15"])) {$email_attachment_15=$_POST["email_attachment_15"];} + else {$email_attachment_15="";} if (isset($_GET["email_attachment_16"])) {$email_attachment_16=$_GET["email_attachment_16"];} elseif (isset($_POST["email_attachment_16"])) {$email_attachment_16=$_POST["email_attachment_16"];} + else {$email_attachment_16="";} if (isset($_GET["email_attachment_17"])) {$email_attachment_17=$_GET["email_attachment_17"];} elseif (isset($_POST["email_attachment_17"])) {$email_attachment_17=$_POST["email_attachment_17"];} + else {$email_attachment_17="";} if (isset($_GET["email_attachment_18"])) {$email_attachment_18=$_GET["email_attachment_18"];} elseif (isset($_POST["email_attachment_18"])) {$email_attachment_18=$_POST["email_attachment_18"];} + else {$email_attachment_18="";} if (isset($_GET["email_attachment_19"])) {$email_attachment_19=$_GET["email_attachment_19"];} elseif (isset($_POST["email_attachment_19"])) {$email_attachment_19=$_POST["email_attachment_19"];} + else {$email_attachment_19="";} if (isset($_GET["email_attachment_20"])) {$email_attachment_20=$_GET["email_attachment_20"];} elseif (isset($_POST["email_attachment_20"])) {$email_attachment_20=$_POST["email_attachment_20"];} + else {$email_attachment_20="";} if (isset($_GET["dialed_number"])) {$dialed_number=$_GET["dialed_number"];} elseif (isset($_POST["dialed_number"])) {$dialed_number=$_POST["dialed_number"];} + else {$dialed_number="";} if (isset($_GET["dialed_label"])) {$dialed_label=$_GET["dialed_label"];} elseif (isset($_POST["dialed_label"])) {$dialed_label=$_POST["dialed_label"];} + else {$dialed_label="";} if (isset($_GET["camp_custom_one"])) {$camp_custom_one=$_GET["camp_custom_one"];} elseif (isset($_POST["camp_custom_one"])) {$camp_custom_one=$_POST["camp_custom_one"];} + else {$camp_custom_one="";} if (isset($_GET["camp_custom_two"])) {$camp_custom_two=$_GET["camp_custom_two"];} elseif (isset($_POST["camp_custom_two"])) {$camp_custom_two=$_POST["camp_custom_two"];} + else {$camp_custom_two="";} if (isset($_GET["camp_custom_three"])) {$camp_custom_three=$_GET["camp_custom_three"];} elseif (isset($_POST["camp_custom_three"])) {$camp_custom_three=$_POST["camp_custom_three"];} + else {$camp_custom_three="";} if (isset($_GET["camp_custom_four"])) {$camp_custom_four=$_GET["camp_custom_four"];} elseif (isset($_POST["camp_custom_four"])) {$camp_custom_four=$_POST["camp_custom_four"];} + else {$camp_custom_four="";} if (isset($_GET["camp_custom_five"])) {$camp_custom_five=$_GET["camp_custom_five"];} elseif (isset($_POST["camp_custom_five"])) {$camp_custom_five=$_POST["camp_custom_five"];} - -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); + else {$camp_custom_five="";} #$DB = '1'; # DEBUG override $US = '_'; @@ -175,6 +216,7 @@ $email_attachment_path_legacy = '.'; $email_header_attach='0'; $sendmail_bypass=0; $allow_sendmail_bypass=''; +$epoch=date("U"); # filter variables $user=preg_replace("/\'|\"|\\\\|;| |\|/","",$user); @@ -207,7 +249,8 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[2]; $SSallow_web_debug = $row[3]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -223,10 +266,10 @@ if ($sl_ct > 0) ##### END SETTINGS LOOKUP ##### ########################################### -$call_id = preg_replace('/[^-_0-9a-zA-Z]/', '', $call_id); -$lead_id = preg_replace('/[^_0-9a-zA-Z]/', '', $lead_id); +# $call_id = preg_replace('/[^-_0-9a-zA-Z]/', '', $call_id); +# $lead_id = preg_replace('/[^_0-9a-zA-Z]/', '', $lead_id); $call_notes=preg_replace("/\\\\/","",$call_notes); -$stage = preg_replace('/[^-_0-9a-zA-Z]/', '', $stage); +# $stage = preg_replace('/[^-_0-9a-zA-Z]/', '', $stage); $additional_notes=preg_replace("/\\\\/","",$additional_notes); $email_attachment_1=preg_replace("/\\\\|^\/|\.+\/|;/","",$email_attachment_1); @@ -271,12 +314,12 @@ $email_attachment_18=preg_replace("/etc\//","",$email_attachment_18); $email_attachment_19=preg_replace("/etc\//","",$email_attachment_19); $email_attachment_20=preg_replace("/etc\//","",$email_attachment_20); -$email_to = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$email_to); -$log_to_file = preg_replace('/[^-_0-9a-zA-Z]/', '', $log_to_file); -$called_count = preg_replace('/[^-_0-9a-zA-Z]/', '', $called_count); -$called_count_trigger = preg_replace('/[^-_0-9a-zA-Z]/', '', $called_count_trigger); -$dialed_number = preg_replace('/[^-_0-9a-zA-Z]/', '', $dialed_number); -$dialed_label = preg_replace('/[^-_0-9a-zA-Z]/', '', $dialed_label); +# $email_to = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$email_to); +$log_to_file = preg_replace('/[^0-9]/', '', $log_to_file); +# $called_count = preg_replace('/[^-_0-9a-zA-Z]/', '', $called_count); +$called_count_trigger = preg_replace('/[^-0-9]/', '', $called_count_trigger); +# $dialed_number = preg_replace('/[^-_0-9a-zA-Z]/', '', $dialed_number); +# $dialed_label = preg_replace('/[^-_0-9a-zA-Z]/', '', $dialed_label); if ($non_latin < 1) { @@ -291,6 +334,13 @@ if ($non_latin < 1) $camp_custom_three = preg_replace('/[^- \.\:\/\@\_0-9a-zA-Z]/','-',$camp_custom_three); $camp_custom_four = preg_replace('/[^- \.\:\/\@\_0-9a-zA-Z]/','-',$camp_custom_four); $camp_custom_five = preg_replace('/[^- \.\:\/\@\_0-9a-zA-Z]/','-',$camp_custom_five ); + $call_id = preg_replace('/[^-_0-9a-zA-Z]/', '', $call_id); + $lead_id = preg_replace('/[^_0-9a-zA-Z]/', '', $lead_id); + $stage = preg_replace('/[^-_0-9a-zA-Z]/', '', $stage); + $email_to = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$email_to); + $called_count = preg_replace('/[^-_0-9a-zA-Z]/', '', $called_count); + $dialed_number = preg_replace('/[^-_0-9a-zA-Z]/', '', $dialed_number); + $dialed_label = preg_replace('/[^-_0-9a-zA-Z]/', '', $dialed_label); } else { @@ -305,6 +355,13 @@ else $camp_custom_three = preg_replace('/[^- \.\:\/\@\_0-9\p{L}]/u','-',$camp_custom_three); $camp_custom_four = preg_replace('/[^- \.\:\/\@\_0-9\p{L}]/u','-',$camp_custom_four); $camp_custom_five = preg_replace('/[^- \.\:\/\@\_0-9\p{L}]/u','-',$camp_custom_five ); + $call_id = preg_replace('/[^-_0-9\p{L}]/u', '', $call_id); + $lead_id = preg_replace('/[^_0-9\p{L}]/u', '', $lead_id); + $stage = preg_replace('/[^-_0-9\p{L}]/u', '', $stage); + $email_to = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$email_to); + $called_count = preg_replace('/[^-_0-9\p{L}]/u', '', $called_count); + $dialed_number = preg_replace('/[^-_0-9\p{L}]/u', '', $dialed_number); + $dialed_label = preg_replace('/[^-_0-9\p{L}]/u', '', $dialed_label); } @@ -396,6 +453,7 @@ if ($match_found > 0) $authlive=$row[0]; } } + if (!isset($authlive)) {$authlive=0;} if ( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) or ($authlive==0)) { @@ -430,9 +488,16 @@ if ($match_found > 0) $container_entry = $row[0]; $container_ARY = explode("\n",$container_entry); $email_body_gather=0; + $email_from=""; + $email_display_name=""; + $email_subject=""; + $email_format=""; + $email_charset=""; + $email_body=""; + $sendmail_bypass=0; $p=0; $container_ct = count($container_ARY); - while ($p <= $container_ct) + while ($p < $container_ct) { $line = $container_ARY[$p]; if ($email_body_gather < 1) @@ -470,6 +535,7 @@ if ($match_found > 0) if ( (strlen($email_to) > 5) and (strlen($email_from) > 5) and (strlen($email_subject) > 1) and (strlen($email_body) > 1) ) { + $affected_rows=''; if ( (preg_match('/--A--/i',$email_subject)) or (preg_match('/--A--/i',$email_body)) or (preg_match('/--A--/i',$email_to)) or (preg_match('/--A--/i',$email_from)) or (preg_match('/--A--/i',$email_display_name)) ) { ##### grab the data from vicidial_list for the lead_id @@ -514,7 +580,44 @@ if ($match_found > 0) $owner = urlencode(trim($row[33])); $entry_list_id = urlencode(trim($row[34])); } + else + { + $entry_date = ''; + $dispo = ''; + $tsr = ''; + $vendor_id = ''; + $vendor_lead_code = ''; + $source_id = ''; + $list_id = ''; + $gmt_offset_now = ''; + $phone_code = ''; + $phone_number = ''; + $title = ''; + $first_name = ''; + $middle_initial = ''; + $last_name = ''; + $address1 = ''; + $address2 = ''; + $address3 = ''; + $city = ''; + $state = ''; + $province = ''; + $postal_code = ''; + $country_code = ''; + $gender = ''; + $date_of_birth = ''; + $alt_phone = ''; + $email = ''; + $security_phrase = ''; + $comments = ''; + $called_count = ''; + $rank = ''; + $owner = ''; + $entry_list_id = ''; + } + $list_name=''; + $list_description=''; if ( (preg_match('/list_name--B--|list_description--B--/i',$email_subject)) or (preg_match('/list_name--B--|list_description--B--/i',$email_body)) ) { $stmt = "SELECT list_name,list_description from vicidial_lists where list_id='$list_id' limit 1;"; @@ -530,9 +633,9 @@ if ($match_found > 0) } } + $uniqueid=''; if ( (preg_match('/--A--did_|--A--uniqueid/i',$email_subject)) or (preg_match('/--A--did_|--A--uniqueid/i',$email_body)) ) { - $uniqueid=''; $stmt = "SELECT uniqueid from vicidial_log_extended where caller_code='$call_id' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -546,19 +649,18 @@ if ($match_found > 0) } } + $DID_id=''; + $DID_extension=''; + $DID_pattern=''; + $DID_description=''; + $DID_carrier_description=''; + $DID_custom_one=''; + $DID_custom_two=''; + $DID_custom_three=''; + $DID_custom_four=''; + $DID_custom_five=''; if ( (preg_match('/--A--did_/i',$email_subject)) or (preg_match('/--A--did_/i',$email_body)) ) { - $DID_id=''; - $DID_extension=''; - $DID_pattern=''; - $DID_description=''; - $DID_carrier_description=''; - $DID_custom_one=''; - $DID_custom_two=''; - $DID_custom_three=''; - $DID_custom_four=''; - $DID_custom_five=''; - $stmt = "SELECT did_id,extension from vicidial_did_log where uniqueid='$uniqueid' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); @@ -590,6 +692,7 @@ if ($match_found > 0) } } + $campaign=''; if ( (preg_match('/--A--camp_custom_|--A--campaign/i',$email_subject)) or (preg_match('/--A--camp_custom_|--A--campaign/i',$email_body)) or (preg_match('/--A--camp_custom_/i',$email_from)) or (preg_match('/--A--camp_custom_/i',$email_to)) or (preg_match('/--A--camp_custom_/i',$email_display_name)) ) { $camp_custom_one=''; @@ -640,14 +743,14 @@ if ($match_found > 0) } } + $ig_custom_one=''; + $ig_custom_two=''; + $ig_custom_three=''; + $ig_custom_four=''; + $ig_custom_five=''; + $temp_group_id=''; if ( (preg_match('/--A--ig_custom_|--A--group_id/i',$email_subject)) or (preg_match('/--A--ig_custom_|--A--group_id/i',$email_body)) or (preg_match('/--A--ig_custom_/i',$email_from)) or (preg_match('/--A--ig_custom_/i',$email_to)) or (preg_match('/--A--ig_custom_/i',$email_display_name)) ) { - $ig_custom_one=''; - $ig_custom_two=''; - $ig_custom_three=''; - $ig_custom_four=''; - $ig_custom_five=''; - $stmt = "SELECT campaign_id from vicidial_closer_log where uniqueid='$uniqueid' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); @@ -769,10 +872,10 @@ if ($match_found > 0) $email_subject = preg_replace('/--A--security_phrase--B--/i',"$security_phrase",$email_subject); $email_subject = preg_replace('/--A--comments--B--/i',"$comments",$email_subject); $email_subject = preg_replace('/--A--user--B--/i',"$user",$email_subject); - $email_subject = preg_replace('/--A--pass--B--/i',"$orig_pass",$email_subject); - $email_subject = preg_replace('/--A--original_phone_login--B--/i',"$original_phone_login",$email_subject); - $email_subject = preg_replace('/--A--phone_pass--B--/i',"$phone_pass",$email_subject); - $email_subject = preg_replace('/--A--fronter--B--/i',"$fronter",$email_subject); + # $email_subject = preg_replace('/--A--pass--B--/i',"$orig_pass",$email_subject); + # $email_subject = preg_replace('/--A--original_phone_login--B--/i',"$original_phone_login",$email_subject); + # $email_subject = preg_replace('/--A--phone_pass--B--/i',"$phone_pass",$email_subject); + # $email_subject = preg_replace('/--A--fronter--B--/i',"$fronter",$email_subject); $email_subject = preg_replace('/--A--closer--B--/i',"$user",$email_subject); $email_subject = preg_replace('/--A--SQLdate--B--/i',"$NOW_TIME",$email_subject); $email_subject = preg_replace('/--A--epoch--B--/i',"$epoch",$email_subject); @@ -820,26 +923,27 @@ if ($match_found > 0) $email_subject = preg_replace('/--A--group_id--B--/i',"$temp_group_id",$email_subject); # not currently active - $email_subject = preg_replace('/--A--phone_login--B--/i',"$phone_login",$email_subject); - $email_subject = preg_replace('/--A--customer_zap_channel--B--/i',"$customer_zap_channel",$email_subject); - $email_subject = preg_replace('/--A--customer_server_ip--B--/i',"$customer_server_ip",$email_subject); + # Commented out starting with PHP8 due to warnings + # $email_subject = preg_replace('/--A--phone_login--B--/i',"$phone_login",$email_subject); + # $email_subject = preg_replace('/--A--customer_zap_channel--B--/i',"$customer_zap_channel",$email_subject); + # $email_subject = preg_replace('/--A--customer_server_ip--B--/i',"$customer_server_ip",$email_subject); $email_subject = preg_replace('/--A--server_ip--B--/i',"$server_ip",$email_subject); - $email_subject = preg_replace('/--A--SIPexten--B--/i',"$SIPexten",$email_subject); - $email_subject = preg_replace('/--A--session_id--B--/i',"$session_id",$email_subject); - $email_subject = preg_replace('/--A--phone--B--/i',"$phone",$email_subject); - $email_subject = preg_replace('/--A--parked_by--B--/i',"$parked_by",$email_subject); - $email_subject = preg_replace('/--A--camp_script--B--/i',"$camp_script",$email_subject); - $email_subject = preg_replace('/--A--in_script--B--/i',"$in_script",$email_subject); - $email_subject = preg_replace('/--A--dispo--B--/i',"$dispo",$email_subject); - $email_subject = preg_replace('/--A--dispo_name--B--/i',"$dispo_name",$email_subject); - $email_subject = preg_replace('/--A--talk_time--B--/i',"$talk_time",$email_subject); - $email_subject = preg_replace('/--A--talk_time_ms--B--/i',"$talk_time_ms",$email_subject); - $email_subject = preg_replace('/--A--talk_time_min--B--/i',"$talk_time_min",$email_subject); - $email_subject = preg_replace('/--A--agent_log_id--B--/i',"$CALL_agent_log_id",$email_subject); - $email_subject = preg_replace('/--A--closecallid--B--/i',urlencode(trim($INclosecallid)),$email_subject); - $email_subject = preg_replace('/--A--xfercallid--B--/i',urlencode(trim($INxfercallid)),$email_subject); - $email_subject = preg_replace('/--A--recording_id--B--/i',"$recording_id",$email_subject); - $email_subject = preg_replace('/--A--recording_filename--B--/i',"$recording_filename",$email_subject); + # $email_subject = preg_replace('/--A--SIPexten--B--/i',"$SIPexten",$email_subject); + # $email_subject = preg_replace('/--A--session_id--B--/i',"$session_id",$email_subject); + # $email_subject = preg_replace('/--A--phone--B--/i',"$phone",$email_subject); + # $email_subject = preg_replace('/--A--parked_by--B--/i',"$parked_by",$email_subject); + # $email_subject = preg_replace('/--A--camp_script--B--/i',"$camp_script",$email_subject); + # $email_subject = preg_replace('/--A--in_script--B--/i',"$in_script",$email_subject); + # $email_subject = preg_replace('/--A--dispo--B--/i',"$dispo",$email_subject); + # $email_subject = preg_replace('/--A--dispo_name--B--/i',"$dispo_name",$email_subject); + # $email_subject = preg_replace('/--A--talk_time--B--/i',"$talk_time",$email_subject); + # $email_subject = preg_replace('/--A--talk_time_ms--B--/i',"$talk_time_ms",$email_subject); + # $email_subject = preg_replace('/--A--talk_time_min--B--/i',"$talk_time_min",$email_subject); + # $email_subject = preg_replace('/--A--agent_log_id--B--/i',"$CALL_agent_log_id",$email_subject); + # $email_subject = preg_replace('/--A--closecallid--B--/i',urlencode(trim($INclosecallid)),$email_subject); + # $email_subject = preg_replace('/--A--xfercallid--B--/i',urlencode(trim($INxfercallid)),$email_subject); + # $email_subject = preg_replace('/--A--recording_id--B--/i',"$recording_id",$email_subject); + # $email_subject = preg_replace('/--A--recording_filename--B--/i',"$recording_filename",$email_subject); $email_subject = urldecode($email_subject); } @@ -849,7 +953,8 @@ if ($match_found > 0) $email_body = preg_replace('/^VAR|--A--CF_uses_custom_fields--B--/','',$email_body); $email_body = preg_replace('/--A--lead_id--B--/i',"$lead_id",$email_body); $email_body = preg_replace('/--A--dispo--B--/i',"$dispo",$email_body); - $email_body = preg_replace('/--A--dispo_name--B--/i',"$dispo_name",$email_body); + # Commented out starting with PHP8 due to warnings + # $email_body = preg_replace('/--A--dispo_name--B--/i',"$dispo_name",$email_body); $email_body = preg_replace('/--A--vendor_id--B--/i',"$vendor_id",$email_body); $email_body = preg_replace('/--A--vendor_lead_code--B--/i',"$vendor_lead_code",$email_body); $email_body = preg_replace('/--A--list_id--B--/i',"$list_id",$email_body); @@ -877,10 +982,10 @@ if ($match_found > 0) $email_body = preg_replace('/--A--security_phrase--B--/i',"$security_phrase",$email_body); $email_body = preg_replace('/--A--comments--B--/i',"$comments",$email_body); $email_body = preg_replace('/--A--user--B--/i',"$user",$email_body); - $email_body = preg_replace('/--A--pass--B--/i',"$orig_pass",$email_body); - $email_body = preg_replace('/--A--original_phone_login--B--/i',"$original_phone_login",$email_body); - $email_body = preg_replace('/--A--phone_pass--B--/i',"$phone_pass",$email_body); - $email_body = preg_replace('/--A--fronter--B--/i',"$fronter",$email_body); + # $email_body = preg_replace('/--A--pass--B--/i',"$orig_pass",$email_body); + # $email_body = preg_replace('/--A--original_phone_login--B--/i',"$original_phone_login",$email_body); + # $email_body = preg_replace('/--A--phone_pass--B--/i',"$phone_pass",$email_body); + # $email_body = preg_replace('/--A--fronter--B--/i',"$fronter",$email_body); $email_body = preg_replace('/--A--closer--B--/i',"$user",$email_body); $email_body = preg_replace('/--A--SQLdate--B--/i',"$NOW_TIME",$email_body); $email_body = preg_replace('/--A--epoch--B--/i',"$epoch",$email_body); @@ -1905,15 +2010,17 @@ if ($match_found > 0) $result = passthru("/usr/bin/cat /tmp/$temp_mail_file | $allow_sendmail_bypass -t -i"); echo "Sent |$result|"; + $affected_rows='$result'; # echo "Sent |$result| /usr/bin/cat /tmp/$temp_mail_file | $allow_sendmail_bypass -t -i"; } else { if (mail($email_to, $email_subject, $email_body, $header)) - {echo "Sent";} + {echo "Sent"; $affected_rows='Sent';} else { echo "Error"; + $affected_rows='Error'; if ($DB) { echo "\n"; @@ -1948,7 +2055,7 @@ if ($match_found > 0) mail("$email_to","$email_subject","$email_body", $header, "-f $email_from"); } - $SQL_log = "$stmt|$stmtB|$CBaffected_rows|$email_from|$email_to|$email_subject|"; + $SQL_log = "$stmt|$email_from|$email_to|$email_subject|"; # $stmtB|$CBaffected_rows removed 3/14/25 - never declared $SQL_log = preg_replace('/;/','',$SQL_log); $SQL_log = addslashes($SQL_log); $stmt="INSERT INTO vicidial_api_log set user='$user',agent_user='$user',function='dispo_send_email',value='$call_id',result='$affected_rows',result_reason='$container_id $attach_messages',source='vdc',data='$SQL_log',api_date='$NOW_TIME',api_script='$api_script';"; diff --git a/agc_2-X/trunk/www/agc/functions.php b/agc_2-X/trunk/www/agc/functions.php index 3d210e59..ba231613 100644 --- a/agc_2-X/trunk/www/agc/functions.php +++ b/agc_2-X/trunk/www/agc/functions.php @@ -4,7 +4,7 @@ # # functions for agent scripts # -# Copyright (C) 2023 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # # CHANGES: @@ -59,15 +59,32 @@ # 220921-1204 - Added more failed login logging in user_authorization function # 230518-1111 - Added in-group and campaign custom fields 1-5, for script/webform/dispo-call-url use # 251205-1742 - Fix for undefined variable issue +# 260203-1600 - Code updates for PHP8 compatibility # -if (!isset($mel)) {$mel=0;} # $mysql_queries = 28 -##### BEGIN validate user login credentials, check for failed lock out ##### -function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$return_hash,$api_call,$source) +if(!isset($server_ip)) + { + if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} + elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} + else {$server_ip="";} + } +if(!isset($session_name)) + { + if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} + elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} + else {$session_name="";} + } +if(!isset($mel)) {$mel=0;} +if(!isset($one_mysql_log)) {$one_mysql_log=0;} +$session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); +$server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); + +##### BEGIN validate user login credentials, check for failed lock out ##### +function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$return_hash,$api_call,$source, $DB=0) { - global $mel; require("dbconnect_mysqli.php"); + global $mel, $one_mysql_log, $server_ip, $session_name; ############################################# ##### START SYSTEM_SETTINGS LOOKUP ##### @@ -346,7 +363,7 @@ function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$retur ##### BEGIN custom_list_fields_values - gather values for display of custom list fields for a lead ##### function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_id,$did_id,$did_extension,$did_pattern,$did_description,$dialed_number,$dialed_label,$only_field,$source_field,$source_field_value) { - global $mel; + global $mel, $one_mysql_log, $server_ip, $session_name; $STARTtime = date("U"); $TODAY = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); @@ -381,6 +398,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i $tablecount_to_print = mysqli_num_rows($rslt); if ($tablecount_to_print > 0) { + $rank_select=""; $stmt="SELECT count(*) from custom_$list_id;"; if ($DB>0) {$CFoutput .= "$stmt";} $rslt=mysql_to_mysqli($stmt, $link); @@ -515,7 +533,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i { $row=mysqli_fetch_row($rslt); $o=0; - while ($fields_to_print >= $o) + while ($fields_to_print > $o) { $A_field_value[$o] = trim("$row[$o]"); if ($A_field_select[$o]=='----EMPTY----') @@ -543,6 +561,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i } $o=0; + $te_printed=0; $last_field_rank=0; while ($fields_to_print > $o) { @@ -606,7 +625,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i { $field_options_array = explode("\n",$A_field_options[$o]); $field_options_count = count($field_options_array); - $te=0; $te_printed=0; + $te=0; if ($A_field_type[$o]=='SOURCESELECT') { $NEWfield_options_array = array(); @@ -690,7 +709,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i if ($DB) {echo "SOURCESELECT 3: $te|$field_options_count|$field_options_array[0]|\n";} } } - $te=0; $te_printed=0; + $te=0; if ($DB > 0) {echo "DEBUG: |$A_field_id[$o]|$A_field_label[$o]|$A_field_name[$o]|$A_field_type[$o]|$A_field_options[$o]|$field_options_count|\n";} while ($te < $field_options_count) { @@ -1585,7 +1604,6 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user,$DB,$call_i function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$Ssec,$Smon,$Smday,$Syear,$postalgmt,$postal_code) { - global $mel; require("dbconnect_mysqli.php"); $postalgmt_found=0; @@ -2347,7 +2365,6 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$ ##### DETERMINE IF LEAD IS DIALABLE ##### function dialable_gmt($DB,$link,$local_call_time,$gmt_offset,$state) { - global $mel; require("dbconnect_mysqli.php"); $dialable=0; @@ -2714,7 +2731,6 @@ function dialable_gmt($DB,$link,$local_call_time,$gmt_offset,$state) ##### AJAX process logging ##### function vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt) { - global $mel; $endMS = microtime(); $startMSary = explode(" ",$startMS); $endMSary = explode(" ",$endMS); @@ -2747,7 +2763,6 @@ function vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$s ##### MySQL Error Logging ##### function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log) { - global $mel; $NOW_TIME = date("Y-m-d H:i:s"); # mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log); $errno=''; $error=''; diff --git a/agc_2-X/trunk/www/agc/inbound_popup.php b/agc_2-X/trunk/www/agc/inbound_popup.php index 8ccb2078..5c08271e 100644 --- a/agc_2-X/trunk/www/agc/inbound_popup.php +++ b/agc_2-X/trunk/www/agc/inbound_popup.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed to open up when a live_inbound call comes in giving the user # options of what to do with the call or options to lookup the callerID on various web sites @@ -41,10 +41,11 @@ # 210616-2106 - Added optional CORS support, see options.php for details # 210825-0906 - Fix for XSS security issue # 220220-0914 - Added allow_web_debug system setting +# 260302-1209 - Code updates for PHP8 compatibility # -$version = '2.14-17'; -$build = '220220-0914'; +$version = '2.14-18'; +$build = '260302-1209'; $php_script = 'inbound_popup.php'; require_once("dbconnect_mysqli.php"); @@ -53,28 +54,39 @@ require_once("functions.php"); ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} + else {$server_ip="";} if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} + else {$session_name="";} if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} + else {$uniqueid="";} if (isset($_GET["format"])) {$format=$_GET["format"];} elseif (isset($_POST["format"])) {$format=$_POST["format"];} if (isset($_GET["exten"])) {$exten=$_GET["exten"];} elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} + else {$exten="";} if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];} elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];} + else {$vmail_box="";} if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} + else {$ext_context="";} if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} + else {$ext_priority="";} if (isset($_GET["voicemail_dump_exten"])) {$voicemail_dump_exten=$_GET["voicemail_dump_exten"];} elseif (isset($_POST["voicemail_dump_exten"])) {$voicemail_dump_exten=$_POST["voicemail_dump_exten"];} + else {$voicemail_dump_exten="";} if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_GET["local_web_callerID_URL_enc"];} elseif (isset($_POST["local_web_callerID_URL_enc"])) {$local_web_callerID_URL_enc=$_POST["local_web_callerID_URL_enc"];} + else {$local_web_callerID_URL_enc="";} if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = rawurldecode($local_web_callerID_URL_enc);} else {$local_web_callerID_URL = '';} @@ -90,7 +102,8 @@ $NOW_DATE = date("Y-m-d"); $NOW_TIME = date("Y-m-d H:i:s"); if (!isset($query_date)) {$query_date = $NOW_DATE;} $DO = '-1'; -if ( (preg_match("/^Zap/i",$channel)) and (!preg_match("/-/i",$channel)) ) {$channel = "$channel$DO";} +# Removed 3/14/25 - never used +# if ( (preg_match("/^Zap/i",$channel)) and (!preg_match("/-/i",$channel)) ) {$channel = "$channel$DO";} # if options file exists, use the override values for the above variables # see the options-example.php file for more information @@ -114,7 +127,8 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[2]; $SSallow_web_debug = $row[3]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -130,13 +144,13 @@ if ($sl_ct > 0) ##### END SETTINGS LOOKUP ##### ########################################### -$session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); -$server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); -$uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); +# $session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); +# $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); +# $uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); $exten = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$exten); $vmail_box = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$vmail_box); -$format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); -$voicemail_dump_exten = preg_replace('/[^-_0-9a-zA-Z]/','',$voicemail_dump_exten); +# $format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); +# $voicemail_dump_exten = preg_replace('/[^-_0-9a-zA-Z]/','',$voicemail_dump_exten); $local_web_callerID_URL = preg_replace("/\<|\>|\'|\"|\\\\|;/",'',$local_web_callerID_URL); $local_web_callerID_URL_enc = preg_replace("/\<|\>|\'|\"|\\\\|;/",'',$local_web_callerID_URL_enc); @@ -146,6 +160,11 @@ if ($non_latin < 1) $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); $ext_context=preg_replace("/[^-_0-9a-zA-Z]/","",$ext_context); $ext_priority=preg_replace("/[^-_0-9a-zA-Z]/","",$ext_priority); + $session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); + $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); + $uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); + $format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); + $voicemail_dump_exten = preg_replace('/[^-_0-9a-zA-Z]/','',$voicemail_dump_exten); } else { @@ -153,6 +172,11 @@ else $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); $ext_context = preg_replace('/[^-_0-9\p{L}]/u','',$ext_context); $ext_priority = preg_replace('/[^-_0-9\p{L}]/u','',$ext_priority); + $session_name = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$session_name); + $server_ip = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$server_ip); + $uniqueid = preg_replace('/[^-_\.0-9\p{L}]/u','',$uniqueid); + $format = preg_replace('/[^-_0-9\p{L}]/u','',$format); + $voicemail_dump_exten = preg_replace('/[^-_0-9\p{L}]/u','',$voicemail_dump_exten); } $auth=0; @@ -341,7 +365,7 @@ $channel_live=1; if (strlen($uniqueid)<9) { $channel_live=0; - echo QXZ("Uniqueid $uniqueid is not valid\n"); + echo _QXZ("Uniqueid $uniqueid is not valid\n"); exit; } else diff --git a/agc_2-X/trunk/www/agc/launch.php b/agc_2-X/trunk/www/agc/launch.php index fed8b4c8..59bae444 100644 --- a/agc_2-X/trunk/www/agc/launch.php +++ b/agc_2-X/trunk/www/agc/launch.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # For launch validation to work, the options.php file must have # window_validation = 1 and win_valid_name set to window_name below @@ -12,6 +12,7 @@ # 141216-2134 - Added language settings lookups and user/pass variable standardization # 210825-0909 - Fix for XSS security issue # 220220-0911 - Added allow_web_debug system setting +# 260302-1208 - Code updates for PHP8 compatibility # $window_name = 'subwindow_launch'; @@ -22,34 +23,37 @@ require_once("dbconnect_mysqli.php"); ### do not edit below this line ### if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} + elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["JS_browser_width"])) {$JS_browser_width=$_GET["JS_browser_width"];} - elseif (isset($_POST["JS_browser_width"])) {$JS_browser_width=$_POST["JS_browser_width"];} + elseif (isset($_POST["JS_browser_width"])) {$JS_browser_width=$_POST["JS_browser_width"];} + else {$JS_browser_width="";} if (isset($_GET["JS_browser_height"])) {$JS_browser_height=$_GET["JS_browser_height"];} - elseif (isset($_POST["JS_browser_height"])) {$JS_browser_height=$_POST["JS_browser_height"];} + elseif (isset($_POST["JS_browser_height"])) {$JS_browser_height=$_POST["JS_browser_height"];} + else {$JS_browser_height="";} if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} - elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} + elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} + else {$VD_login="";} if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} - elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} + elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} + else {$VD_pass="";} if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} - elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} -if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["MGR_override"];} - elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];} + elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} + else {$VD_campaign="";} if (!isset($phone_login)) { if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + else {$phone_login="";} } if (!isset($phone_pass)) { if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + else {$phone_pass="";} } if (isset($VD_campaign)) { @@ -63,16 +67,14 @@ if (!isset($flag_channels)) } ### security strip all non-alphanumeric characters out of the variables ### -$DB=preg_replace("/[^0-9a-z]/","",$DB); +$VD_login=preg_replace('/[^-_0-9\p{L}]/u',"",$VD_login); +/* 3/27/25 - Moved further down $phone_login=preg_replace('/[^-_0-9\p{L}]/u',"",$phone_login); $phone_pass=preg_replace('/[^-_0-9\p{L}]/u',"",$phone_pass); -$VD_login=preg_replace('/[^-_0-9\p{L}]/u',"",$VD_login); $VD_pass=preg_replace('/[^-_0-9\p{L}]/u',"",$VD_pass); $VD_campaign = preg_replace('/[^-_0-9\p{L}]/u',"",$VD_campaign); $JS_browser_width = preg_replace('/[^-_0-9\p{L}]/u',"",$JS_browser_width); $JS_browser_height = preg_replace('/[^-_0-9\p{L}]/u',"",$JS_browser_height); -$relogin = preg_replace('/[^-_0-9\p{L}]/u',"",$relogin); -$MGR_override = preg_replace('/[^-_0-9\p{L}]/u',"",$MGR_override); $login_string=''; @@ -88,6 +90,7 @@ if (strlen($VD_campaign)>0) {$login_string .= "VD_campaign=$VD_campaign";} if (strlen($login_string)>0) {$login_string = "?$login_string";} + */ $US='_'; $CL=':'; @@ -105,8 +108,8 @@ if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} else {$server_port = "$CL$server_port";} $agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; $agcDIR = preg_replace("/launch\.php/",'',$agcPAGE); -if (strlen($static_agent_url) > 5) - {$agcPAGE = $static_agent_url;} +# if (strlen($static_agent_url) > 5) +# {$agcPAGE = $static_agent_url;} ############################################# ##### START SYSTEM_SETTINGS AND USER LANGUAGE LOOKUP ##### @@ -125,7 +128,8 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[4]; $SSallow_web_debug = $row[5]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$VD_login';"; @@ -145,8 +149,37 @@ if ($non_latin < 1) { $VD_login=preg_replace("/[^-_0-9a-zA-Z]/","",$VD_login); $VD_pass=preg_replace("/[^-_0-9a-zA-Z]/","",$VD_pass); + $phone_login=preg_replace('/[^-_0-9a-zA-Z]/',"",$phone_login); + $phone_pass=preg_replace('/[^-_0-9a-zA-Z]/',"",$phone_pass); + $VD_campaign = preg_replace('/[^-_0-9a-zA-Z]/',"",$VD_campaign); + $JS_browser_width = preg_replace('/[^-_0-9a-zA-Z]/',"",$JS_browser_width); + $JS_browser_height = preg_replace('/[^-_0-9a-zA-Z]/',"",$JS_browser_height); + } +else + { + $VD_login=preg_replace("/[^-_0-9\p{L}]/u","",$VD_login); + $VD_pass=preg_replace("/[^-_0-9\p{L}]/u","",$VD_pass); + $phone_login=preg_replace('/[^-_0-9\p{L}]/u',"",$phone_login); + $phone_pass=preg_replace('/[^-_0-9\p{L}]/u',"",$phone_pass); + $VD_campaign = preg_replace('/[^-_0-9\p{L}]/u',"",$VD_campaign); + $JS_browser_width = preg_replace('/[^-_0-9\p{L}]/u',"",$JS_browser_width); + $JS_browser_height = preg_replace('/[^-_0-9\p{L}]/u',"",$JS_browser_height); } +$login_string=''; + +if (strlen($phone_login)>0) + {$login_string .= "phone_login=$phone_login&";} +if (strlen($phone_pass)>0) + {$login_string .= "phone_pass=$phone_pass&";} +if (strlen($VD_login)>0) + {$login_string .= "VD_login=$VD_login&";} +if (strlen($VD_pass)>0) + {$login_string .= "VD_pass=$VD_pass&";} +if (strlen($VD_campaign)>0) + {$login_string .= "VD_campaign=$VD_campaign";} +if (strlen($login_string)>0) + {$login_string = "?$login_string";} ?> diff --git a/agc_2-X/trunk/www/agc/live_exten_check.php b/agc_2-X/trunk/www/agc/live_exten_check.php index 6af24114..aa7e276f 100644 --- a/agc_2-X/trunk/www/agc/live_exten_check.php +++ b/agc_2-X/trunk/www/agc/live_exten_check.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send whether the client channel is live and to what channel it is connected # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -44,10 +44,11 @@ # 210616-2105 - Added optional CORS support, see options.php for details # 210825-0905 - Fix for XSS security issue # 220220-0907 - Added allow_web_debug system setting +# 260302-1206 - Code updates for PHP8 compatibility # -$version = '2.14-20'; -$build = '220220-0907'; +$version = '2.14-21'; +$build = '260302-1206'; $php_script = 'live_exten_check.php'; $SSagent_debug_logging=0; $startMS = microtime(); @@ -58,22 +59,30 @@ require_once("functions.php"); ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} + else {$server_ip="";} if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} + else {$session_name="";} if (isset($_GET["format"])) {$format=$_GET["format"];} elseif (isset($_POST["format"])) {$format=$_POST["format"];} if (isset($_GET["exten"])) {$exten=$_GET["exten"];} elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} + else {$exten="";} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} + else {$protocol="";} if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count"];} elseif (isset($_POST["favorites_count"])) {$favorites_count=$_POST["favorites_count"];} + else {$favorites_count=0;} if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} + else {$favorites_list="";} # variable filtering $user=preg_replace("/\'|\"|\\\\|;| /","",$user); @@ -110,7 +119,8 @@ if ($qm_conf_ct > 0) $SSagent_debug_logging = $row[3]; $SSallow_web_debug = $row[4]; } -if ($SSallow_web_debug < 1) {$DB=0; $format="text";} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0; $format='text';} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -126,23 +136,30 @@ if ($sl_ct > 0) ##### END SETTINGS LOOKUP ##### ########################################### -$session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); -$server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); +# $DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); +# $session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); +# $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); $exten = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$exten); $protocol = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$protocol); $favorites_list = preg_replace("/\'|\"|\\\\|;| /","",$favorites_list); -$format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); -$favorites_count = preg_replace('/[^-_0-9a-zA-Z]/','',$favorites_count); +# $format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); +$favorites_count = preg_replace('/[^0-9]/','',$favorites_count); if ($non_latin < 1) { $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user); $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); + $session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); + $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); + $format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); } else { $user = preg_replace('/[^-_0-9\p{L}]/u','',$user); $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); + $session_name = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$session_name); + $server_ip = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$server_ip); + $format = preg_replace('/[^-_0-9\p{L}]/u','',$format); } if (strlen($SSagent_debug_logging) > 1) @@ -358,7 +375,7 @@ if ($format=='debug') echo "\n\n\n"; } -if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);} +if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,"",$php_script,$user,"",0,$session_name,$stmt);} # ACTION, stage, and lead_id are never used in this script exit; ?> diff --git a/agc_2-X/trunk/www/agc/manager_send.php b/agc_2-X/trunk/www/agc/manager_send.php index ef7468c9..5ed6b443 100644 --- a/agc_2-X/trunk/www/agc/manager_send.php +++ b/agc_2-X/trunk/www/agc/manager_send.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to insert records into the vicidial_manager table to signal Actions to an asterisk server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -160,10 +160,11 @@ # 241122-1544 - Fix for DTMF issue #1525 # 250831-0839 - Added MonitorStereo/StopMonitorStereo functions # 251005-0935 - Added code for recording_dtmf_muting +# 260302-1132 - Code updates for PHP8 compatibility # -$version = '2.14-107'; -$build = '251005-0935'; +$version = '2.14-108'; +$build = '260302-1132'; $php_script = 'manager_send.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=177; @@ -180,100 +181,146 @@ require_once("functions.php"); ### These are variable assignments for PHP globals off if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} + else {$server_ip="";} if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} + else {$session_name="";} if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} if (isset($_GET["queryCID"])) {$queryCID=$_GET["queryCID"];} elseif (isset($_POST["queryCID"])) {$queryCID=$_POST["queryCID"];} + else {$queryCID="";} if (isset($_GET["format"])) {$format=$_GET["format"];} elseif (isset($_POST["format"])) {$format=$_POST["format"];} if (isset($_GET["channel"])) {$channel=$_GET["channel"];} elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} + else {$channel="";} if (isset($_GET["exten"])) {$exten=$_GET["exten"];} elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} + else {$exten="";} if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} + else {$ext_context="";} if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} + else {$ext_priority="";} if (isset($_GET["filename"])) {$filename=$_GET["filename"];} elseif (isset($_POST["filename"])) {$filename=$_POST["filename"];} + else {$filename="";} if (isset($_GET["extenName"])) {$extenName=$_GET["extenName"];} elseif (isset($_POST["extenName"])) {$extenName=$_POST["extenName"];} + else {$extenName="";} if (isset($_GET["parkedby"])) {$parkedby=$_GET["parkedby"];} elseif (isset($_POST["parkedby"])) {$parkedby=$_POST["parkedby"];} + else {$parkedby="";} if (isset($_GET["extrachannel"])) {$extrachannel=$_GET["extrachannel"];} elseif (isset($_POST["extrachannel"])) {$extrachannel=$_POST["extrachannel"];} + else {$extrachannel="";} if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} + else {$auto_dial_level="";} if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} + else {$campaign="";} if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} + else {$uniqueid="";} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id=0;} if (isset($_GET["secondS"])) {$secondS=$_GET["secondS"];} elseif (isset($_POST["secondS"])) {$secondS=$_POST["secondS"];} + else {$secondS="";} if (isset($_GET["outbound_cid"])) {$outbound_cid=$_GET["outbound_cid"];} elseif (isset($_POST["outbound_cid"])) {$outbound_cid=$_POST["outbound_cid"];} + else {$outbound_cid="";} if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} + else {$agent_log_id="";} if (isset($_GET["call_server_ip"])) {$call_server_ip=$_GET["call_server_ip"];} elseif (isset($_POST["call_server_ip"])) {$call_server_ip=$_POST["call_server_ip"];} + else {$call_server_ip="";} if (isset($_GET["CalLCID"])) {$CalLCID=$_GET["CalLCID"];} elseif (isset($_POST["CalLCID"])) {$CalLCID=$_POST["CalLCID"];} + else {$CalLCID="";} if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} + else {$phone_code="";} if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + else {$phone_number="";} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} + else {$stage="";} if (isset($_GET["extension"])) {$extension=$_GET["extension"];} elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} + else {$extension="";} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} + else {$protocol="";} if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} + else {$phone_ip="";} if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["enable_sipsak_messages"];} elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} + else {$enable_sipsak_messages="";} if (isset($_GET["allow_sipsak_messages"])) {$allow_sipsak_messages=$_GET["allow_sipsak_messages"];} elseif (isset($_POST["allow_sipsak_messages"])) {$allow_sipsak_messages=$_POST["allow_sipsak_messages"];} + else {$allow_sipsak_messages=0;} if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} + else {$session_id="";} if (isset($_GET["FROMvdc"])) {$FROMvdc=$_GET["FROMvdc"];} elseif (isset($_POST["FROMvdc"])) {$FROMvdc=$_POST["FROMvdc"];} + else {$FROMvdc="";} if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} + else {$agentchannel="";} if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} + else {$usegroupalias="";} if (isset($_GET["account"])) {$account=$_GET["account"];} elseif (isset($_POST["account"])) {$account=$_POST["account"];} + else {$account="";} if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} + else {$agent_dialed_number="";} if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} + else {$agent_dialed_type="";} if (isset($_GET["nodeletevdac"])) {$nodeletevdac=$_GET["nodeletevdac"];} elseif (isset($_POST["nodeletevdac"])) {$nodeletevdac=$_POST["nodeletevdac"];} + else {$nodeletevdac="";} if (isset($_GET["alertCID"])) {$alertCID=$_GET["alertCID"];} elseif (isset($_POST["alertCID"])) {$alertCID=$_POST["alertCID"];} + else {$alertCID="";} if (isset($_GET["preset_name"])) {$preset_name=$_GET["preset_name"];} elseif (isset($_POST["preset_name"])) {$preset_name=$_POST["preset_name"];} + else {$preset_name="";} if (isset($_GET["call_variables"])) {$call_variables=$_GET["call_variables"];} elseif (isset($_POST["call_variables"])) {$call_variables=$_POST["call_variables"];} + else {$call_variables="";} if (isset($_GET["log_campaign"])) {$log_campaign=$_GET["log_campaign"];} elseif (isset($_POST["log_campaign"])) {$log_campaign=$_POST["log_campaign"];} + else {$log_campaign="";} if (isset($_GET["qm_extension"])) {$qm_extension=$_GET["qm_extension"];} elseif (isset($_POST["qm_extension"])) {$qm_extension=$_POST["qm_extension"];} + else {$qm_extension="";} if (isset($_GET["customerparked"])) {$customerparked=$_GET["customerparked"];} elseif (isset($_POST["customerparked"])) {$customerparked=$_POST["customerparked"];} + else {$customerparked="";} if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} + else {$user_group="";} if (isset($_GET["group_id"])) {$group_id=$_GET["group_id"];} elseif (isset($_POST["group_id"])) {$group_id=$_POST["group_id"];} + else {$group_id="";} # if options file exists, use the override values for the above variables # see the options-example.php file for more information @@ -282,7 +329,17 @@ if (file_exists('options.php')) require('options.php'); } -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); +$StarTtime = date("U"); +$NOW_DATE = date("Y-m-d"); +$NOW_TIME = date("Y-m-d H:i:s"); +$NOWnum = date("YmdHis"); +if (!isset($query_date)) {$query_date = $NOW_DATE;} + +# default optional vars if not set +if (!isset($ACTION)) {$ACTION="Originate";} +if (!isset($format)) {$format="alert";} +if (!isset($ext_priority)) {$ext_priority="1";} + $user=preg_replace("/\'|\"|\\\\|;| /","",$user); $pass=preg_replace("/\'|\"|\\\\|;| /","",$pass); @@ -309,7 +366,8 @@ if ($qm_conf_ct > 0) $SSrecording_dtmf_detection = $row[10]; $SSrecording_dtmf_muting = $row[11]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); ##### END SETTINGS LOOKUP ##### ########################################### @@ -318,8 +376,8 @@ header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0 # filter variables -$session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); -$server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); +# $session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); +# $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); $lead_id = preg_replace('/[^0-9]/','',$lead_id); $session_id = preg_replace('/[^0-9]/','',$session_id); $exten = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$exten); @@ -327,21 +385,21 @@ $extension = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$extension); $protocol = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$protocol); $ACTION = preg_replace("/\'|\"|\\\\|;/","",$ACTION); $CalLCID = preg_replace("/\'|\"|\\\\|;/","",$CalLCID); -$FROMvdc = preg_replace('/[^-_0-9a-zA-Z]/','',$FROMvdc); -$agent_log_id = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_log_id); +# $FROMvdc = preg_replace('/[^-_0-9a-zA-Z]/','',$FROMvdc); +# $agent_log_id = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_log_id); $agentchannel = preg_replace("/\'|\"|\\\\/","",$agentchannel); -$auto_dial_level = preg_replace('/[^-\._0-9a-zA-Z]/','',$auto_dial_level); +# $auto_dial_level = preg_replace('/[^-\._0-9a-zA-Z]/','',$auto_dial_level); $call_server_ip = preg_replace("/\'|\"|\\\\|;/","",$call_server_ip); $call_variables = preg_replace("/\'|\"|\\\\|;/","",$call_variables); $channel = preg_replace("/\'|\"|\\\\/","",$channel); $customerparked = preg_replace('/[^0-9]/','',$customerparked); $enable_sipsak_messages = preg_replace('/[^0-9]/','',$enable_sipsak_messages); -$ext_context = preg_replace('/[^-_0-9a-zA-Z]/','',$ext_context); -$ext_priority = preg_replace('/[^-_0-9a-zA-Z]/','',$ext_priority); +# $ext_context = preg_replace('/[^-_0-9a-zA-Z]/','',$ext_context); +# $ext_priority = preg_replace('/[^-_0-9a-zA-Z]/','',$ext_priority); $exten = preg_replace("/\'|\"|\\\\|;/","",$exten); $extenName = preg_replace("/\'|\"|\\\\|;/","",$extenName); $extrachannel = preg_replace("/\'|\"|\\\\/","",$extrachannel); -$format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); +# $format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); $log_campaign = preg_replace("/\'|\"|\\\\|;/","",$log_campaign); $nodeletevdac = preg_replace('/[^0-9]/','',$nodeletevdac); $outbound_cid = preg_replace("/\'|\"|\\\\|;/","",$outbound_cid); @@ -352,9 +410,9 @@ $qm_extension = preg_replace("/\'|\"|\\\\|;/","",$qm_extension); $secondS = preg_replace('/[^0-9]/','',$secondS); $stage = preg_replace("/\'|\"|\\\\|;/","",$stage); $usegroupalias = preg_replace('/[^0-9]/','',$usegroupalias); -$phone_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$phone_ip); -$allow_sipsak_messages = preg_replace('/[^-_0-9a-zA-Z]/','',$allow_sipsak_messages); -$alertCID = preg_replace('/[^-_0-9a-zA-Z]/','',$alertCID); +# $phone_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$phone_ip); +$allow_sipsak_messages = preg_replace('/[^0-9]/','',$allow_sipsak_messages); +# $alertCID = preg_replace('/[^-_0-9a-zA-Z]/','',$alertCID); if ($non_latin < 1) { @@ -370,6 +428,16 @@ if ($non_latin < 1) $group_id = preg_replace('/[^-_0-9a-zA-Z]/','',$group_id); $filename = preg_replace('/[^-\._0-9a-zA-Z]/','',$filename); $queryCID = preg_replace('/[^-\#\*\,\._0-9a-zA-Z]/','',$queryCID); + $session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); + $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); + $FROMvdc = preg_replace('/[^-_0-9a-zA-Z]/','',$FROMvdc); + $agent_log_id = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_log_id); + $auto_dial_level = preg_replace('/[^-\._0-9a-zA-Z]/','',$auto_dial_level); + $ext_context = preg_replace('/[^-_0-9a-zA-Z]/','',$ext_context); + $ext_priority = preg_replace('/[^-_0-9a-zA-Z]/','',$ext_priority); + $format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); + $phone_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$phone_ip); + $alertCID = preg_replace('/[^-_0-9a-zA-Z]/','',$alertCID); } else { @@ -385,20 +453,18 @@ else $group_id = preg_replace('/[^-_0-9\p{L}]/u','',$group_id); $filename = preg_replace('/[^-\._0-9\p{L}]/u','',$filename); $queryCID = preg_replace('/[^-\#\*\,\._0-9\p{L}]/u','',$queryCID); + $session_name = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$session_name); + $server_ip = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$server_ip); + $FROMvdc = preg_replace('/[^-_0-9\p{L}]/u','',$FROMvdc); + $agent_log_id = preg_replace('/[^-_0-9\p{L}]/u','',$agent_log_id); + $auto_dial_level = preg_replace('/[^-\._0-9\p{L}]/u','',$auto_dial_level); + $ext_context = preg_replace('/[^-_0-9\p{L}]/u','',$ext_context); + $ext_priority = preg_replace('/[^-_0-9\p{L}]/u','',$ext_priority); + $format = preg_replace('/[^-_0-9\p{L}]/u','',$format); + $phone_ip = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$phone_ip); + $alertCID = preg_replace('/[^-_0-9\p{L}]/u','',$alertCID); } -# default optional vars if not set -if (!isset($ACTION)) {$ACTION="Originate";} -if (!isset($format)) {$format="alert";} -if (!isset($ext_priority)) {$ext_priority="1";} - -$StarTtime = date("U"); -$NOW_DATE = date("Y-m-d"); -$NOW_TIME = date("Y-m-d H:i:s"); -$NOWnum = date("YmdHis"); -if (!isset($query_date)) {$query_date = $NOW_DATE;} - - ############################################# ##### START SYSTEM_SETTINGS AND USER LANGUAGE LOOKUP ##### $VUselected_language = ''; @@ -423,8 +489,12 @@ if (strlen($SSagent_debug_logging) > 1) $stmtA="SELECT conf_engine FROM servers WHERE server_ip='$server_ip';"; $rslt=mysql_to_mysqli($stmtA, $link); -$row=mysqli_fetch_row($rslt); -$conf_engine = $row[0]; +$conf_engine=""; +if (mysqli_num_rows($rslt)>0) + { + $row=mysqli_fetch_row($rslt); + $conf_engine = $row[0]; + } $threeway_context = $ext_context; if (strlen($meetme_enter_leave3way_filename) > 0) @@ -713,6 +783,7 @@ if ($ACTION=="Originate") } } + $RAWaccount=''; if (strlen($outbound_cid)>1) {$outCID = "\"$queryCID\" <$outbound_cid>";} else @@ -858,7 +929,7 @@ if ($ACTION=="HangupConfDial") $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02008',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); - if ($row > 0) + if ($row[0] > 0) { $stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$hangup_channel_prefix%\";"; if ($format=='debug') {echo "\n";} @@ -3298,13 +3369,21 @@ if ($ACTION=="VolumeControl") if (preg_match('/MUTING/i',$stage)) {$vol_prefix='1';} $local_DEF = 'Local/'; $local_AMP = '@'; - $volume_local_channel = "$local_DEF$participant_number$vol_prefix$exten$local_AMP$ext_context"; - $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $volume_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; + if (isset($vol_prefix)) + { + $volume_local_channel = "$local_DEF$participant_number$vol_prefix$exten$local_AMP$ext_context"; + + $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$queryCID','Channel: $volume_local_channel','Context: $ext_context','Exten: 8300','Priority: 1','Callerid: $queryCID','','','','$channel','$exten');"; if ($format=='debug') {echo "\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02082',$user,$server_ip,$session_name,$one_mysql_log);} - echo _QXZ("Volume command sent for Conference %1s, Stage %2s Channel %3s on %4s",0,'',$exten,$stage,$channel,$server_ip)."\n"; + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02082',$user,$server_ip,$session_name,$one_mysql_log);} + echo _QXZ("Volume command sent for Conference %1s, Stage %2s Channel %3s on %4s",0,'',$exten,$stage,$channel,$server_ip)."\n"; + } + else + { + echo _QXZ("Stage $stage/$ACTION does not generate a volume prefix")."\n"; + } } } diff --git a/agc_2-X/trunk/www/agc/options-example.php b/agc_2-X/trunk/www/agc/options-example.php index ab2dc5a3..8abdf49f 100644 --- a/agc_2-X/trunk/www/agc/options-example.php +++ b/agc_2-X/trunk/www/agc/options-example.php @@ -89,8 +89,8 @@ $TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen $stretch_dimensions = '1'; # sets the vicidial screen to the size of the browser window $BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 $BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 -$webphone_width = 460; # set the webphone frame width -$webphone_height = 500; # set the webphone frame height +$webphone_width = 460; # set the webphone frame width, for 'bar' location use 1100 +$webphone_height = 500; # set the webphone frame height, for 'bar' location use 50 $webphone_pad = 0; # set the table cellpadding for the webphone $webphone_location = 'right'; # set the location on the agent screen 'right' or 'bar' $MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6 diff --git a/agc_2-X/trunk/www/agc/park_calls_display.php b/agc_2-X/trunk/www/agc/park_calls_display.php index 796c8ddd..7e581a18 100644 --- a/agc_2-X/trunk/www/agc/park_calls_display.php +++ b/agc_2-X/trunk/www/agc/park_calls_display.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed purely to send the details on the parked calls on the server # This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table @@ -35,10 +35,11 @@ # 210616-2104 - Added optional CORS support, see options.php for details # 210825-0904 - Fix for XSS security issue # 220220-0902 - Added allow_web_debug system setting +# 260302-1204 - Code updates for PHP8 compatibility # -$version = '2.14-17'; -$build = '220220-0902'; +$version = '2.14-18'; +$build = '260302-1204'; $php_script = 'park_calls_display.php'; $SSagent_debug_logging=0; $startMS = microtime(); @@ -49,18 +50,26 @@ require_once("functions.php"); ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} + else {$server_ip="";} if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} + else {$session_name="";} if (isset($_GET["format"])) {$format=$_GET["format"];} elseif (isset($_POST["format"])) {$format=$_POST["format"];} if (isset($_GET["exten"])) {$exten=$_GET["exten"];} elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} + else {$exten="";} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} + else {$protocol="";} +if (isset($_GET["park_limit"])) {$park_limit=$_GET["park_limit"];} + elseif (isset($_POST["park_limit"])) {$park_limit=$_POST["park_limit"];} # variable filtering $user=preg_replace("/\'|\"|\\\\|;| /","",$user); @@ -98,7 +107,8 @@ if ($qm_conf_ct > 0) $SSagent_debug_logging = $row[3]; $SSallow_web_debug = $row[4]; } -if ($SSallow_web_debug < 1) {$DB=0; $format="text";} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0; $format="text";} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -114,21 +124,28 @@ if ($sl_ct > 0) ##### END SETTINGS LOOKUP ##### ########################################### -$session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); -$server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); +# $session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); +# $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); $exten = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$exten); $protocol = preg_replace("/\||`|&|\'|\"|\\\\|;| /","",$protocol); -$format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); +# $format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); +$park_limit = preg_replace('/[^0-9]/', '', $park_limit); if ($non_latin < 1) { $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user); $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); + $session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); + $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); + $format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); } else { $user = preg_replace('/[^-_0-9\p{L}]/u','',$user); $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); + $session_name = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$session_name); + $server_ip = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$server_ip); + $format = preg_replace('/[^-_0-9\p{L}]/u','',$format); } if (strlen($SSagent_debug_logging) > 1) @@ -224,7 +241,7 @@ if ($format=='debug') echo "\n\n\n"; } -if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,$ACTION,$php_script,$user,$stage,$lead_id,$session_name,$stmt);} +if ($SSagent_debug_logging > 0) {vicidial_ajax_log($NOW_TIME,$startMS,$link,"",$php_script,$user,"",0,$session_name,$stmt);} # ACTION, stage, and lead_id are never used in this script exit; ?> diff --git a/agc_2-X/trunk/www/agc/phone_only.php b/agc_2-X/trunk/www/agc/phone_only.php index 20ea6e9f..83c31641 100644 --- a/agc_2-X/trunk/www/agc/phone_only.php +++ b/agc_2-X/trunk/www/agc/phone_only.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # CHANGELOG # 110511-1336 - First Build @@ -23,10 +23,11 @@ # 210616-2043 - Added optional CORS support, see options.php for details # 220220-0936 - Added allow_web_debug system setting # 221021-1026 - Added webphone_settings phones option +# 260302-1200 - Code updates for PHP8 compatibility # -$version = '2.14-19p'; -$build = '221021-1026'; +$version = '2.14-20p'; +$build = '260302-1200'; $php_script = 'phone_only.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=74; @@ -43,19 +44,40 @@ if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} + else {$VD_login="";} if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} + else {$VD_pass="";} if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} + elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} + else {$relogin="";} +if (isset($_GET["JS_browser_width"])) {$JS_browser_width=$_GET["JS_browser_width"];} + elseif (isset($_POST["JS_browser_width"])) {$JS_browser_width=$_POST["JS_browser_width"];} + else {$JS_browser_width=0;} +if (isset($_GET["JS_browser_height"])) {$JS_browser_height=$_GET["JS_browser_height"];} + elseif (isset($_POST["JS_browser_height"])) {$JS_browser_height=$_POST["JS_browser_height"];} + else {$JS_browser_height=0;} +if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} + elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} + else {$force_logout="";} +if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} + else {$session_id="";} +if (isset($_GET["agent_status_view"])) {$agent_status_view=$_GET["agent_status_view"];} + elseif (isset($_POST["agent_status_view"])) {$agent_status_view=$_POST["agent_status_view"];} + else {$agent_status_view=0;} + if (!isset($phone_login)) { if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + else {$phone_login="";} } if (!isset($phone_pass)) { if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + else {$phone_pass="";} } if (!isset($flag_channels)) { @@ -64,17 +86,19 @@ if (!isset($flag_channels)) } ### security strip all non-alphanumeric characters out of the variables ### -$DB=preg_replace("[^0-9a-z]","",$DB); -$phone_login=preg_replace("/[^\,0-9a-zA-Z]/","",$phone_login); -$phone_pass=preg_replace("/[^-_0-9a-zA-Z]/","",$phone_pass); +# $phone_login=preg_replace("/[^\,0-9a-zA-Z]/","",$phone_login); +# $phone_pass=preg_replace("/[^-_0-9a-zA-Z]/","",$phone_pass); $VD_login=preg_replace("/\'|\"|\\\\|;| /","",$VD_login); $VD_pass=preg_replace("/\'|\"|\\\\|;| /","",$VD_pass); -$relogin=preg_replace("/[^-_0-9a-zA-Z]/","",$relogin); - +# $relogin=preg_replace("/[^-_0-9a-zA-Z]/","",$relogin); +# $force_logout=preg_replace("/[^-_0-9a-zA-Z]/","",$force_logout); +$JS_browser_width=preg_replace("/[^0-9]/", "", $JS_browser_width); +$JS_browser_height=preg_replace("/[^0-9]/", "", $JS_browser_height); +# $session_id = preg_replace('/[^-_\.0-9a-zA-Z]/','',$session_id); $forever_stop=0; -if ($force_logout) +if (strlen($force_logout)>0) { echo _QXZ("You have now logged out. Thank you")."\n"; exit; @@ -123,7 +147,8 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[14]; $SSallow_web_debug = $row[15]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$VD_login';"; @@ -143,11 +168,21 @@ if ($non_latin < 1) { $VD_login=preg_replace("/[^-_0-9a-zA-Z]/","",$VD_login); $VD_pass=preg_replace("/[^-_0-9a-zA-Z]/","",$VD_pass); + $phone_login=preg_replace("/[^\,0-9a-zA-Z]/","",$phone_login); + $phone_pass=preg_replace("/[^-_0-9a-zA-Z]/","",$phone_pass); + $relogin=preg_replace("/[^-_0-9a-zA-Z]/","",$relogin); + $force_logout=preg_replace("/[^-_0-9a-zA-Z]/","",$force_logout); + $session_id = preg_replace('/[^-_\.0-9a-zA-Z]/','',$session_id); } else { $VD_login = preg_replace('/[^-_0-9\p{L}]/u','',$VD_login); $VD_pass = preg_replace('/[^-_0-9\p{L}]/u','',$VD_pass); + $phone_login=preg_replace("/[^\,0-9\p{L}]/u","",$phone_login); + $phone_pass=preg_replace("/[^-_0-9\p{L}]/u","",$phone_pass); + $relogin=preg_replace("/[^-_0-9\p{L}]/u","",$relogin); + $force_logout=preg_replace("/[^-_0-9\p{L}]/u","",$force_logout); + $session_id = preg_replace('/[^-_\.0-9\p{L}]/u','',$session_id); } @@ -222,9 +257,15 @@ $stmt="SELECT user_group from vicidial_users where user='$VD_login';"; if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'09002',$VD_login,$server_ip,$session_name,$one_mysql_log);} -$row=mysqli_fetch_row($rslt); -$VU_user_group=$row[0]; - +if (mysqli_num_rows($rslt)>0) + { + $row=mysqli_fetch_row($rslt); + $VU_user_group=$row[0]; + } +else + { + $VU_user_group=""; + } if ($relogin == 'YES') { @@ -369,6 +410,7 @@ if ( (strlen($phone_login) < 1) or (strlen($phone_pass) < 1) ) } else { + $VDdisplayMESSAGE=''; if ($WeBRooTWritablE > 0) {$fp = fopen ("./vicidial_auth_entries.txt", "w");} $VDloginDISPLAY=0; diff --git a/agc_2-X/trunk/www/agc/sse.php b/agc_2-X/trunk/www/agc/sse.php index 6391e1bd..0ae32e97 100644 --- a/agc_2-X/trunk/www/agc/sse.php +++ b/agc_2-X/trunk/www/agc/sse.php @@ -3,7 +3,11 @@ header('Content-Type: text/event-stream'); header('Cache-Control: no-cache'); $time = date('r'); + +$refresh_interval=(array_key_exists('refresh_interval', $_GET) ? $_GET['refresh_interval'] : "-1"); + // If the connection closes, retry in 1 second -echo "retry: {$_GET['refresh_interval']}\n"; +echo "retry: {$refresh_interval}\n"; echo "data: The server time is: {$time}\n\n"; -flush(); \ No newline at end of file +flush(); +?> \ No newline at end of file diff --git a/agc_2-X/trunk/www/agc/timeclock.php b/agc_2-X/trunk/www/agc/timeclock.php index ce8e6a8d..8e1ece00 100644 --- a/agc_2-X/trunk/www/agc/timeclock.php +++ b/agc_2-X/trunk/www/agc/timeclock.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # CHANGELOG # 80523-0134 - First Build @@ -27,10 +27,11 @@ # 210616-2101 - Added optional CORS support, see options.php for details # 220220-0934 - Added allow_web_debug system setting # 220921-1702 - Added failed login reason messages +# 260302-1158 - Code updates for PHP8 compatibility # -$version = '2.14-22'; -$build = '220921-1702'; +$version = '2.14-23'; +$build = '260302-1158'; $php_script = 'timeclock.php'; $StarTtimE = date("U"); @@ -53,7 +54,7 @@ if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} else {$server_port = "$CL$server_port";} $agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; $agcDIR = preg_replace('/timeclock\.php/i','',$agcPAGE); - +$VDdisplayMESSAGE=''; if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} @@ -63,35 +64,44 @@ if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} + else {$VD_login="";} if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} + else {$VD_pass="";} if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} + else {$VD_campaign="";} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} + else {$stage="";} if (isset($_GET["commit"])) {$commit=$_GET["commit"];} elseif (isset($_POST["commit"])) {$commit=$_POST["commit"];} + else {$commit="";} if (isset($_GET["referrer"])) {$referrer=$_GET["referrer"];} elseif (isset($_POST["referrer"])) {$referrer=$_POST["referrer"];} + else {$referrer="";} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (strlen($VD_login)<1) {$VD_login = $user;} if (!isset($phone_login)) { if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + else {$phone_login="";} } if (!isset($phone_pass)) { if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + else {$phone_pass="";} } ### security strip all non-alphanumeric characters out of the variables ### -$DB=preg_replace("/[^0-9a-z]/","",$DB); $VD_login=preg_replace("/\'|\"|\\\\|;| /","",$VD_login); $VD_pass=preg_replace("/\'|\"|\\\\|;| /","",$VD_pass); $user=preg_replace("/\'|\"|\\\\|;| /","",$user); @@ -127,7 +137,8 @@ if ($qm_conf_ct > 0) $SSagent_script = $row[7]; $SSallow_web_debug = $row[8]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT user,selected_language from vicidial_users where user='$VD_login';"; @@ -151,9 +162,9 @@ $user=preg_replace("/\'|\"|\\\\|;| /","",$user); $pass=preg_replace("/\'|\"|\\\\|;| /","",$pass); $phone_login=preg_replace("/\'|\"|\\\\|;| /","",$phone_login); $phone_pass=preg_replace("/\'|\"|\\\\|;| /","",$phone_pass); -$stage=preg_replace("/[^0-9a-zA-Z]/","",$stage); -$commit=preg_replace("/[^0-9a-zA-Z]/","",$commit); -$referrer=preg_replace("/[^0-9a-zA-Z]/","",$referrer); +# $stage=preg_replace("/[^0-9a-zA-Z]/","",$stage); +# $commit=preg_replace("/[^0-9a-zA-Z]/","",$commit); +# $referrer=preg_replace("/[^0-9a-zA-Z]/","",$referrer); if ($non_latin < 1) { @@ -164,6 +175,9 @@ if ($non_latin < 1) $VD_campaign=preg_replace("/[^-_0-9a-zA-Z]/","",$VD_campaign); $phone_login=preg_replace("/[^\,0-9a-zA-Z]/","",$phone_login); $phone_pass=preg_replace("/[^-_0-9a-zA-Z]/","",$phone_pass); + $stage=preg_replace("/[^0-9a-zA-Z]/","",$stage); + $commit=preg_replace("/[^0-9a-zA-Z]/","",$commit); + $referrer=preg_replace("/[^0-9a-zA-Z]/","",$referrer); } else { @@ -174,6 +188,9 @@ else $VD_campaign=preg_replace("/[^-_0-9\p{L}]/u","",$VD_campaign); $phone_login=preg_replace("/[^\,0-9\p{L}]/u","",$phone_login); $phone_pass=preg_replace("/[^-_0-9\p{L}]/u","",$phone_pass); + $stage=preg_replace("/[^0-9\p{L}]/u","",$stage); + $commit=preg_replace("/[^0-9\p{L}]/u","",$commit); + $referrer=preg_replace("/[^0-9\p{L}]/u","",$referrer); } header ("Content-type: text/html; charset=utf-8"); @@ -192,6 +209,7 @@ $SSstd_row5_background='A3C3D6'; $SSalt_row1_background='BDFFBD'; $SSalt_row2_background='99FF99'; $SSalt_row3_background='CCFFCC'; +$SSweb_logo='default_new'; if ($agent_screen_colors != 'default') { diff --git a/agc_2-X/trunk/www/agc/update_cf_ivr.php b/agc_2-X/trunk/www/agc/update_cf_ivr.php index a2905e24..5486d03e 100644 --- a/agc_2-X/trunk/www/agc/update_cf_ivr.php +++ b/agc_2-X/trunk/www/agc/update_cf_ivr.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is part of the API group and any modifications of data are # logged to the vicidial_api_log table. @@ -14,6 +14,7 @@ # 210615-1030 - Default security fixes, CVE-2021-28854 # 210616-2041 - Added optional CORS support, see options.php for details # 220219-2238 - Added allow_web_debug system setting +# 260302-1157 - Code updates for PHP8 compatibility # $api_script = 'update_cf_ivr'; @@ -29,33 +30,42 @@ $filetime = date("H:i:s"); $IP = getenv ("REMOTE_ADDR"); $BR = getenv ("HTTP_USER_AGENT"); -$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; -$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; +$PHP_AUTH_USER=(array_key_exists('PHP_AUTH_USER', $_SERVER) ? $_SERVER['PHP_AUTH_USER'] : ""); +$PHP_AUTH_PW=(array_key_exists('PHP_AUTH_PW', $_SERVER) ? $_SERVER['PHP_AUTH_PW'] : ""); if (isset($_GET["caller_id"])) {$caller_id=$_GET["caller_id"];} elseif (isset($_POST["caller_id"])) {$caller_id=$_POST["caller_id"];} + else {$caller_id="";} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id=0;} if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} + else {$list_id=0;} if (isset($_GET["field"])) {$field=$_GET["field"];} elseif (isset($_POST["field"])) {$field=$_POST["field"];} + else {$field="";} if (isset($_GET["value"])) {$value=$_GET["value"];} elseif (isset($_POST["value"])) {$value=$_POST["value"];} + else {$value="";} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} +if (isset($_GET["pass"])) {$pass=$_GET["pass"];} + elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["log_to_file"])) {$log_to_file=$_GET["log_to_file"];} elseif (isset($_POST["log_to_file"])) {$log_to_file=$_POST["log_to_file"];} - -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); + else {$log_to_file=0;} #$DB = '1'; # DEBUG override $US = '_'; $TD = '---'; $STARTtime = date("U"); $NOW_TIME = date("Y-m-d H:i:s"); -$sale_status = "$TD$sale_status$TD"; +# Removed 3/14 - not used +# $sale_status = "$TD$sale_status$TD"; $search_value=''; $match_found=0; $k=0; @@ -80,7 +90,8 @@ if ($qm_conf_ct > 0) $active_modules = $row[3]; $SSallow_web_debug = $row[4]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -96,22 +107,26 @@ if ($sl_ct > 0) ##### END SETTINGS LOOKUP ##### ########################################### -$caller_id = preg_replace('/[^-_0-9a-zA-Z]/', '', $caller_id); +# $caller_id = preg_replace('/[^-_0-9a-zA-Z]/', '', $caller_id); $lead_id = preg_replace('/[^_0-9]/', '', $lead_id); -$list_id = preg_replace('/[^_0-9]/', '', $list_id); -$field = preg_replace('/[^-_0-9a-zA-Z]/', '', $field); +$list_id = preg_replace('/[^0-9]/', '', $list_id); +# $field = preg_replace('/[^-_0-9a-zA-Z]/', '', $field); $value = preg_replace("/\'|\"|\\\\|;| /","",$value); -$log_to_file = preg_replace('/[^-_0-9a-zA-Z]/', '', $log_to_file); +$log_to_file = preg_replace('/[^0-9]/', '', $log_to_file); if ($non_latin < 1) { $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user); $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); + $caller_id = preg_replace('/[^-_0-9a-zA-Z]/', '', $caller_id); + $field = preg_replace('/[^-_0-9a-zA-Z]/', '', $field); } else { $user=preg_replace("/[^-_0-9\p{L}]/u","",$user); $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); + $caller_id = preg_replace('/[^-_0-9\p{L}]/u', '', $caller_id); + $field = preg_replace('/[^-_0-9\p{L}]/u', '', $field); } # if options file exists, use the override values for the above variables diff --git a/agc_2-X/trunk/www/agc/vdc_chat_display.php b/agc_2-X/trunk/www/agc/vdc_chat_display.php index 09b01ff9..d9c06b15 100644 --- a/agc_2-X/trunk/www/agc/vdc_chat_display.php +++ b/agc_2-X/trunk/www/agc/vdc_chat_display.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Joe Johnson, Matt Florell LICENSE: AGPLv2 # # This is the interface for agents to chat with customers and each other. It's separate from the manager-to-agent # chat interface out of necessity and calls the chat_db_query.php page to send information and display it. It will @@ -23,6 +23,7 @@ # 220220-0928 - Added allow_web_debug system setting # 220518-2211 - Small fix for encrypted auth # 230518-2002 - Added customer_chat_refresh_seconds options.php setting, and message display +# 260302-1156 - Code updates for PHP8 compatibility # require("dbconnect_mysqli.php"); @@ -32,46 +33,59 @@ $php_script = 'vdc_chat_display.php'; $MT[0]=''; $chat_group_ids=$MT; +$customer_chat_refresh_seconds=1; if (isset($_GET["email"])) {$email=$_GET["email"];} elseif (isset($_POST["email"])) {$email=$_POST["email"];} + else {$email="";} if (isset($_GET["email_invite_lead_id"])) {$email_invite_lead_id=$_GET["email_invite_lead_id"];} elseif (isset($_POST["email_invite_lead_id"])) {$email_invite_lead_id=$_POST["email_invite_lead_id"];} + else {$email_invite_lead_id="";} if (isset($_GET["chat_id"])) {$chat_id=$_GET["chat_id"];} elseif (isset($_POST["chat_id"])) {$chat_id=$_POST["chat_id"];} + else {$chat_id="";} if (isset($_GET["chat_group_id"])) {$chat_group_id=$_GET["chat_group_id"];} elseif (isset($_POST["chat_group_id"])) {$chat_group_id=$_POST["chat_group_id"];} + else {$chat_group_id="";} if (isset($_GET["chat_group_ids"])) {$chat_group_ids=$_GET["chat_group_ids"];} elseif (isset($_POST["chat_group_ids"])) {$chat_group_ids=$_POST["chat_group_ids"];} if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id=0;} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} + else {$campaign="";} if (isset($_GET["dial_method"])) {$dial_method=$_GET["dial_method"];} elseif (isset($_POST["dial_method"])) {$dial_method=$_POST["dial_method"];} + else {$dial_method="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["child_window"])) {$child_window=$_GET["child_window"];} elseif (isset($_POST["child_window"])) {$child_window=$_POST["child_window"];} + else {$child_window="";} if (isset($_GET["outside_user_name"])) {$outside_user_name=$_GET["outside_user_name"];} elseif (isset($_POST["outside_user_name"])) {$outside_user_name=$_POST["outside_user_name"];} if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} + else {$first_name="";} if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} + else {$last_name="";} if (isset($_GET["clickmute"])) {$clickmute=$_GET["clickmute"];} elseif (isset($_POST["clickmute"])) {$clickmute=$_POST["clickmute"];} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} + else {$stage="";} $PHP_SELF=$_SERVER['PHP_SELF']; $PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF); -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); $user=preg_replace("/\'|\"|\\\\|;| /","",$user); $pass=preg_replace("/\'|\"|\\\\|;| /","",$pass); @@ -94,7 +108,8 @@ if ($qm_conf_ct > 0) $SSallow_web_debug = $row[5]; } $VUselected_language = $SSdefault_language; -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); ##### END SETTINGS LOOKUP ##### ########################################### @@ -109,17 +124,17 @@ header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0 -if ($clickmute!="1") {$clickmute="0";} // Prevents annoying quirk of playing the audio cue every time you click the tab to view this +if (!isset($clickmute) || $clickmute!="1") {$clickmute="0";} // Prevents annoying quirk of playing the audio cue every time you click the tab to view this $lead_id = preg_replace("/[^0-9]/","",$lead_id); -$chat_id = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$chat_id); -$server_ip = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$server_ip); +# $chat_id = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$chat_id); +# $server_ip = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$server_ip); $email = preg_replace("/\'|\"|\\\\|;/","",$email); -$dial_method = preg_replace('/[^-\_0-9a-zA-Z]/','',$dial_method); +# $dial_method = preg_replace('/[^-\_0-9a-zA-Z]/','',$dial_method); $clickmute = preg_replace("/\'|\"|\\\\|;/","",$clickmute); -$stage = preg_replace('/[^-\_0-9a-zA-Z]/','',$stage); +# $stage = preg_replace('/[^-\_0-9a-zA-Z]/','',$stage); $email_invite_lead_id = preg_replace("/\'|\"|\\\\|;/","",$email_invite_lead_id); -$child_window = preg_replace('/[^-\_0-9a-zA-Z]/','',$child_window); +# $child_window = preg_replace('/[^-\_0-9a-zA-Z]/','',$child_window); $chat_group_ids = preg_replace("/\"|\\\\|;/","",$chat_group_ids); $customer_chat_refresh_seconds=preg_replace("/[^0-9\.]/", "", $customer_chat_refresh_seconds); if (!$customer_chat_refresh_seconds) {$customer_chat_refresh_seconds=1;} @@ -134,6 +149,11 @@ if ($non_latin < 1) $last_name = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$last_name); $campaign = preg_replace('/[^-\_0-9a-zA-Z]/','',$campaign); $chat_group_id = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$chat_group_id); + $chat_id = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$chat_id); + $server_ip = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$server_ip); + $dial_method = preg_replace('/[^-\_0-9a-zA-Z]/','',$dial_method); + $stage = preg_replace('/[^-\_0-9a-zA-Z]/','',$stage); + $child_window = preg_replace('/[^-\_0-9a-zA-Z]/','',$child_window); } else { @@ -144,6 +164,11 @@ else $last_name = preg_replace('/[^- \_\.0-9\p{L}]/u','',$last_name); $campaign = preg_replace('/[^-\_0-9\p{L}]/u','',$campaign); $chat_group_id = preg_replace('/[^- \_\.0-9\p{L}]/u','',$chat_group_id); + $chat_id = preg_replace('/[^- \_\.0-9\p{L}]/u','',$chat_id); + $server_ip = preg_replace('/[^- \_\.0-9\p{L}]/u','',$server_ip); + $dial_method = preg_replace('/[^-\_0-9\p{L}]/u','',$dial_method); + $stage = preg_replace('/[^-\_0-9\p{L}]/u','',$stage); + $child_window = preg_replace('/[^-\_0-9\p{L}]/u','',$child_window); } if( (strlen($stage) > 0) and ($stage == 'WELCOME') ) @@ -189,6 +214,7 @@ if (mysqli_num_rows($user_rslt)>0) { # echo "\\-->\n"; } else { # echo "Waiting for chat request..."; exit; + $chat_stmt=""; # Defined for $DB, prevents warnings } } else { unset($pass); @@ -864,7 +890,16 @@ if($child_window) { } ?> -\n"; ?> +\n"; +?>
    @@ -976,7 +1011,7 @@ echo ($customer_chat_refresh_seconds!=1 ? "
    "; } @@ -1005,7 +1040,7 @@ echo ($customer_chat_refresh_seconds!=1 ? "
    - + diff --git a/agc_2-X/trunk/www/agc/vdc_db_query.php b/agc_2-X/trunk/www/agc/vdc_db_query.php index ed1c2e66..b42b54d1 100644 --- a/agc_2-X/trunk/www/agc/vdc_db_query.php +++ b/agc_2-X/trunk/www/agc/vdc_db_query.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed to exchange information between vicidial.php and the database server for various actions # @@ -565,10 +565,11 @@ # 251002-1352 - Added call_count_limit_restrict campaign option # 251005-0931 - Added code for recording_dtmf_muting # 251124-0935 - Added lead status display for callbacks list output +# 260302-1057 - Code updates for PHP8 compatibility # -$version = '2.14-458'; -$build = '251124-0935'; +$version = '2.14-459'; +$build = '260302-1057'; $php_script = 'vdc_db_query.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=995; @@ -578,6 +579,9 @@ $VD_login=0; $SSagent_debug_logging=0; $pause_to_code_jump=0; $recording_dtmf_muting=0; +$override_phone=0; +$no_hopper_dialing_used=0; +$dial_next_callback=0; $startMS = microtime(); require_once("dbconnect_mysqli.php"); @@ -586,322 +590,474 @@ require_once("functions.php"); ### If you have globals turned off uncomment these lines if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} + else {$server_ip="";} if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} + else {$session_name="";} if (isset($_GET["format"])) {$format=$_GET["format"];} elseif (isset($_POST["format"])) {$format=$_POST["format"];} if (isset($_GET["ACTION"])) {$ACTION=$_GET["ACTION"];} elseif (isset($_POST["ACTION"])) {$ACTION=$_POST["ACTION"];} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} + else {$stage="";} if (isset($_GET["closer_choice"])) {$closer_choice=$_GET["closer_choice"];} elseif (isset($_POST["closer_choice"])) {$closer_choice=$_POST["closer_choice"];} + else {$closer_choice="";} if (isset($_GET["conf_exten"])) {$conf_exten=$_GET["conf_exten"];} elseif (isset($_POST["conf_exten"])) {$conf_exten=$_POST["conf_exten"];} + else {$conf_exten="";} if (isset($_GET["exten"])) {$exten=$_GET["exten"];} elseif (isset($_POST["exten"])) {$exten=$_POST["exten"];} + else {$exten="";} if (isset($_GET["ext_context"])) {$ext_context=$_GET["ext_context"];} elseif (isset($_POST["ext_context"])) {$ext_context=$_POST["ext_context"];} + else {$ext_context="";} if (isset($_GET["ext_priority"])) {$ext_priority=$_GET["ext_priority"];} elseif (isset($_POST["ext_priority"])) {$ext_priority=$_POST["ext_priority"];} + {$ext_priority="";} # Oddly, this is never used if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} + else {$campaign="";} if (isset($_GET["dial_timeout"])) {$dial_timeout=$_GET["dial_timeout"];} elseif (isset($_POST["dial_timeout"])) {$dial_timeout=$_POST["dial_timeout"];} + else {$dial_timeout=0;} if (isset($_GET["dial_prefix"])) {$dial_prefix=$_GET["dial_prefix"];} elseif (isset($_POST["dial_prefix"])) {$dial_prefix=$_POST["dial_prefix"];} + else {$dial_prefix="";} if (isset($_GET["campaign_cid"])) {$campaign_cid=$_GET["campaign_cid"];} elseif (isset($_POST["campaign_cid"])) {$campaign_cid=$_POST["campaign_cid"];} + else {$campaign_cid="";} if (isset($_GET["MDnextCID"])) {$MDnextCID=$_GET["MDnextCID"];} elseif (isset($_POST["MDnextCID"])) {$MDnextCID=$_POST["MDnextCID"];} + else {$MDnextCID="";} if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} + else {$uniqueid="";} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id="";} # checked via strlen, needs to be str if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} + else {$list_id="";} # checked via strlen, needs to be str if (isset($_GET["length_in_sec"])) {$length_in_sec=$_GET["length_in_sec"];} elseif (isset($_POST["length_in_sec"])) {$length_in_sec=$_POST["length_in_sec"];} + else {$length_in_sec=0;} if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} + else {$phone_code="";} if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + else {$phone_number="";} if (isset($_GET["channel"])) {$channel=$_GET["channel"];} elseif (isset($_POST["channel"])) {$channel=$_POST["channel"];} + else {$channel="";} if (isset($_GET["start_epoch"])) {$start_epoch=$_GET["start_epoch"];} elseif (isset($_POST["start_epoch"])) {$start_epoch=$_POST["start_epoch"];} + else {$start_epoch="";} if (isset($_GET["dispo_choice"])) {$dispo_choice=$_GET["dispo_choice"];} elseif (isset($_POST["dispo_choice"])) {$dispo_choice=$_POST["dispo_choice"];} + else {$dispo_choice="";} if (isset($_GET["vendor_lead_code"])) {$vendor_lead_code=$_GET["vendor_lead_code"];} elseif (isset($_POST["vendor_lead_code"])) {$vendor_lead_code=$_POST["vendor_lead_code"];} + else {$vendor_lead_code="";} if (isset($_GET["title"])) {$title=$_GET["title"];} elseif (isset($_POST["title"])) {$title=$_POST["title"];} + else {$title="";} if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} + else {$first_name="";} if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} + else {$middle_initial="";} if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} + else {$last_name="";} if (isset($_GET["address1"])) {$address1=$_GET["address1"];} elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} + else {$address1="";} if (isset($_GET["address2"])) {$address2=$_GET["address2"];} elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} + else {$address2="";} if (isset($_GET["address3"])) {$address3=$_GET["address3"];} elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} + else {$address3="";} if (isset($_GET["city"])) {$city=$_GET["city"];} elseif (isset($_POST["city"])) {$city=$_POST["city"];} + else {$city="";} if (isset($_GET["state"])) {$state=$_GET["state"];} elseif (isset($_POST["state"])) {$state=$_POST["state"];} + else {$state="";} if (isset($_GET["province"])) {$province=$_GET["province"];} elseif (isset($_POST["province"])) {$province=$_POST["province"];} + else {$province="";} if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} + else {$postal_code="";} if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} + else {$country_code="";} if (isset($_GET["gender"])) {$gender=$_GET["gender"];} elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];} + else {$gender="";} if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} + else {$date_of_birth="";} if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} + else {$alt_phone="";} if (isset($_GET["email"])) {$email=$_GET["email"];} elseif (isset($_POST["email"])) {$email=$_POST["email"];} + else {$email="";} if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} + else {$security_phrase="";} if (isset($_GET["comments"])) {$comments=$_GET["comments"];} elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} + else {$comments="";} if (isset($_GET["auto_dial_level"])) {$auto_dial_level=$_GET["auto_dial_level"];} elseif (isset($_POST["auto_dial_level"])) {$auto_dial_level=$_POST["auto_dial_level"];} + else {$auto_dial_level="";} if (isset($_GET["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_GET["VDstop_rec_after_each_call"];} elseif (isset($_POST["VDstop_rec_after_each_call"])) {$VDstop_rec_after_each_call=$_POST["VDstop_rec_after_each_call"];} + else {$VDstop_rec_after_each_call="";} if (isset($_GET["conf_silent_prefix"])) {$conf_silent_prefix=$_GET["conf_silent_prefix"];} elseif (isset($_POST["conf_silent_prefix"])) {$conf_silent_prefix=$_POST["conf_silent_prefix"];} + else {$conf_silent_prefix="";} if (isset($_GET["extension"])) {$extension=$_GET["extension"];} elseif (isset($_POST["extension"])) {$extension=$_POST["extension"];} + else {$extension="";} if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];} elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];} + else {$protocol="";} if (isset($_GET["user_abb"])) {$user_abb=$_GET["user_abb"];} elseif (isset($_POST["user_abb"])) {$user_abb=$_POST["user_abb"];} + else {$user_abb="";} if (isset($_GET["preview"])) {$preview=$_GET["preview"];} elseif (isset($_POST["preview"])) {$preview=$_POST["preview"];} + else {$preview="";} if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} + else {$called_count="";} # checked via strlen, needs to be str if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} + else {$agent_log_id="";} if (isset($_GET["agent_log"])) {$agent_log=$_GET["agent_log"];} elseif (isset($_POST["agent_log"])) {$agent_log=$_POST["agent_log"];} + else {$agent_log="";} if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];} elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];} + else {$favorites_list="";} if (isset($_GET["CallBackDatETimE"])) {$CallBackDatETimE=$_GET["CallBackDatETimE"];} elseif (isset($_POST["CallBackDatETimE"])) {$CallBackDatETimE=$_POST["CallBackDatETimE"];} + else {$CallBackDatETimE="";} if (isset($_GET["recipient"])) {$recipient=$_GET["recipient"];} elseif (isset($_POST["recipient"])) {$recipient=$_POST["recipient"];} + else {$recipient="";} if (isset($_GET["callback_id"])) {$callback_id=$_GET["callback_id"];} elseif (isset($_POST["callback_id"])) {$callback_id=$_POST["callback_id"];} + else {$callback_id="";} if (isset($_GET["use_internal_dnc"])) {$use_internal_dnc=$_GET["use_internal_dnc"];} elseif (isset($_POST["use_internal_dnc"])) {$use_internal_dnc=$_POST["use_internal_dnc"];} + else {$use_internal_dnc="";} if (isset($_GET["use_campaign_dnc"])) {$use_campaign_dnc=$_GET["use_campaign_dnc"];} elseif (isset($_POST["use_campaign_dnc"])) {$use_campaign_dnc=$_POST["use_campaign_dnc"];} + else {$use_campaign_dnc="";} if (isset($_GET["omit_phone_code"])) {$omit_phone_code=$_GET["omit_phone_code"];} elseif (isset($_POST["omit_phone_code"])) {$omit_phone_code=$_POST["omit_phone_code"];} + else {$omit_phone_code="";} if (isset($_GET["phone_ip"])) {$phone_ip=$_GET["phone_ip"];} elseif (isset($_POST["phone_ip"])) {$phone_ip=$_POST["phone_ip"];} + else {$phone_ip="";} if (isset($_GET["enable_sipsak_messages"])) {$enable_sipsak_messages=$_GET["enable_sipsak_messages"];} elseif (isset($_POST["enable_sipsak_messages"])) {$enable_sipsak_messages=$_POST["enable_sipsak_messages"];} + else {$enable_sipsak_messages=0;} if (isset($_GET["status"])) {$status=$_GET["status"];} elseif (isset($_POST["status"])) {$status=$_POST["status"];} + else {$status="";} if (isset($_GET["LogouTKicKAlL"])) {$LogouTKicKAlL=$_GET["LogouTKicKAlL"];} elseif (isset($_POST["LogouTKicKAlL"])) {$LogouTKicKAlL=$_POST["LogouTKicKAlL"];} + else {$LogouTKicKAlL=0;} if (isset($_GET["closer_blended"])) {$closer_blended=$_GET["closer_blended"];} elseif (isset($_POST["closer_blended"])) {$closer_blended=$_POST["closer_blended"];} + else {$closer_blended="";} if (isset($_GET["inOUT"])) {$inOUT=$_GET["inOUT"];} elseif (isset($_POST["inOUT"])) {$inOUT=$_POST["inOUT"];} + else {$inOUT="";} if (isset($_GET["manual_dial_filter"])) {$manual_dial_filter=$_GET["manual_dial_filter"];} elseif (isset($_POST["manual_dial_filter"])) {$manual_dial_filter=$_POST["manual_dial_filter"];} + else {$manual_dial_filter="";} if (isset($_GET["alt_dial"])) {$alt_dial=$_GET["alt_dial"];} elseif (isset($_POST["alt_dial"])) {$alt_dial=$_POST["alt_dial"];} + else {$alt_dial="";} if (isset($_GET["agentchannel"])) {$agentchannel=$_GET["agentchannel"];} elseif (isset($_POST["agentchannel"])) {$agentchannel=$_POST["agentchannel"];} + else {$agentchannel="";} if (isset($_GET["conf_dialed"])) {$conf_dialed=$_GET["conf_dialed"];} elseif (isset($_POST["conf_dialed"])) {$conf_dialed=$_POST["conf_dialed"];} + else {$conf_dialed="";} if (isset($_GET["leaving_threeway"])) {$leaving_threeway=$_GET["leaving_threeway"];} elseif (isset($_POST["leaving_threeway"])) {$leaving_threeway=$_POST["leaving_threeway"];} + else {$leaving_threeway=0;} if (isset($_GET["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_GET["hangup_all_non_reserved"];} elseif (isset($_POST["hangup_all_non_reserved"])) {$hangup_all_non_reserved=$_POST["hangup_all_non_reserved"];} + else {$hangup_all_non_reserved=0;} if (isset($_GET["blind_transfer"])) {$blind_transfer=$_GET["blind_transfer"];} elseif (isset($_POST["blind_transfer"])) {$blind_transfer=$_POST["blind_transfer"];} + else {$blind_transfer="";} if (isset($_GET["usegroupalias"])) {$usegroupalias=$_GET["usegroupalias"];} elseif (isset($_POST["usegroupalias"])) {$usegroupalias=$_POST["usegroupalias"];} + else {$usegroupalias=0;} if (isset($_GET["account"])) {$account=$_GET["account"];} elseif (isset($_POST["account"])) {$account=$_POST["account"];} + else {$account="";} if (isset($_GET["agent_dialed_number"])) {$agent_dialed_number=$_GET["agent_dialed_number"];} elseif (isset($_POST["agent_dialed_number"])) {$agent_dialed_number=$_POST["agent_dialed_number"];} + else {$agent_dialed_number="";} if (isset($_GET["agent_dialed_type"])) {$agent_dialed_type=$_GET["agent_dialed_type"];} elseif (isset($_POST["agent_dialed_type"])) {$agent_dialed_type=$_POST["agent_dialed_type"];} + else {$agent_dialed_type="";} if (isset($_GET["wrapup"])) {$wrapup=$_GET["wrapup"];} elseif (isset($_POST["wrapup"])) {$wrapup=$_POST["wrapup"];} + else {$wrapup="";} if (isset($_GET["vtiger_callback_id"])) {$vtiger_callback_id=$_GET["vtiger_callback_id"];} elseif (isset($_POST["vtiger_callback_id"])) {$vtiger_callback_id=$_POST["vtiger_callback_id"];} + else {$vtiger_callback_id=0;} if (isset($_GET["dial_method"])) {$dial_method=$_GET["dial_method"];} elseif (isset($_POST["dial_method"])) {$dial_method=$_POST["dial_method"];} + else {$dial_method="";} if (isset($_GET["no_delete_sessions"])) {$no_delete_sessions=$_GET["no_delete_sessions"];} elseif (isset($_POST["no_delete_sessions"])) {$no_delete_sessions=$_POST["no_delete_sessions"];} + else {$no_delete_sessions=0;} if (isset($_GET["nodeletevdac"])) {$nodeletevdac=$_GET["nodeletevdac"];} elseif (isset($_POST["nodeletevdac"])) {$nodeletevdac=$_POST["nodeletevdac"];} + else {$nodeletevdac=0;} if (isset($_GET["agent_territories"])) {$agent_territories=$_GET["agent_territories"];} elseif (isset($_POST["agent_territories"])) {$agent_territories=$_POST["agent_territories"];} + else {$agent_territories="";} if (isset($_GET["alt_num_status"])) {$alt_num_status=$_GET["alt_num_status"];} elseif (isset($_POST["alt_num_status"])) {$alt_num_status=$_POST["alt_num_status"];} + else {$alt_num_status="";} if (isset($_GET["DiaL_SecondS"])) {$DiaL_SecondS=$_GET["DiaL_SecondS"];} elseif (isset($_POST["DiaL_SecondS"])) {$DiaL_SecondS=$_POST["DiaL_SecondS"];} + else {$DiaL_SecondS=0;} if (isset($_GET["date"])) {$date=$_GET["date"];} elseif (isset($_POST["date"])) {$date=$_POST["date"];} + else {$date="";} if (isset($_GET["custom_field_names"])) {$FORMcustom_field_names=$_GET["custom_field_names"];} elseif (isset($_POST["custom_field_names"])) {$FORMcustom_field_names=$_POST["custom_field_names"];} + else {$FORMcustom_field_names="";} if (isset($_GET["qm_phone"])) {$qm_phone=$_GET["qm_phone"];} elseif (isset($_POST["qm_phone"])) {$qm_phone=$_POST["qm_phone"];} + else {$qm_phone="";} if (isset($_GET["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_GET["manual_dial_call_time_check"];} elseif (isset($_POST["manual_dial_call_time_check"])) {$manual_dial_call_time_check=$_POST["manual_dial_call_time_check"];} + else {$manual_dial_call_time_check="";} if (isset($_GET["CallBackLeadStatus"])) {$CallBackLeadStatus=$_GET["CallBackLeadStatus"];} elseif (isset($_POST["CallBackLeadStatus"])) {$CallBackLeadStatus=$_POST["CallBackLeadStatus"];} + else {$CallBackLeadStatus="";} if (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} elseif (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} + else {$call_notes="";} if (isset($_GET["search"])) {$search=$_GET["search"];} elseif (isset($_POST["search"])) {$search=$_POST["search"];} + else {$search="";} if (isset($_GET["sub_status"])) {$sub_status=$_GET["sub_status"];} elseif (isset($_POST["sub_status"])) {$sub_status=$_POST["sub_status"];} + else {$sub_status="";} if (isset($_GET["qm_extension"])) {$qm_extension=$_GET["qm_extension"];} elseif (isset($_POST["qm_extension"])) {$qm_extension=$_POST["qm_extension"];} + else {$qm_extension="";} if (isset($_GET["disable_alter_custphone"])) {$disable_alter_custphone=$_GET["disable_alter_custphone"];} elseif (isset($_POST["disable_alter_custphone"])) {$disable_alter_custphone=$_POST["disable_alter_custphone"];} + else {$disable_alter_custphone="";} if (isset($_GET["bu_name"])) {$bu_name=$_GET["bu_name"];} elseif (isset($_POST["bu_name"])) {$bu_name=$_POST["bu_name"];} + else {$bu_name="";} if (isset($_GET["department"])) {$department=$_GET["department"];} elseif (isset($_POST["department"])) {$department=$_POST["department"];} + else {$department="";} if (isset($_GET["group_name"])) {$group_name=$_GET["group_name"];} elseif (isset($_POST["group_name"])) {$group_name=$_POST["group_name"];} + else {$group_name="";} if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} + else {$group="";} if (isset($_GET["job_title"])) {$job_title=$_GET["job_title"];} elseif (isset($_POST["job_title"])) {$job_title=$_POST["job_title"];} + else {$job_title="";} if (isset($_GET["location"])) {$location=$_GET["location"];} elseif (isset($_POST["location"])) {$location=$_POST["location"];} + else {$location="";} if (isset($_GET["old_CID"])) {$old_CID=$_GET["old_CID"];} elseif (isset($_POST["old_CID"])) {$old_CID=$_POST["old_CID"];} + else {$old_CID="";} if (isset($_GET["qm_dispo_code"])) {$qm_dispo_code=$_GET["qm_dispo_code"];} elseif (isset($_POST["qm_dispo_code"])) {$qm_dispo_code=$_POST["qm_dispo_code"];} + else {$qm_dispo_code="";} if (isset($_GET["dial_ingroup"])) {$dial_ingroup=$_GET["dial_ingroup"];} elseif (isset($_POST["dial_ingroup"])) {$dial_ingroup=$_POST["dial_ingroup"];} + else {$dial_ingroup="";} if (isset($_GET["nocall_dial_flag"])) {$nocall_dial_flag=$_GET["nocall_dial_flag"];} elseif (isset($_POST["nocall_dial_flag"])) {$nocall_dial_flag=$_POST["nocall_dial_flag"];} + else {$nocall_dial_flag="";} if (isset($_GET["inbound_lead_search"])) {$inbound_lead_search=$_GET["inbound_lead_search"];} elseif (isset($_POST["inbound_lead_search"])) {$inbound_lead_search=$_POST["inbound_lead_search"];} + else {$inbound_lead_search=0;} if (isset($_GET["email_enabled"])) {$email_enabled=$_GET["email_enabled"];} elseif (isset($_POST["email_enabled"])) {$email_enabled=$_POST["email_enabled"];} + else {$email_enabled=0;} if (isset($_GET["email_row_id"])) {$email_row_id=$_GET["email_row_id"];} elseif (isset($_POST["email_row_id"])) {$email_row_id=$_POST["email_row_id"];} + else {$email_row_id="";} if (isset($_GET["inbound_email_groups"])) {$inbound_email_groups=$_GET["inbound_email_groups"];} elseif (isset($_POST["inbound_email_groups"])) {$inbound_email_groups=$_POST["inbound_email_groups"];} + else {$inbound_email_groups="";} if (isset($_GET["inbound_chat_groups"])) {$inbound_chat_groups=$_GET["inbound_chat_groups"];} elseif (isset($_POST["inbound_chat_groups"])) {$inbound_chat_groups=$_POST["inbound_chat_groups"];} if (isset($_GET["recording_id"])) {$recording_id=$_GET["recording_id"];} elseif (isset($_POST["recording_id"])) {$recording_id=$_POST["recording_id"];} + else {$recording_id="";} # Set to "" instead of 0 due to strlen check if (isset($_GET["recording_filename"])) {$recording_filename=$_GET["recording_filename"];} elseif (isset($_POST["recording_filename"])) {$recording_filename=$_POST["recording_filename"];} + else {$recording_filename="";} if (isset($_GET["orig_pass"])) {$orig_pass=$_GET["orig_pass"];} elseif (isset($_POST["orig_pass"])) {$orig_pass=$_POST["orig_pass"];} + else {$orig_pass="";} if (isset($_GET["cid_lock"])) {$cid_lock=$_GET["cid_lock"];} elseif (isset($_POST["cid_lock"])) {$cid_lock=$_POST["cid_lock"];} + else {$cid_lock=0;} # Numeric, as all checks treat as such if (isset($_GET["dispo_comments"])) {$dispo_comments=$_GET["dispo_comments"];} elseif (isset($_POST["dispo_comments"])) {$dispo_comments=$_POST["dispo_comments"];} + else {$dispo_comments="";} if (isset($_GET["cbcomment_comments"])) {$cbcomment_comments=$_GET["cbcomment_comments"];} elseif (isset($_POST["cbcomment_comments"])) {$cbcomment_comments=$_POST["cbcomment_comments"];} + else {$cbcomment_comments="";} if (isset($_GET["parked_hangup"])) {$parked_hangup=$_GET["parked_hangup"];} elseif (isset($_POST["parked_hangup"])) {$parked_hangup=$_POST["parked_hangup"];} + else {$parked_hangup="";} if (isset($_GET["pause_trigger"])) {$pause_trigger=$_GET["pause_trigger"];} elseif (isset($_POST["pause_trigger"])) {$pause_trigger=$_POST["pause_trigger"];} + else {$pause_trigger="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["in_script"])) {$in_script=$_GET["in_script"];} elseif (isset($_POST["in_script"])) {$in_script=$_POST["in_script"];} + else {$in_script="";} if (isset($_GET["camp_script"])) {$camp_script=$_GET["camp_script"];} elseif (isset($_POST["camp_script"])) {$camp_script=$_POST["camp_script"];} + else {$camp_script="";} if (isset($_GET["manual_dial_search_filter"])) {$manual_dial_search_filter=$_GET["manual_dial_search_filter"];} elseif (isset($_POST["manual_dial_search_filter"])) {$manual_dial_search_filter=$_POST["manual_dial_search_filter"];} + else {$manual_dial_search_filter="";} if (isset($_GET["url_ids"])) {$url_ids=$_GET["url_ids"];} elseif (isset($_POST["url_ids"])) {$url_ids=$_POST["url_ids"];} + else {$url_ids="";} if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} + else {$phone_login="";} if (isset($_GET["agent_email"])) {$agent_email=$_GET["agent_email"];} elseif (isset($_POST["agent_email"])) {$agent_email=$_POST["agent_email"];} + else {$agent_email="";} if (isset($_GET["original_phone_login"])) {$original_phone_login=$_GET["original_phone_login"];} elseif (isset($_POST["original_phone_login"])) {$original_phone_login=$_POST["original_phone_login"];} + else {$original_phone_login="";} if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} + else {$customer_zap_channel="";} if (isset($_GET["customer_server_ip"])) {$customer_server_ip=$_GET["customer_server_ip"];} elseif (isset($_POST["customer_server_ip"])) {$customer_server_ip=$_POST["customer_server_ip"];} + else {$customer_server_ip="";} if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} + else {$phone_pass="";} if (isset($_GET["VDRP_stage"])) {$VDRP_stage=$_GET["VDRP_stage"];} elseif (isset($_POST["VDRP_stage"])) {$VDRP_stage=$_POST["VDRP_stage"];} + else {$VDRP_stage="";} if (isset($_GET["previous_agent_log_id"])) {$previous_agent_log_id=$_GET["previous_agent_log_id"];} elseif (isset($_POST["previous_agent_log_id"])) {$previous_agent_log_id=$_POST["previous_agent_log_id"];} + else {$previous_agent_log_id="";} # Never used if (isset($_GET["last_VDRP_stage"])) {$last_VDRP_stage=$_GET["last_VDRP_stage"];} elseif (isset($_POST["last_VDRP_stage"])) {$last_VDRP_stage=$_POST["last_VDRP_stage"];} + else {$last_VDRP_stage="";} if (isset($_GET["url_link"])) {$url_link=$_GET["url_link"];} elseif (isset($_POST["url_link"])) {$url_link=$_POST["url_link"];} + else {$url_link="";} if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} + else {$user_group="";} if (isset($_GET["MgrApr_user"])) {$MgrApr_user=$_GET["MgrApr_user"];} elseif (isset($_POST["MgrApr_user"])) {$MgrApr_user=$_POST["MgrApr_user"];} + else {$MgrApr_user="";} if (isset($_GET["MgrApr_pass"])) {$MgrApr_pass=$_GET["MgrApr_pass"];} elseif (isset($_POST["MgrApr_pass"])) {$MgrApr_pass=$_POST["MgrApr_pass"];} + else {$MgrApr_pass="";} if (isset($_GET["routing_initiated_recording"])) {$routing_initiated_recording=$_GET["routing_initiated_recording"];} elseif (isset($_POST["routing_initiated_recording"])) {$routing_initiated_recording=$_POST["routing_initiated_recording"];} + else {$routing_initiated_recording="";} if (isset($_GET["dead_time"])) {$dead_time=$_GET["dead_time"];} elseif (isset($_POST["dead_time"])) {$dead_time=$_POST["dead_time"];} + else {$dead_time=0;} if (isset($_GET["callback_gmt_offset"])) {$callback_gmt_offset=$_GET["callback_gmt_offset"];} elseif (isset($_POST["callback_gmt_offset"])) {$callback_gmt_offset=$_POST["callback_gmt_offset"];} + else {$callback_gmt_offset="";} if (isset($_GET["callback_timezone"])) {$callback_timezone=$_GET["callback_timezone"];} elseif (isset($_POST["callback_timezone"])) {$callback_timezone=$_POST["callback_timezone"];} + else {$callback_timezone="";} if (isset($_GET["manual_dial_validation"])) {$manual_dial_validation=$_GET["manual_dial_validation"];} elseif (isset($_POST["manual_dial_validation"])) {$manual_dial_validation=$_POST["manual_dial_validation"];} + else {$manual_dial_validation="";} if (isset($_GET["start_date"])) {$start_date=$_GET["start_date"];} elseif (isset($_POST["start_date"])){$start_date=$_POST["start_date"];} + else {$start_date=0;} if (isset($_GET["end_date"])) {$end_date=$_GET["end_date"];} elseif (isset($_POST["end_date"])) {$end_date=$_POST["end_date"];} + else {$end_date="";} if (isset($_GET["customer_sec"])) {$customer_sec=$_GET["customer_sec"];} elseif (isset($_POST["customer_sec"])) {$customer_sec=$_POST["customer_sec"];} + else {$customer_sec=0;} if (isset($_GET["leave_3way_start_recording_trigger"])) {$leave_3way_start_recording_trigger=$_GET["leave_3way_start_recording_trigger"];} elseif (isset($_POST["leave_3way_start_recording_trigger"])) {$leave_3way_start_recording_trigger=$_POST["leave_3way_start_recording_trigger"];} + else {$leave_3way_start_recording_trigger=0;} if (isset($_GET["leave_3way_start_recording_filename"])) {$leave_3way_start_recording_filename=$_GET["leave_3way_start_recording_filename"];} elseif (isset($_POST["leave_3way_start_recording_filename"])) {$leave_3way_start_recording_filename=$_POST["leave_3way_start_recording_filename"];} + else {$leave_3way_start_recording_filename="";} if (isset($_GET["channelrec"])) {$channelrec=$_GET["channelrec"];} elseif (isset($_POST["channelrec"])) {$channelrec=$_POST["channelrec"];} + else {$channelrec="";} if (isset($_GET["calls_waiting_vl_oneLABEL"])) {$calls_waiting_vl_oneLABEL=$_GET["calls_waiting_vl_oneLABEL"];} elseif (isset($_POST["calls_waiting_vl_oneLABEL"])) {$calls_waiting_vl_oneLABEL=$_POST["calls_waiting_vl_oneLABEL"];} + else {$calls_waiting_vl_oneLABEL="";} if (isset($_GET["calls_waiting_vl_twoLABEL"])) {$calls_waiting_vl_twoLABEL=$_GET["calls_waiting_vl_twoLABEL"];} elseif (isset($_POST["calls_waiting_vl_twoLABEL"])) {$calls_waiting_vl_twoLABEL=$_POST["calls_waiting_vl_twoLABEL"];} + else {$calls_waiting_vl_twoLABEL="";} if (isset($_GET["pause_max_url_trigger"])) {$pause_max_url_trigger=$_GET["pause_max_url_trigger"];} elseif (isset($_POST["pause_max_url_trigger"])) {$pause_max_url_trigger=$_POST["pause_max_url_trigger"];} + else {$pause_max_url_trigger=0;} if (isset($_GET["inbound_ingroup"])) {$inbound_ingroup=$_GET["inbound_ingroup"];} elseif (isset($_POST["inbound_ingroup"])) {$inbound_ingroup=$_POST["inbound_ingroup"];} + else {$inbound_ingroup="";} if (isset($_GET["manual_minimum_ring_seconds"])) {$manual_minimum_ring_seconds=$_GET["manual_minimum_ring_seconds"];} elseif (isset($_POST["manual_minimum_ring_seconds"])) {$manual_minimum_ring_seconds=$_POST["manual_minimum_ring_seconds"];} + else {$manual_minimum_ring_seconds=0;} if (isset($_GET["manual_minimum_ringing"])) {$manual_minimum_ringing=$_GET["manual_minimum_ringing"];} elseif (isset($_POST["manual_minimum_ringing"])) {$manual_minimum_ringing=$_POST["manual_minimum_ringing"];} + else {$manual_minimum_ringing=0;} if (isset($_GET["stereo_recording"])) {$stereo_recording=$_GET["stereo_recording"];} elseif (isset($_POST["stereo_recording"])) {$stereo_recording=$_POST["stereo_recording"];} + else {$stereo_recording="";} -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); $user=preg_replace("/\'|\"|\\\\|;| /","",$user); $pass=preg_replace("/\'|\"|\\\\|;| /","",$pass); $allow_vlc_lookup = '1'; # allow lead lookup by vendor_lead_code +$MqueryCID=''; # if options file exists, use the override values for the above variables # see the options-example.php file for more information @@ -1136,12 +1292,11 @@ if ($qm_conf_ct > 0) $SSrecording_dtmf_detection = $row[28]; $SSrecording_dtmf_muting = $row[29]; } -if ($SSallow_web_debug < 1) {$DB=0; $format='text';} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0; $format="text";} +$DB=preg_replace("/[^0-9]/","",$DB); ##### END SETTINGS LOOKUP ##### ########################################### -$session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); -$server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); $alt_phone = preg_replace("/\s/","",$alt_phone); $phone_code = preg_replace("/\s/","",$phone_code); $phone_number = preg_replace("/\s/","",$phone_number); @@ -1149,68 +1304,34 @@ $campaign = preg_replace("/\'|\"|\\\\|;/","",$campaign); $closer_choice = preg_replace("/\'|\"|\\\\|;/","",$closer_choice); $lead_id = preg_replace('/[^0-9]/','',$lead_id); $list_id = preg_replace('/[^0-9]/','',$list_id); -$conf_exten = preg_replace('/[^-_\.0-9a-zA-Z]/','',$conf_exten); -$uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); $length_in_sec = preg_replace('/[^0-9]/','',$length_in_sec); -$CallBackDatETimE = preg_replace('/[^- \:_0-9a-zA-Z]/','',$CallBackDatETimE); -$CallBackLeadStatus = preg_replace('/[^-_0-9a-zA-Z]/','',$CallBackLeadStatus); $DB = preg_replace('/[^0-9]/','',$DB); $DiaL_SecondS = preg_replace('/[^0-9]/','',$DiaL_SecondS); $LogouTKicKAlL = preg_replace('/[^0-9]/','',$LogouTKicKAlL); -$MDnextCID = preg_replace('/[^- _0-9a-zA-Z]/','',$MDnextCID); -$VDRP_stage = preg_replace('/[^-_0-9a-zA-Z]/','',$VDRP_stage); -$VDstop_rec_after_each_call = preg_replace('/[^-_0-9a-zA-Z]/','',$VDstop_rec_after_each_call); -$account = preg_replace('/[^-_0-9a-zA-Z]/','',$account); -$agent_dialed_number = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_dialed_number); -$agent_dialed_type = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_dialed_type); $agent_email = preg_replace("/\'|\"|\\\\|;/","",$agent_email); -$agent_log = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_log); -$agent_log_id = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_log_id); $agentchannel = preg_replace("/\'|\"|\\\\/","",$agentchannel); -$alt_dial = preg_replace('/[^-_0-9a-zA-Z]/','',$alt_dial); -$auto_dial_level = preg_replace('/[^-\._0-9a-zA-Z]/','',$auto_dial_level); -$blind_transfer = preg_replace('/[^-_0-9a-zA-Z]/','',$blind_transfer); -$callback_id = preg_replace('/[^-_0-9a-zA-Z]/','',$callback_id); $called_count = preg_replace('/[^0-9]/','',$called_count); $channel = preg_replace("/\'|\"|\\\\/","",$channel); $cid_lock = preg_replace('/[^0-9]/','',$cid_lock); -$closer_blended = preg_replace('/[^-_0-9a-zA-Z]/','',$closer_blended); -$conf_dialed = preg_replace('/[^-_0-9a-zA-Z]/','',$conf_dialed); -$conf_silent_prefix = preg_replace('/[^-_0-9a-zA-Z]/','',$conf_silent_prefix); -$custom_field_names = preg_replace("/\'|\"|\\\\|;/","",$custom_field_names); +# $custom_field_names = preg_replace("/\'|\"|\\\\|;/","",$custom_field_names); # Removed, this isn't defined until later $customer_server_ip = preg_replace("/\'|\"|\\\\|;/","",$customer_server_ip); $customer_zap_channel = preg_replace("/\'|\"|\\\\/","",$customer_zap_channel); $date = preg_replace('/[^-_0-9]/','',$date); $dial_timeout = preg_replace('/[^0-9]/','',$dial_timeout); -$disable_alter_custphone = preg_replace('/[^-_0-9a-zA-Z]/','',$disable_alter_custphone); $email_enabled = preg_replace('/[^0-9]/','',$email_enabled); -$email_row_id = preg_replace('/[^-_0-9a-zA-Z]/','',$email_row_id); $enable_sipsak_messages = preg_replace('/[^0-9]/','',$enable_sipsak_messages); -$ext_priority = preg_replace('/[^-_0-9a-zA-Z]/','',$ext_priority); $exten = preg_replace("/\'|\"|\\\\|;/","",$exten); $extension = preg_replace("/\'|\"|\\\\|;/","",$extension); $favorites_list = preg_replace("/\"|\\\\|;/","",$favorites_list); -$format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); -$gender = preg_replace('/[^-_0-9a-zA-Z]/','',$gender); $group_name = preg_replace("/\'|\"|\\\\|;/","",$group_name); $hangup_all_non_reserved = preg_replace('/[^0-9]/','',$hangup_all_non_reserved); -$inOUT = preg_replace('/[^-_0-9a-zA-Z]/','',$inOUT); $inbound_lead_search = preg_replace('/[^0-9]/','',$inbound_lead_search); -$last_VDRP_stage = preg_replace('/[^-_0-9a-zA-Z]/','',$last_VDRP_stage); $leaving_threeway = preg_replace('/[^0-9]/','',$leaving_threeway); -$manual_dial_call_time_check = preg_replace('/[^-_0-9a-zA-Z]/','',$manual_dial_call_time_check); $no_delete_sessions = preg_replace('/[^0-9]/','',$no_delete_sessions); -$nocall_dial_flag = preg_replace('/[^-_0-9a-zA-Z]/','',$nocall_dial_flag); $nodeletevdac = preg_replace('/[^0-9]/','',$nodeletevdac); -$omit_phone_code = preg_replace('/[^-_0-9a-zA-Z]/','',$omit_phone_code); $original_phone_login = preg_replace("/\'|\"|\\\\|;/","",$original_phone_login); -$parked_hangup = preg_replace('/[^-_0-9a-zA-Z]/','',$parked_hangup); -$pause_trigger = preg_replace('/[^-_0-9a-zA-Z]/','',$pause_trigger); $phone_login = preg_replace("/\'|\"|\\\\|;/","",$phone_login); $phone_pass = preg_replace("/\'|\"|\\\\|;/","",$phone_pass); -$preview = preg_replace('/[^-_0-9a-zA-Z]/','',$preview); -$previous_agent_log_id = preg_replace('/[^-_0-9a-zA-Z]/','',$previous_agent_log_id); -$protocol = preg_replace('/[^-_0-9a-zA-Z]/','',$protocol); $qm_extension = preg_replace("/\'|\"|\\\\|;/","",$qm_extension); $qm_phone = preg_replace("/\'|\"|\\\\|;/","",$qm_phone); $recording_filename = preg_replace("/\'|\"|\\\\|;/","",$recording_filename); @@ -1218,29 +1339,19 @@ $recording_id = preg_replace('/[^0-9]/','',$recording_id); $stage = preg_replace("/\'|\"|\\\\|;/","",$stage); $start_epoch = preg_replace("/\'|\"|\\\\|;/","",$start_epoch); $url_ids = preg_replace("/\'|\"|\\\\|;/","",$url_ids); -$use_campaign_dnc = preg_replace('/[^-_0-9a-zA-Z]/','',$use_campaign_dnc); -$use_internal_dnc = preg_replace('/[^-_0-9a-zA-Z]/','',$use_internal_dnc); $usegroupalias = preg_replace('/[^0-9]/','',$usegroupalias); $user_abb = preg_replace("/\'|\"|\\\\|;/","",$user_abb); $vtiger_callback_id = preg_replace("/\'|\"|\\\\|;/","",$vtiger_callback_id); $wrapup = preg_replace("/\'|\"|\\\\|;/","",$wrapup); $url_link = preg_replace("/\'|\"|\\\\|;/","",$url_link); -$routing_initiated_recording = preg_replace('/[^-_0-9a-zA-Z]/','',$routing_initiated_recording); $dead_time = preg_replace('/[^0-9]/','',$dead_time); -$callback_gmt_offset = preg_replace('/[^- \._0-9a-zA-Z]/','',$callback_gmt_offset); -$callback_timezone = preg_replace('/[^-, _0-9a-zA-Z]/','',$callback_timezone); -$manual_dial_validation = preg_replace('/[^-_0-9a-zA-Z]/','',$manual_dial_validation); $start_date = preg_replace('/[^-_0-9]/','',$start_date); $end_date = preg_replace('/[^-_0-9]/','',$end_date); -$customer_sec = preg_replace('/[^-_0-9]/','',$customer_sec); +$customer_sec = preg_replace('/[^-0-9]/','',$customer_sec); # Removed underscore - used for comparison with an integer thus leaving the underscore won't work in PHP8 $leave_3way_start_recording_trigger = preg_replace('/[^0-9]/','',$leave_3way_start_recording_trigger); -$leave_3way_start_recording_filename = preg_replace('/[^-_0-9a-zA-Z]/','',$leave_3way_start_recording_filename); $channelrec = preg_replace("/\'|\"|\\\\|;/","",$channelrec); -$pause_max_url_trigger = preg_replace('/[^0-9]/','',$pause_max_url_trigger); -$ACTION = preg_replace('/[^-_0-9a-zA-Z]/','',$ACTION); $manual_minimum_ring_seconds = preg_replace('/[^0-9]/','',$manual_minimum_ring_seconds); $manual_minimum_ringing = preg_replace('/[^0-9]/','',$manual_minimum_ringing); -$stereo_recording = preg_replace('/[^-_0-9a-zA-Z]/','',$stereo_recording); $vendor_lead_code = preg_replace("/\"|\\\\|;/",'-',$vendor_lead_code); $title = preg_replace("/\"|\\\\|;/",'-',$title); $first_name = preg_replace("/\"|\\\\|;/",'-',$first_name); @@ -1282,23 +1393,70 @@ if ($non_latin < 1) $status = preg_replace("/[^-_0-9a-zA-Z]/","",$status); $MgrApr_user = preg_replace("/[^-_0-9a-zA-Z]/","",$MgrApr_user); $MgrApr_pass = preg_replace("/[^-_0-9a-zA-Z]/","",$MgrApr_pass); + + $ACTION = preg_replace('/[^-_0-9a-zA-Z]/','',$ACTION); + $CallBackDatETimE = preg_replace('/[^- \:_0-9a-zA-Z]/','',$CallBackDatETimE); + $CallBackLeadStatus = preg_replace('/[^-_0-9a-zA-Z]/','',$CallBackLeadStatus); + $MDnextCID = preg_replace('/[^- _0-9a-zA-Z]/','',$MDnextCID); + $VDRP_stage = preg_replace('/[^-_0-9a-zA-Z]/','',$VDRP_stage); + $VDstop_rec_after_each_call = preg_replace('/[^-_0-9a-zA-Z]/','',$VDstop_rec_after_each_call); + $account = preg_replace('/[^-_0-9a-zA-Z]/','',$account); + $agent_dialed_number = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_dialed_number); + $agent_dialed_type = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_dialed_type); + $agent_log = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_log); + $agent_log_id = preg_replace('/[^-_0-9a-zA-Z]/','',$agent_log_id); $agent_territories = preg_replace('/[^- _0-9a-zA-Z]/','',$agent_territories); + $alt_dial = preg_replace('/[^-_0-9a-zA-Z]/','',$alt_dial); $alt_num_status = preg_replace('/[^-_0-9a-zA-Z]/','',$alt_num_status); + $auto_dial_level = preg_replace('/[^-\._0-9a-zA-Z]/','',$auto_dial_level); + $blind_transfer = preg_replace('/[^-_0-9a-zA-Z]/','',$blind_transfer); + $callback_gmt_offset = preg_replace('/[^- \._0-9a-zA-Z]/','',$callback_gmt_offset); + $callback_id = preg_replace('/[^-_0-9a-zA-Z]/','',$callback_id); + $callback_timezone = preg_replace('/[^-, _0-9a-zA-Z]/','',$callback_timezone); $camp_script = preg_replace('/[^-_0-9a-zA-Z]/','',$camp_script); $campaign_cid = preg_replace('/[^-_0-9a-zA-Z]/','',$campaign_cid); + $closer_blended = preg_replace('/[^-_0-9a-zA-Z]/','',$closer_blended); + $conf_dialed = preg_replace('/[^-_0-9a-zA-Z]/','',$conf_dialed); + $conf_exten = preg_replace('/[^-_\.0-9a-zA-Z]/','',$conf_exten); + $conf_silent_prefix = preg_replace('/[^-_0-9a-zA-Z]/','',$conf_silent_prefix); $dial_ingroup = preg_replace('/[^-_0-9a-zA-Z]/','',$dial_ingroup); $dial_method = preg_replace('/[^-_0-9a-zA-Z]/','',$dial_method); $dial_prefix = preg_replace('/[^-_0-9a-zA-Z]/','',$dial_prefix); + $disable_alter_custphone = preg_replace('/[^-_0-9a-zA-Z]/','',$disable_alter_custphone); $dispo_choice = preg_replace('/[^-_0-9a-zA-Z]/','',$dispo_choice); + $email_row_id = preg_replace('/[^-_0-9a-zA-Z]/','',$email_row_id); $ext_context = preg_replace('/[^-_0-9a-zA-Z]/','',$ext_context); + $ext_priority = preg_replace('/[^-_0-9a-zA-Z]/','',$ext_priority); + $format = preg_replace('/[^-_0-9a-zA-Z]/','',$format); + $gender = preg_replace('/[^-_0-9a-zA-Z]/','',$gender); + $inOUT = preg_replace('/[^-_0-9a-zA-Z]/','',$inOUT); $in_script = preg_replace('/[^-_0-9a-zA-Z]/','',$in_script); + $last_VDRP_stage = preg_replace('/[^-_0-9a-zA-Z]/','',$last_VDRP_stage); + $leave_3way_start_recording_filename = preg_replace('/[^-_0-9a-zA-Z]/','',$leave_3way_start_recording_filename); + $manual_dial_call_time_check = preg_replace('/[^-_0-9a-zA-Z]/','',$manual_dial_call_time_check); $manual_dial_filter = preg_replace('/[^-_0-9a-zA-Z]/','',$manual_dial_filter); $manual_dial_search_filter = preg_replace('/[^-_0-9a-zA-Z]/','',$manual_dial_search_filter); + $manual_dial_validation = preg_replace('/[^-_0-9a-zA-Z]/','',$manual_dial_validation); + $nocall_dial_flag = preg_replace('/[^-_0-9a-zA-Z]/','',$nocall_dial_flag); $old_CID = preg_replace('/[^- _0-9a-zA-Z]/','',$old_CID); + $omit_phone_code = preg_replace('/[^-_0-9a-zA-Z]/','',$omit_phone_code); + $parked_hangup = preg_replace('/[^-_0-9a-zA-Z]/','',$parked_hangup); + $pause_max_url_trigger = preg_replace('/[^0-9]/','',$pause_max_url_trigger); + $pause_trigger = preg_replace('/[^-_0-9a-zA-Z]/','',$pause_trigger); + $preview = preg_replace('/[^-_0-9a-zA-Z]/','',$preview); + $previous_agent_log_id = preg_replace('/[^-_0-9a-zA-Z]/','',$previous_agent_log_id); + $protocol = preg_replace('/[^-_0-9a-zA-Z]/','',$protocol); $qm_dispo_code = preg_replace('/[^-_0-9a-zA-Z]/','',$qm_dispo_code); $recipient = preg_replace('/[^-_0-9a-zA-Z]/','',$recipient); + $routing_initiated_recording = preg_replace('/[^-_0-9a-zA-Z]/','',$routing_initiated_recording); $search = preg_replace('/[^-_0-9a-zA-Z]/','',$search); + $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); + $session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name); + $stereo_recording = preg_replace('/[^-_0-9a-zA-Z]/','',$stereo_recording); $sub_status = preg_replace('/[^-_0-9a-zA-Z]/','',$sub_status); + $uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); + $use_campaign_dnc = preg_replace('/[^-_0-9a-zA-Z]/','',$use_campaign_dnc); + $use_internal_dnc = preg_replace('/[^-_0-9a-zA-Z]/','',$use_internal_dnc); $user_group = preg_replace('/[^-_0-9a-zA-Z]/','',$user_group); $inbound_ingroup = preg_replace('/[^-_0-9a-zA-Z]/','',$inbound_ingroup); $calls_waiting_vl_oneLABEL = preg_replace('/[^-, _0-9a-zA-Z]/','',$calls_waiting_vl_oneLABEL); @@ -1312,23 +1470,70 @@ else $status = preg_replace("/\'|\"|\\\\|;/","",$status); $MgrApr_user = preg_replace("/\'|\"|\\\\|;/","",$MgrApr_user); $MgrApr_pass = preg_replace("/\'|\"|\\\\|;/","",$MgrApr_pass); + + $ACTION = preg_replace('/[^-_0-9\p{L}]/u','',$ACTION); + $CallBackDatETimE = preg_replace('/[^- \:_0-9\p{L}]/u','',$CallBackDatETimE); + $CallBackLeadStatus = preg_replace('/[^-_0-9\p{L}]/u','',$CallBackLeadStatus); + $MDnextCID = preg_replace('/[^- _0-9\p{L}]/u','',$MDnextCID); + $VDRP_stage = preg_replace('/[^-_0-9\p{L}]/u','',$VDRP_stage); + $VDstop_rec_after_each_call = preg_replace('/[^-_0-9\p{L}]/u','',$VDstop_rec_after_each_call); + $account = preg_replace('/[^-_0-9\p{L}]/u','',$account); + $agent_dialed_number = preg_replace('/[^-_0-9\p{L}]/u','',$agent_dialed_number); + $agent_dialed_type = preg_replace('/[^-_0-9\p{L}]/u','',$agent_dialed_type); + $agent_log = preg_replace('/[^-_0-9\p{L}]/u','',$agent_log); + $agent_log_id = preg_replace('/[^-_0-9\p{L}]/u','',$agent_log_id); $agent_territories = preg_replace('/[^- _0-9\p{L}]/u','',$agent_territories); + $alt_dial = preg_replace('/[^-_0-9\p{L}]/u','',$alt_dial); $alt_num_status = preg_replace('/[^-_0-9\p{L}]/u','',$alt_num_status); + $auto_dial_level = preg_replace('/[^-\._0-9\p{L}]/u','',$auto_dial_level); + $blind_transfer = preg_replace('/[^-_0-9\p{L}]/u','',$blind_transfer); + $callback_gmt_offset = preg_replace('/[^- \._0-9\p{L}]/u','',$callback_gmt_offset); + $callback_id = preg_replace('/[^-_0-9\p{L}]/u','',$callback_id); + $callback_timezone = preg_replace('/[^-, _0-9\p{L}]/u','',$callback_timezone); $camp_script = preg_replace('/[^-_0-9\p{L}]/u','',$camp_script); $campaign_cid = preg_replace('/[^-_0-9\p{L}]/u','',$campaign_cid); + $closer_blended = preg_replace('/[^-_0-9\p{L}]/u','',$closer_blended); + $conf_dialed = preg_replace('/[^-_0-9\p{L}]/u','',$conf_dialed); + $conf_exten = preg_replace('/[^-_\.0-9\p{L}]/u','',$conf_exten); + $conf_silent_prefix = preg_replace('/[^-_0-9\p{L}]/u','',$conf_silent_prefix); $dial_ingroup = preg_replace('/[^-_0-9\p{L}]/u','',$dial_ingroup); $dial_method = preg_replace('/[^-_0-9\p{L}]/u','',$dial_method); $dial_prefix = preg_replace('/[^-_0-9\p{L}]/u','',$dial_prefix); + $disable_alter_custphone = preg_replace('/[^-_0-9\p{L}]/u','',$disable_alter_custphone); $dispo_choice = preg_replace('/[^-_0-9\p{L}]/u','',$dispo_choice); + $email_row_id = preg_replace('/[^-_0-9\p{L}]/u','',$email_row_id); $ext_context = preg_replace('/[^-_0-9\p{L}]/u','',$ext_context); + $ext_priority = preg_replace('/[^-_0-9\p{L}]/u','',$ext_priority); + $format = preg_replace('/[^-_0-9\p{L}]/u','',$format); + $gender = preg_replace('/[^-_0-9\p{L}]/u','',$gender); + $inOUT = preg_replace('/[^-_0-9\p{L}]/u','',$inOUT); $in_script = preg_replace('/[^-_0-9\p{L}]/u','',$in_script); + $last_VDRP_stage = preg_replace('/[^-_0-9\p{L}]/u','',$last_VDRP_stage); + $leave_3way_start_recording_filename = preg_replace('/[^-_0-9\p{L}]/u','',$leave_3way_start_recording_filename); + $manual_dial_call_time_check = preg_replace('/[^-_0-9\p{L}]/u','',$manual_dial_call_time_check); $manual_dial_filter = preg_replace('/[^-_0-9\p{L}]/u','',$manual_dial_filter); $manual_dial_search_filter = preg_replace('/[^-_0-9\p{L}]/u','',$manual_dial_search_filter); + $manual_dial_validation = preg_replace('/[^-_0-9\p{L}]/u','',$manual_dial_validation); + $nocall_dial_flag = preg_replace('/[^-_0-9\p{L}]/u','',$nocall_dial_flag); $old_CID = preg_replace('/[^- _0-9\p{L}]/u','',$old_CID); + $omit_phone_code = preg_replace('/[^-_0-9\p{L}]/u','',$omit_phone_code); + $parked_hangup = preg_replace('/[^-_0-9\p{L}]/u','',$parked_hangup); + $pause_max_url_trigger = preg_replace('/[^0-9]/','',$pause_max_url_trigger); + $pause_trigger = preg_replace('/[^-_0-9\p{L}]/u','',$pause_trigger); + $preview = preg_replace('/[^-_0-9\p{L}]/u','',$preview); + $previous_agent_log_id = preg_replace('/[^-_0-9\p{L}]/u','',$previous_agent_log_id); + $protocol = preg_replace('/[^-_0-9\p{L}]/u','',$protocol); $qm_dispo_code = preg_replace('/[^-_0-9\p{L}]/u','',$qm_dispo_code); $recipient = preg_replace('/[^-_0-9\p{L}]/u','',$recipient); + $routing_initiated_recording = preg_replace('/[^-_0-9\p{L}]/u','',$routing_initiated_recording); $search = preg_replace('/[^-_0-9\p{L}]/u','',$search); + $server_ip = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$server_ip); + $session_name = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$session_name); + $stereo_recording = preg_replace('/[^-_0-9\p{L}]/u','',$stereo_recording); $sub_status = preg_replace('/[^-_0-9\p{L}]/u','',$sub_status); + $uniqueid = preg_replace('/[^-_\.0-9\p{L}]/u','',$uniqueid); + $use_campaign_dnc = preg_replace('/[^-_0-9\p{L}]/u','',$use_campaign_dnc); + $use_internal_dnc = preg_replace('/[^-_0-9\p{L}]/u','',$use_internal_dnc); $user_group = preg_replace('/[^-_0-9\p{L}]/u','',$user_group); $inbound_ingroup = preg_replace('/[^-_0-9\p{L}]/u','',$inbound_ingroup); $calls_waiting_vl_oneLABEL = preg_replace('/[^-, _0-9\p{L}]/u','',$calls_waiting_vl_oneLABEL); @@ -1639,7 +1844,7 @@ if ($ACTION == 'LogiNCamPaigns') { $rowx=mysqli_fetch_row($rslt); echo "\n"; $o++; } @@ -4239,7 +4444,7 @@ if ($ACTION == 'manDiaLnextCaLL') } if ($affected_rows > 0) { - if (!$CBleadIDset) + if (!isset($CBleadIDset)) { ##### grab the lead_id of the reserved user in vicidial_hopper $stmt="SELECT lead_id FROM vicidial_hopper where campaign_id='$campaign' and status='QUEUE' and user='$user' LIMIT 1;"; @@ -4301,13 +4506,14 @@ if ($ACTION == 'manDiaLnextCaLL') $entry_list_id = trim("$row[34]"); if ($entry_list_id < 100) {$entry_list_id = $list_id;} } + + $ACcount = ''; + $ACcomments = ''; if ($qc_features_active > 0) { //Added by Poundteam for Audited Comments ##### if list has audited comments, grab the audited comments require_once('audit_comments.php'); - $ACcount = ''; - $ACcomments = ''; $audit_comments_active=audit_comments_active($list_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log); if ($audit_comments_active) { @@ -4574,7 +4780,7 @@ if ($ACTION == 'manDiaLnextCaLL') $rslt=mysql_to_mysqli($stmtPDC, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmtPDC,'00916',$user,$server_ip,$session_name,$one_mysql_log);} - if (!$CBleadIDset) + if (!isset($CBleadIDset)) { ### delete the lead from the hopper $stmt = "DELETE FROM vicidial_hopper where lead_id='$lead_id';"; @@ -4674,10 +4880,10 @@ if ($ACTION == 'manDiaLnextCaLL') } ### BEGIN check for Dial Timeout Lead Override ### + $MD_field=''; + $DTL_override=''; if ( (strlen($dial_timeout_lead_container) > 1) and ($dial_timeout_lead_container != 'DISABLED') ) { - $MD_field=''; - $DTL_override=''; $DTLOset=0; $skip_line=0; # Gather details on Dial Timeout Lead settings container $stmt = "SELECT container_entry FROM vicidial_settings_containers where container_id='$dial_timeout_lead_container';"; @@ -5111,11 +5317,12 @@ if ($ACTION == 'manDiaLnextCaLL') $variable = "Variable: usegroupalias=1"; } else - {$account=''; $variable='';} + {$account=''; $variable=''; $RAWaccount='';} $dial_channel = "$local_DEF$conf_exten$local_AMP$ext_context$Local_persist"; $preset_name=''; + $IN_start_call_url=''; if (strlen($dial_ingroup) > 1) { ### look for a dial-ingroup cid @@ -6401,6 +6608,7 @@ if ($ACTION == 'manDiaLonly') $MT[0]=''; $row=''; $rowx=''; $CCIDtype=''; + $IN_start_call_url=''; # Never set, despite being called further down? $channel_live=1; $MDF_search_flag='MAIN'; # outbound call, assign fronter to user and closer blank @@ -6654,11 +6862,11 @@ if ($ACTION == 'manDiaLonly') } ### END check phone filtering for DNC or camplists if enabled ### + $MD_field=''; + $DTL_override=''; ### BEGIN check for Dial Timeout Lead Override ### if ( (strlen($dial_timeout_lead_container) > 1) and ($dial_timeout_lead_container != 'DISABLED') ) { - $MD_field=''; - $DTL_override=''; $DTLOset=0; $skip_line=0; # Gather details on Dial Timeout Lead settings container $stmt = "SELECT container_entry FROM vicidial_settings_containers where container_id='$dial_timeout_lead_container';"; @@ -7196,7 +7404,7 @@ if ($ACTION == 'manDiaLonly') $variable = "Variable: usegroupalias=1"; } else - {$account=''; $variable='';} + {$account=''; $variable=''; $RAWaccount='';} if ( ($scheduled_callbacks_auto_reschedule != 'DISABLED') and (strlen($scheduled_callbacks_auto_reschedule) > 0) ) { @@ -8265,6 +8473,7 @@ if ($ACTION == 'manDiaLlookCaLL') $PATHmonitorS = '/var/spool/asterisk/monitorS'; $PATHmonitorP = '/var/spool/asterisk/monitorP'; $PATHmonitorT = $PATHmonitorS; + $parallel_recording_id=0; if ( ($SSstereo_parallel_recording > 0) && (preg_match("/CUSTOMER|FULL/",$stereo_parallel_recording)) ) { @@ -8967,7 +9176,15 @@ if ($stage == "end") $term_reason='NONE'; if ( (strlen($start_epoch) < 1 ) or (preg_match("/[^0-9]/",$start_epoch)) ) {$start_epoch=0;} - if ($start_epoch < 1000) + if (is_numeric($start_epoch)) + { + $startEpochVal = (int) $start_epoch; + } + else + { + $startEpochVal = strtotime($start_epoch); + } + if ($startEpochVal < 1000) { if ( ($VLA_inOUT == 'INBOUND') or ($VLA_inOUT == 'CHAT') or ($VLA_inOUT == 'EMAIL') ) { @@ -9032,18 +9249,10 @@ if ($stage == "end") } else { - if (is_numeric($start_epoch)) - { - $startEpochVal = (int) $start_epoch; - } - else - { - $startEpochVal = strtotime($start_epoch); - } $length_in_sec = ($StarTtime - $startEpochVal); } - if (strlen($VDcampaign_id)<1) {$VDcampaign_id = $campaign;} + if (!isset($VDcampaign_id) || strlen($VDcampaign_id)<1) {$VDcampaign_id = $campaign;} $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); @@ -9792,6 +10001,7 @@ if ($stage == "end") if ( ($VLA_inOUT == 'AUTO') or ($VLA_inOUT == 'MANUAL') ) { $SQLterm = "term_reason='$term_reason',"; + $VDstatus=''; if ( (preg_match("/NONE/",$term_reason)) or (preg_match("/NONE/",$VDterm_reason)) or (strlen($VDterm_reason) < 1) ) { @@ -10219,6 +10429,7 @@ if ($stage == "end") $loop_count=0; while($loop_count < $total_rec) { + $lidSQL=''; if (strlen($rec_channels[$loop_count])>5) { $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Hangup','RH12345$StarTtime$loop_count','Channel: $rec_channels[$loop_count]','','','','','','','','','');"; @@ -10511,6 +10722,19 @@ if ($ACTION == 'VDADcheckINCOMING') $INclosecallid=''; $INxfercallid=''; $rct = 'Q'; + $closecallid=''; + $LISTweb_form_address=''; + $LISTweb_form_address_two=''; + $LISTweb_form_address_three=''; + $DID_id=''; + $DID_extension=''; + $DID_pattern=''; + $DID_description=''; + $DID_custom_one=''; + $DID_custom_two=''; + $DID_custom_three=''; + $DID_custom_four=''; + $DID_custom_five=''; # default to $fronter=$user, closer blank $fronter = $user; $closer=''; @@ -10632,13 +10856,14 @@ if ($ACTION == 'VDADcheckINCOMING') $entry_list_id = trim("$row[34]"); if ($entry_list_id < 100) {$entry_list_id = $list_id;} } + + $ACcount = ''; + $ACcomments = ''; if ($qc_features_active > 0) { //Added by Poundteam for Audited Comments ##### if list has audited comments, grab the audited comments require_once('audit_comments.php'); - $ACcount = ''; - $ACcomments = ''; $audit_comments_active=audit_comments_active($list_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log); if ($audit_comments_active) { @@ -11301,8 +11526,8 @@ if ($ACTION == 'VDADcheckINCOMING') $vs_vc_ct = mysqli_num_rows($rslt); if ($vs_vc_ct > 0) { - $row=mysqli_fetch_row($rslt); - $script_recording_delay = $row[0]; + $rowx=mysqli_fetch_row($rslt); + $script_recording_delay = $rowx[0]; } } @@ -11319,8 +11544,8 @@ if ($ACTION == 'VDADcheckINCOMING') $ug_vc_ct = mysqli_num_rows($rslt); if ($ug_vc_ct > 0) { - $row=mysqli_fetch_row($rslt); - $script_recording_delay = $row[0]; + $rowy=mysqli_fetch_row($rslt); + $script_recording_delay = $rowy[0]; } } @@ -11335,8 +11560,8 @@ if ($ACTION == 'VDADcheckINCOMING') $vs_vc_ct = mysqli_num_rows($rslt); if ($vs_vc_ct > 0) { - $row=mysqli_fetch_row($rslt); - if ($row[0] > 0) {$script_recording_delay++;} + $rowz=mysqli_fetch_row($rslt); + if ($rowz[0] > 0) {$script_recording_delay++;} } } } @@ -12296,6 +12521,7 @@ if ($ACTION == 'ManagerChatsCheck') // Get a count on how many chats the agent is involved in, and also any chats where there are unread messages BY THE USER to determine if the user gets a blinking light. $chat_stmt="select manager_chat_id, manager_chat_subid, sum(if(message_viewed_date is null and user='$user', 1, 0)) from vicidial_manager_chat_log where (user='$user' or manager='$user') group by manager_chat_id, manager_chat_subid order by manager_chat_id, manager_chat_subid"; $chat_rslt=mysql_to_mysqli($chat_stmt, $link); + $unread_messages=0; if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$chat_stmt,'00636',$user,$server_ip,$session_name,$one_mysql_log);} $active_chats=mysqli_num_rows($chat_rslt); while ($chat_row=mysqli_fetch_row($chat_rslt)) @@ -12416,6 +12642,7 @@ if ($ACTION == 'VDADcheckINCOMINGother') ### If no emails have been sent to agent, check for chats, this is the code section where the agent interface will grab the next available chat if ($email_ct==0) { + $chat_ct=0; # Chats don't have a priority setting, but we use it for the AGENTDIRECT_CHAT one (which has it set to 99 and is uneditable through the admin) so that is always the highest priority. Also ensures that agent does not transfer to self if transferring to the same ingroup (transferring_agent!=user clause) $stmt="SELECT vlc.chat_id,UNIX_TIMESTAMP(vlc.chat_start_time),vlc.status,vlc.chat_creator,vlc.group_id,vlc.lead_id,vlc.user_direct_group_id,vig.queue_priority,vig.get_call_launch from vicidial_live_chats vlc, vicidial_inbound_groups vig where vlc.status='WAITING' and (vlc.group_id IN ($chat_group_str) or (vlc.group_id='AGENTDIRECT_CHAT' and user_direct='$user')) and vlc.group_id NOT IN($VD_hit_limit_ingroups) and (transferring_agent is null or transferring_agent!='$user') order by queue_priority desc, chat_id asc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -14940,6 +15167,16 @@ if ($ACTION == 'updateDISPO') $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00143',$user,$server_ip,$session_name,$one_mysql_log);} $row=mysqli_fetch_row($rslt); + + # Neither variable is ever set via vdc_db_query.php here, although may be defined via settings container further down. + $fronter=''; + $parked_by=''; + + $ig_custom_one=''; + $ig_custom_two=''; + $ig_custom_three=''; + $ig_custom_four=''; + $ig_custom_five=''; if ($row[0] > 0) { $call_type='IN'; @@ -15109,6 +15346,7 @@ if ($ACTION == 'updateDISPO') { $call_type='OUT'; $four_hours_ago = date("Y-m-d H:i:s", mktime(date("H")-4,date("i"),date("s"),date("m"),date("d"),date("Y"))); + $FAKEcall_id=''; if ( ($auto_dial_level < 1) or (preg_match('/^M/',$MDnextCID)) ) { @@ -16496,6 +16734,12 @@ if ($ACTION == 'updateDISPO') } ### loop through each Dispo URL entry and process ### $j=0; + $fullname=''; + $user_custom_one=''; + $user_custom_two=''; + $user_custom_three=''; + $user_custom_four=''; + $user_custom_five=''; while ($dispo_call_url_count > $j) { if ( (preg_match('/--A--user_custom_/i',$dispo_call_urlARY[$j])) or (preg_match('/--A--fullname/i',$dispo_call_urlARY[$j])) or (preg_match('/--A--user_group/i',$dispo_call_urlARY[$j])) ) @@ -16518,6 +16762,7 @@ if ($ACTION == 'updateDISPO') } } + $status_name=''; if (preg_match('/--A--dispo_name--B--/i',$dispo_call_urlARY[$j])) { ### find the full status name for this status @@ -16548,19 +16793,18 @@ if ($ACTION == 'updateDISPO') } $dispo_name = urlencode(trim($status_name)); + $url_call_notes = urlencode(" "); if (preg_match('/--A--call_notes/i',$dispo_call_urlARY[$j])) { if (strlen($call_notes) > 1) {$url_call_notes = urlencode(trim($call_notes));} - else - {$url_call_notes = urlencode(" ");} } + $dialed_number = $phone_number; + $dialed_label = 'NONE'; + $term_reason = 'NONE'; if (preg_match('/--A--dialed_|--A--term_reason--B--/i',$dispo_call_urlARY[$j])) { - $dialed_number = $phone_number; - $dialed_label = 'NONE'; - $term_reason = 'NONE'; if ($call_type=='OUT') { @@ -16580,13 +16824,17 @@ if ($ACTION == 'updateDISPO') } } + $DID_id=''; + $DID_extension=''; + $DID_pattern=''; + $DID_description=''; + $DID_custom_one=''; + $DID_custom_two=''; + $DID_custom_three=''; + $DID_custom_four=''; + $DID_custom_five=''; if (preg_match('/--A--did_/i',$dispo_call_urlARY[$j])) { - $DID_id=''; - $DID_extension=''; - $DID_pattern=''; - $DID_description=''; - $stmt = "SELECT did_id,extension from vicidial_did_log where uniqueid='$uniqueid' and caller_id_number='$phone_number' order by call_date desc limit 1;"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); @@ -16617,10 +16865,11 @@ if ($ACTION == 'updateDISPO') } } + $INclosecallid=''; + $INxfercallid=''; + $VDADchannel_group=''; if ( (preg_match('/callid--B--/i',$dispo_call_urlARY[$j])) or (preg_match('/group--B--|--A--term_reason--B--/i',$dispo_call_urlARY[$j])) or (preg_match('/fronter--B--|closer--B--/i',$dispo_call_urlARY[$j])) ) { - $INclosecallid=''; - $INxfercallid=''; $VDADchannel_group=$campaign; $stmt = "SELECT campaign_id,closecallid,xfercallid,term_reason from vicidial_closer_log where uniqueid='$uniqueid' and user='$user' order by closecallid desc limit 1;"; if ($DB) {echo "$stmt\n";} @@ -16699,7 +16948,7 @@ if ($ACTION == 'updateDISPO') # Revert to log dispo choice if the lead is a callback, as CBHOLD would not be what the agent selected if ($dispo=="CBHOLD" && strlen($log_dispo_choice)>0 && $dispo!=$log_dispo_choice) {$dispo=$log_dispo_choice;} - + $list_name=''; $list_description=''; if (preg_match('/list_name--B--|list_description--B--/i',$dispo_call_urlARY[$j])) { $stmt = "SELECT list_name,list_description from vicidial_lists where list_id='$list_id' limit 1;"; @@ -16964,9 +17213,9 @@ if ($ACTION == 'updateDISPO') $custom_field_names_ct = count($custom_field_names_ARY); $custom_field_names_SQL = $custom_field_names; + $enc_fields=0; if (preg_match("/cf_encrypt/",$active_modules)) { - $enc_fields=0; $stmt = "SELECT count(*) from vicidial_lists_fields where field_encrypt='Y' and list_id='$entry_list_id';"; $rslt=mysql_to_mysqli($stmt, $link); if ($DB) {echo "$stmt\n";} @@ -17219,7 +17468,7 @@ if ($ACTION == 'DEADtriggerURL') $talk_time=0; $talk_time_ms=0; $talk_time_min=0; - if (strlen($dead_time) < 1) {$dead_time=0;} + if (!isset($dead_time) || strlen($dead_time) < 1) {$dead_time=0;} if ( (preg_match('/--A--user_custom_/i',$dead_trigger_url)) or (preg_match('/--A--fullname/i',$dead_trigger_url)) or (preg_match('/--A--user_group/i',$dead_trigger_url)) ) { $stmt = "SELECT custom_one,custom_two,custom_three,custom_four,custom_five,full_name,user_group from vicidial_users where user='$user';"; @@ -18416,6 +18665,7 @@ if ( ($ACTION == 'VDADpause') or ($ACTION == 'VDADready') or ($pause_trigger == $VLAaffected_rows=0; $vla_lead_wipeSQL=''; $vla_where_SQL=''; + $vla_ring_resetSQL=''; if ($ACTION == 'VDADready') { $vla_lead_wipeSQL = ",lead_id=0"; @@ -18701,6 +18951,7 @@ if ($ACTION == 'userLOGout') $vul_insert = mysqli_affected_rows($link); } + $vc_remove=""; if ($no_delete_sessions < 1) { ##### Figure out which conference table to use @@ -18730,7 +18981,8 @@ if ($ACTION == 'userLOGout') if ($format=='debug') {echo "\n";} $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00133',$user,$server_ip,$session_name,$one_mysql_log);} - if ($rslt) + $agent_channel=""; + if (mysqli_num_rows($rslt)>0) { $row=mysqli_fetch_row($rslt); $agent_channel = "$row[0]"; @@ -18764,7 +19016,7 @@ if ($ACTION == 'userLOGout') while ($row=mysqli_fetch_row($rslt)) { $manager_chat_id=$row[0]; - $archive_stmt="INSERT IGNORE INTO vicidial_manager_chat_log_archive SELECT manager_chat_message_id,manager_chat_id,manager_chat_subid,manager,user,message,message_date,message_viewed_date,message_posted_by,audio_alerted from vicidial_manager_chat_log where manager_chat_id='$manager_chat_id';"; + $archive_stmt="INSERT IGNORE INTO vicidial_manager_chat_log_archive SELECT manager_chat_message_id,manager_chat_id,manager_chat_subid,manager,user,message,message_id,message_date,message_viewed_date,message_posted_by,audio_alerted from vicidial_manager_chat_log where manager_chat_id='$manager_chat_id';"; $archive_rslt=mysql_to_mysqli($archive_stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$archive_stmt,'00646',$user,$server_ip,$session_name,$one_mysql_log);} @@ -18814,16 +19066,19 @@ if ($ACTION == 'userLOGout') $rslt=mysql_to_mysqli($stmt, $link); if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00136',$user,$server_ip,$session_name,$one_mysql_log);} $VDpr_ct = mysqli_num_rows($rslt); - if ( ($VDpr_ct > 0) and (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + if ($VDpr_ct > 0) { $row=mysqli_fetch_row($rslt); - $agent_log_id = $row[5]; - $pause_sec = (($StarTtime - $row[0]) + $row[1]); + if ( (strlen($row[3]<5)) and (strlen($row[4]<5)) ) + { + $agent_log_id = $row[5]; + $pause_sec = (($StarTtime - $row[0]) + $row[1]); - $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00137',$user,$server_ip,$session_name,$one_mysql_log);} + $stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';"; + if ($format=='debug') {echo "\n";} + $rslt=mysql_to_mysqli($stmt, $link); + if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00137',$user,$server_ip,$session_name,$one_mysql_log);} + } } if ($vla_delete > 0) @@ -19450,7 +19705,8 @@ if ($ACTION == 'PauseCodeMgrApr') if ($ACTION == 'VMMG_list_build') { $HHMM = date("Hi"); - $start_date = ($start_date + 0); + # $start_date = ($start_date + 0); # No longer works in PHP8 if $start_date is a string + $VMMGaudio_filename = array(); $VMMGaudio_name = array(); $VMMGrank = array(); @@ -20130,6 +20386,10 @@ if ($ACTION == 'CALLLOGview') $call_log_view_allowed=0; $VU_user_group=''; $call_log_days=-1; + + $manual_dial_filter=preg_replace('/[^0-9]/', '', $manual_dial_filter); + if (strlen($manual_dial_filter)==0) {$manual_dial_filter=0;} + $stmt="SELECT user_group from vicidial_users where user='$user';"; if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);} $rslt=mysql_to_mysqli($stmt, $link); @@ -20382,6 +20642,9 @@ if ($ACTION == 'SEARCHRESULTSview') if (strlen($stage) < 3) {$stage = '670';} + $manual_dial_filter=preg_replace('/[^0-9]/', '', $manual_dial_filter); + if (strlen($manual_dial_filter)==0) {$manual_dial_filter=0;} + ### find the screen_label for this campaign $stmt="SELECT screen_labels,hide_call_log_info from vicidial_campaigns where campaign_id='$campaign';"; $rslt=mysql_to_mysqli($stmt, $link); @@ -21274,6 +21537,10 @@ if ($ACTION == 'SEARCHCONTACTSRESULTSview') if ($ACTION == 'LEADINFOview') { $CB_force_dial_flag=0; + + $manual_dial_filter=preg_replace('/[^0-9]/', '', $manual_dial_filter); + if (strlen($manual_dial_filter)==0) {$manual_dial_filter=0;} + if (strlen($lead_id) < 1) { if ($callback_id == 'FORCED') @@ -22382,12 +22649,12 @@ if ($ACTION == 'CalLBacKCounT') if ($sc_ct > 0 && filter_var($email_to, FILTER_VALIDATE_EMAIL)) { $row=mysqli_fetch_row($rslt); - $container_entry = $row[0]; + $container_entry = trim($row[0]); $container_ARY = explode("\n",$container_entry); $email_body_gather=0; $p=0; $container_ct = count($container_ARY); - while ($p <= $container_ct) + while ($p < $container_ct) { $line = $container_ARY[$p]; if ($email_body_gather < 1) diff --git a/agc_2-X/trunk/www/agc/vdc_email_display.php b/agc_2-X/trunk/www/agc/vdc_email_display.php index d718a6fe..c639f0ad 100644 --- a/agc_2-X/trunk/www/agc/vdc_email_display.php +++ b/agc_2-X/trunk/www/agc/vdc_email_display.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell, Joe Johnson LICENSE: AGPLv2 # # This page displays any incoming emails in the Vicidial user interface. It # also allows the user to download and view any attachments sent in the email, @@ -25,10 +25,11 @@ # 171126-1406 - Added fault tolerance and extra debug # 210616-2038 - Added optional CORS support, see options.php for details # 220219-1839 - More security changes +# 260302-1154 - Code updates for PHP8 compatibility # -$version = '2.14-15'; -$build = '220219-1839'; +$version = '2.14-16'; +$build = '260302-1154'; $php_script = 'vdc_email_display.php'; require_once("dbconnect_mysqli.php"); @@ -38,34 +39,45 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["attachment_id"])) {$attachment_id=$_GET["attachment_id"];} elseif (isset($_POST["attachment_id"])) {$attachment_id=$_POST["attachment_id"];} + else {$attachment_id=0;} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id=0;} if (isset($_GET["email_row_id"])) {$email_row_id=$_GET["email_row_id"];} elseif (isset($_POST["email_row_id"])) {$email_row_id=$_POST["email_row_id"];} + else {$email_row_id=0;} if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} + else {$campaign="";} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} + else {$stage="";} if (isset($_GET["sender_email"])) {$sender_email=$_GET["sender_email"];} elseif (isset($_POST["sender_email"])) {$sender_email=$_POST["sender_email"];} + else {$sender_email="";} if (isset($_GET["reply_subject"])) {$reply_subject=$_GET["reply_subject"];} elseif (isset($_POST["reply_subject"])) {$reply_subject=$_POST["reply_subject"];} + else {$reply_subject="";} if (isset($_GET["reply_to_address"])) {$reply_to_address=$_GET["reply_to_address"];} elseif (isset($_POST["reply_to_address"])) {$reply_to_address=$_POST["reply_to_address"];} + else {$reply_to_address="";} if (isset($_GET["reply_from_address"])) {$reply_from_address=$_GET["reply_from_address"];} elseif (isset($_POST["reply_from_address"])) {$reply_from_address=$_POST["reply_from_address"];} + else {$reply_from_address="";} if (isset($_GET["reply_message"])) {$reply_message=$_GET["reply_message"];} elseif (isset($_POST["reply_message"])) {$reply_message=$_POST["reply_message"];} if (isset($_GET["REPLY"])) {$REPLY=$_GET["REPLY"];} elseif (isset($_POST["REPLY"])) {$REPLY=$_POST["REPLY"];} + else {$REPLY="";} if (isset($_GET["agent_email"])) {$agent_email=$_GET["agent_email"];} elseif (isset($_POST["agent_email"])) {$agent_email=$_POST["agent_email"];} - -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); + else {$agent_email="";} $PHP_SELF=$_SERVER['PHP_SELF']; $PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF); @@ -77,26 +89,41 @@ if (file_exists('options.php')) require('options.php'); } -$attachment1=$_FILES["attachment1"]; - $A1_orig = $_FILES['attachment1']['name']; - $A1_path = $_FILES['attachment1']['tmp_name']; - $A1_type = $_FILES['attachment1']['type']; -$attachment2=$_FILES["attachment2"]; - $A2_orig = $_FILES['attachment2']['name']; - $A2_path = $_FILES['attachment2']['tmp_name']; - $A2_type = $_FILES['attachment2']['type']; -$attachment3=$_FILES["attachment3"]; - $A3_orig = $_FILES['attachment3']['name']; - $A3_path = $_FILES['attachment3']['tmp_name']; - $A3_type = $_FILES['attachment3']['type']; -$attachment4=$_FILES["attachment4"]; - $A4_orig = $_FILES['attachment4']['name']; - $A4_path = $_FILES['attachment4']['tmp_name']; - $A4_type = $_FILES['attachment4']['type']; -$attachment5=$_FILES["attachment5"]; - $A5_orig = $_FILES['attachment5']['name']; - $A5_path = $_FILES['attachment5']['tmp_name']; - $A5_type = $_FILES['attachment5']['type']; +if (array_key_exists('attachment1', $_FILES)) + { + $attachment1=$_FILES["attachment1"]; + $A1_orig = $_FILES['attachment1']['name']; + $A1_path = $_FILES['attachment1']['tmp_name']; + $A1_type = $_FILES['attachment1']['type']; + } +if (array_key_exists('attachment2', $_FILES)) + { + $attachment2=$_FILES["attachment2"]; + $A2_orig = $_FILES['attachment2']['name']; + $A2_path = $_FILES['attachment2']['tmp_name']; + $A2_type = $_FILES['attachment2']['type']; + } +if (array_key_exists('attachment3', $_FILES)) + { + $attachment3=$_FILES["attachment3"]; + $A3_orig = $_FILES['attachment3']['name']; + $A3_path = $_FILES['attachment3']['tmp_name']; + $A3_type = $_FILES['attachment3']['type']; + } +if (array_key_exists('attachment4', $_FILES)) + { + $attachment4=$_FILES["attachment4"]; + $A4_orig = $_FILES['attachment4']['name']; + $A4_path = $_FILES['attachment4']['tmp_name']; + $A4_type = $_FILES['attachment4']['type']; + } +if (array_key_exists('attachment5', $_FILES)) + { + $attachment5=$_FILES["attachment5"]; + $A5_orig = $_FILES['attachment5']['name']; + $A5_path = $_FILES['attachment5']['tmp_name']; + $A5_type = $_FILES['attachment5']['type']; + } header ("Content-type: text/html; charset=utf-8"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 @@ -113,21 +140,20 @@ $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); $MT[0]=''; $agents='@agents'; -$script_height = ($script_height - 20); -if (strlen($bgcolor) < 6) {$bgcolor='FFFFFF';} +# 3/28/25 - removed, never used +# $script_height = ($script_height - 20); +# if (strlen($bgcolor) < 6) {$bgcolor='FFFFFF';} $IFRAME=0; # default optional vars if not set -if (!isset($format)) {$format="text";} - if ($format == 'debug') {$DB=1;} -if (!isset($ACTION)) {$ACTION="refresh";} -if (!isset($query_date)) {$query_date = $NOW_DATE;} +# 3/28/25 - removed, never used +# if (!isset($format)) {$format="text";} +# if ($format == 'debug') {$DB=1;} +# if (!isset($ACTION)) {$ACTION="refresh";} +# if (!isset($query_date)) {$query_date = $NOW_DATE;} $user = preg_replace("/\'|\"|\\\\|;| /","",$user); -$pass = preg_replace("/\'|\"|\\\\|;| /","",$pass); - -############################################# ##### START SYSTEM_SETTINGS AND USER LANGUAGE LOOKUP ##### $stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,custom_fields_enabled,allow_emails,enable_languages,language_method,allow_web_debug FROM system_settings;"; $rslt=mysql_to_mysqli($stmt, $link); @@ -146,7 +172,53 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[6]; $SSallow_web_debug = $row[7]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); + + +# $campaign = preg_replace('/[^-_0-9\p{L}]/u',"",$campaign); +$attachment_id = preg_replace("/[^0-9]/","",$attachment_id); +$lead_id = preg_replace('/[^0-9]/','',$lead_id); +$email_row_id = preg_replace('/[^0-9]/','',$email_row_id); +$reply_to_address = preg_replace("/\'|\"|\\\\|;/","",$reply_to_address); +# $reply_to_address = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$reply_to_address); +# $stage = preg_replace('/[^-_0-9\p{L}]/u','',$stage); +# $sender_email = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$sender_email); +$reply_subject = preg_replace("/\<|\>|\'|\"|\\\\|;/","",$reply_subject); +# $reply_from_address = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$reply_from_address); +# $agent_email = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$agent_email); +# $REPLY=preg_replace("/[^-_0-9a-zA-Z]/","",$REPLY); + +# filtered +# $reply_message + +if ($non_latin < 1) + { + $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user); + $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); + $campaign = preg_replace('/[^-_0-9a-zA-Z]/',"",$campaign); + $reply_to_address = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$reply_to_address); + $stage = preg_replace('/[^-_0-9a-zA-Z]/','',$stage); + $sender_email = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$sender_email); + $reply_from_address = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$reply_from_address); + $agent_email = preg_replace('/[^-\.\:\/\@\_0-9a-zA-Z]/','',$agent_email); + $REPLY=preg_replace("/[^-_0-9a-zA-Z]/","",$REPLY); + } +else + { + $user=preg_replace("/[^-_0-9\p{L}]/u","",$user); + $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); + $campaign = preg_replace('/[^-_0-9\p{L}]/u',"",$campaign); + $reply_to_address = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$reply_to_address); + $stage = preg_replace('/[^-_0-9\p{L}]/u','',$stage); + $sender_email = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$sender_email); + $reply_from_address = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$reply_from_address); + $agent_email = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$agent_email); + $REPLY=preg_replace("/[^-_0-9\p{L}]/u","",$REPLY); + } + + +############################################# $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -168,34 +240,6 @@ if ($allow_emails<1) exit; } -$campaign = preg_replace('/[^-_0-9\p{L}]/u',"",$campaign); -$attachment_id = preg_replace("/[^0-9]/","",$attachment_id); -$lead_id = preg_replace('/[^0-9]/','',$lead_id); -$email_row_id = preg_replace('/[^0-9]/','',$email_row_id); -$reply_to_address = preg_replace("/\'|\"|\\\\|;/","",$reply_to_address); -$reply_to_address = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$reply_to_address); -$stage = preg_replace('/[^-_0-9\p{L}]/u','',$stage); -$sender_email = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$sender_email); -$reply_subject = preg_replace("/\<|\>|\'|\"|\\\\|;/","",$reply_subject); -$reply_from_address = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$reply_from_address); -$agent_email = preg_replace('/[^-\.\:\/\@\_0-9\p{L}]/u','',$agent_email); -$REPLY=preg_replace("/[^-_0-9a-zA-Z]/","",$REPLY); - -# filtered -# $reply_message - -if ($non_latin < 1) - { - $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user); - $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); - } -else - { - $user=preg_replace("/[^-_0-9\p{L}]/u","",$user); - $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); - } - - $auth=0; $auth_message = user_authorization($user,$pass,'',0,1,0,0,'vdc_email_display'); if ($auth_message == 'GOOD') @@ -293,13 +337,14 @@ if ($REPLY) } -if ( ($lead_id) or (strlen($email_row_id)>0) ) +if ( ($lead_id>0) or ($email_row_id>0) ) { $stmt="SELECT * from vicidial_email_list where lead_id='$lead_id' and direction='INBOUND' and status IN('NEW','INCALL') order by email_date asc"; if ($email_row_id) {$stmt="SELECT * from vicidial_email_list where lead_id='$lead_id' and email_row_id='$email_row_id' and direction='INBOUND' and status IN('NEW','INCALL') order by email_date asc";} if ($DB > 0) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); + $EMAIL_form=""; if (mysqli_num_rows($rslt)>0) { $row=mysqli_fetch_array($rslt); $email_row_id=$row["email_row_id"]; @@ -318,7 +363,7 @@ if ( ($lead_id) or (strlen($email_row_id)>0) ) $row["email_to"]=preg_replace('/\>/', '\>', $row["email_to"]); $email_to = $row["email_to"]; } - $EMAIL_form="
    \n"; + $EMAIL_form.="
    \n"; $EMAIL_form.="\n"; $EMAIL_form.="\n"; $EMAIL_form.="\n"; @@ -397,6 +442,7 @@ if ( ($lead_id) or (strlen($email_row_id)>0) ) function CopyMessage() { diff --git a/agc_2-X/trunk/www/agc/vdc_form_display.php b/agc_2-X/trunk/www/agc/vdc_form_display.php index 17da534d..4c7465eb 100644 --- a/agc_2-X/trunk/www/agc/vdc_form_display.php +++ b/agc_2-X/trunk/www/agc/vdc_form_display.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed display the contents of the FORM tab in the agent # interface, as well as take submission of the form submission when the agent @@ -55,10 +55,11 @@ # 210616-2037 - Added optional CORS support, see options.php for details # 210825-0902 - Fix for XSS security issue # 230518-1053 - Added in-group and campaign custom fields 1-5, for script/webform/dispo-call-url use +# 260302-1413 - Code updates for PHP8 compatibility # -$version = '2.14-45'; -$build = '230518-1053'; +$version = '2.14-46'; +$build = '260302-1413'; $php_script = 'vdc_form_display.php'; require_once("dbconnect_mysqli.php"); @@ -68,184 +69,261 @@ $bcrypt=1; if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id=0;} if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} + else {$list_id=0;} if (isset($_GET["new_list_id"])) {$new_list_id=$_GET["new_list_id"];} elseif (isset($_POST["new_list_id"])) {$new_list_id=$_POST["new_list_id"];} + else {$new_list_id=0;} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} + else {$session_id=0;} if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} + else {$uniqueid="";} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} + else {$stage="";} if (isset($_GET["submit_button"])) {$submit_button=$_GET["submit_button"];} elseif (isset($_POST["submit_button"])) {$submit_button=$_POST["submit_button"];} + else {$submit_button="";} if (isset($_GET["admin_submit"])) {$admin_submit=$_GET["admin_submit"];} elseif (isset($_POST["admin_submit"])) {$admin_submit=$_POST["admin_submit"];} + else {$admin_submit="";} if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} - if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} + else {$campaign="";} if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} + else {$phone_login="";} if (isset($_GET["original_phone_login"])) {$original_phone_login=$_GET["original_phone_login"];} elseif (isset($_POST["original_phone_login"])) {$original_phone_login=$_POST["original_phone_login"];} + else {$original_phone_login="";} if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} + else {$phone_pass="";} if (isset($_GET["fronter"])) {$fronter=$_GET["fronter"];} elseif (isset($_POST["fronter"])) {$fronter=$_POST["fronter"];} + else {$fronter="";} if (isset($_GET["closer"])) {$closer=$_GET["closer"];} elseif (isset($_POST["closer"])) {$closer=$_POST["closer"];} + else {$closer="";} if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} + else {$group="";} if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} + else {$channel_group="";} if (isset($_GET["SQLdate"])) {$SQLdate=$_GET["SQLdate"];} elseif (isset($_POST["SQLdate"])) {$SQLdate=$_POST["SQLdate"];} + else {$SQLdate="";} if (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];} elseif (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];} + else {$epoch="";} if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} + else {$customer_zap_channel="";} if (isset($_GET["customer_server_ip"])) {$customer_server_ip=$_GET["customer_server_ip"];} elseif (isset($_POST["customer_server_ip"])) {$customer_server_ip=$_POST["customer_server_ip"];} + else {$customer_server_ip="";} if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} if (isset($_GET["SIPexten"])) {$SIPexten=$_GET["SIPexten"];} elseif (isset($_POST["SIPexten"])) {$SIPexten=$_POST["SIPexten"];} -if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} - elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} + else {$SIPexten="";} if (isset($_GET["phone"])) {$phone=$_GET["phone"];} elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} + else {$phone="";} if (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];} elseif (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];} + else {$parked_by="";} if (isset($_GET["dialed_number"])) {$dialed_number=$_GET["dialed_number"];} elseif (isset($_POST["dialed_number"])) {$dialed_number=$_POST["dialed_number"];} + else {$dialed_number="";} if (isset($_GET["dialed_label"])) {$dialed_label=$_GET["dialed_label"];} elseif (isset($_POST["dialed_label"])) {$dialed_label=$_POST["dialed_label"];} + else {$dialed_label="";} if (isset($_GET["camp_script"])) {$camp_script=$_GET["camp_script"];} elseif (isset($_POST["camp_script"])) {$camp_script=$_POST["camp_script"];} + else {$camp_script="";} if (isset($_GET["in_script"])) {$in_script=$_GET["in_script"];} elseif (isset($_POST["in_script"])) {$in_script=$_POST["in_script"];} + else {$in_script="";} if (isset($_GET["script_width"])) {$script_width=$_GET["script_width"];} elseif (isset($_POST["script_width"])) {$script_width=$_POST["script_width"];} + else {$script_width=0;} if (isset($_GET["script_height"])) {$script_height=$_GET["script_height"];} elseif (isset($_POST["script_height"])) {$script_height=$_POST["script_height"];} + else {$script_height=0;} if (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} elseif (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} + else {$fullname="";} if (isset($_GET["agent_email"])) {$agent_email=$_GET["agent_email"];} elseif (isset($_POST["agent_email"])) {$agent_email=$_POST["agent_email"];} + else {$agent_email="";} if (isset($_GET["recording_filename"])) {$recording_filename=$_GET["recording_filename"];} elseif (isset($_POST["recording_filename"])) {$recording_filename=$_POST["recording_filename"];} + else {$recording_filename="";} if (isset($_GET["recording_id"])) {$recording_id=$_GET["recording_id"];} elseif (isset($_POST["recording_id"])) {$recording_id=$_POST["recording_id"];} + else {$recording_id=0;} if (isset($_GET["user_custom_one"])) {$user_custom_one=$_GET["user_custom_one"];} elseif (isset($_POST["user_custom_one"])) {$user_custom_one=$_POST["user_custom_one"];} + else {$user_custom_one="";} if (isset($_GET["user_custom_two"])) {$user_custom_two=$_GET["user_custom_two"];} elseif (isset($_POST["user_custom_two"])) {$user_custom_two=$_POST["user_custom_two"];} + else {$user_custom_two="";} if (isset($_GET["user_custom_three"])) {$user_custom_three=$_GET["user_custom_three"];} elseif (isset($_POST["user_custom_three"])) {$user_custom_three=$_POST["user_custom_three"];} + else {$user_custom_three="";} if (isset($_GET["user_custom_four"])) {$user_custom_four=$_GET["user_custom_four"];} elseif (isset($_POST["user_custom_four"])) {$user_custom_four=$_POST["user_custom_four"];} + else {$user_custom_four="";} if (isset($_GET["user_custom_five"])) {$user_custom_five=$_GET["user_custom_five"];} elseif (isset($_POST["user_custom_five"])) {$user_custom_five=$_POST["user_custom_five"];} + else {$user_custom_five="";} if (isset($_GET["camp_custom_one"])) {$camp_custom_one=$_GET["camp_custom_one"];} elseif (isset($_POST["camp_custom_one"])) {$camp_custom_one=$_POST["camp_custom_one"];} + else {$camp_custom_one="";} if (isset($_GET["camp_custom_two"])) {$camp_custom_two=$_GET["camp_custom_two"];} elseif (isset($_POST["camp_custom_two"])) {$camp_custom_two=$_POST["camp_custom_two"];} + else {$camp_custom_two="";} if (isset($_GET["camp_custom_three"])) {$camp_custom_three=$_GET["camp_custom_three"];} elseif (isset($_POST["camp_custom_three"])) {$camp_custom_three=$_POST["camp_custom_three"];} + else {$camp_custom_three="";} if (isset($_GET["camp_custom_four"])) {$camp_custom_four=$_GET["camp_custom_four"];} elseif (isset($_POST["camp_custom_four"])) {$camp_custom_four=$_POST["camp_custom_four"];} + else {$camp_custom_four="";} if (isset($_GET["camp_custom_five"])) {$camp_custom_five=$_GET["camp_custom_five"];} elseif (isset($_POST["camp_custom_five"])) {$camp_custom_five=$_POST["camp_custom_five"];} + else {$camp_custom_five="";} if (isset($_GET["preset_number_a"])) {$preset_number_a=$_GET["preset_number_a"];} elseif (isset($_POST["preset_number_a"])) {$preset_number_a=$_POST["preset_number_a"];} + else {$preset_number_a="";} if (isset($_GET["preset_number_b"])) {$preset_number_b=$_GET["preset_number_b"];} elseif (isset($_POST["preset_number_b"])) {$preset_number_b=$_POST["preset_number_b"];} + else {$preset_number_b="";} if (isset($_GET["preset_number_c"])) {$preset_number_c=$_GET["preset_number_c"];} elseif (isset($_POST["preset_number_c"])) {$preset_number_c=$_POST["preset_number_c"];} + else {$preset_number_c="";} if (isset($_GET["preset_number_d"])) {$preset_number_d=$_GET["preset_number_d"];} elseif (isset($_POST["preset_number_d"])) {$preset_number_d=$_POST["preset_number_d"];} + else {$preset_number_d="";} if (isset($_GET["preset_number_e"])) {$preset_number_e=$_GET["preset_number_e"];} elseif (isset($_POST["preset_number_e"])) {$preset_number_e=$_POST["preset_number_e"];} + else {$preset_number_e="";} if (isset($_GET["preset_number_f"])) {$preset_number_f=$_GET["preset_number_f"];} elseif (isset($_POST["preset_number_f"])) {$preset_number_f=$_POST["preset_number_f"];} + else {$preset_number_f="";} if (isset($_GET["preset_dtmf_a"])) {$preset_dtmf_a=$_GET["preset_dtmf_a"];} elseif (isset($_POST["preset_dtmf_a"])) {$preset_dtmf_a=$_POST["preset_dtmf_a"];} + else {$preset_dtmf_a="";} if (isset($_GET["preset_dtmf_b"])) {$preset_dtmf_b=$_GET["preset_dtmf_b"];} elseif (isset($_POST["preset_dtmf_b"])) {$preset_dtmf_b=$_POST["preset_dtmf_b"];} + else {$preset_dtmf_b="";} if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];} elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];} + else {$did_id=0;} if (isset($_GET["did_extension"])) {$did_extension=$_GET["did_extension"];} elseif (isset($_POST["did_extension"])) {$did_extension=$_POST["did_extension"];} + else {$did_extension="";} if (isset($_GET["did_pattern"])) {$did_pattern=$_GET["did_pattern"];} elseif (isset($_POST["did_pattern"])) {$did_pattern=$_POST["did_pattern"];} + else {$did_pattern="";} if (isset($_GET["did_description"])) {$did_description=$_GET["did_description"];} elseif (isset($_POST["did_description"])) {$did_description=$_POST["did_description"];} + else {$did_description="";} if (isset($_GET["closecallid"])) {$closecallid=$_GET["closecallid"];} elseif (isset($_POST["closecallid"])) {$closecallid=$_POST["closecallid"];} + else {$closecallid=0;} if (isset($_GET["xfercallid"])) {$xfercallid=$_GET["xfercallid"];} elseif (isset($_POST["xfercallid"])) {$xfercallid=$_POST["xfercallid"];} + else {$xfercallid="";} if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} + else {$agent_log_id=0;} if (isset($_GET["call_id"])) {$call_id=$_GET["call_id"];} elseif (isset($_POST["call_id"])) {$call_id=$_POST["call_id"];} + else {$call_id="";} if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} + else {$user_group="";} if (isset($_GET["web_vars"])) {$web_vars=$_GET["web_vars"];} elseif (isset($_POST["web_vars"])) {$web_vars=$_POST["web_vars"];} + else {$web_vars="";} if (isset($_GET["bcrypt"])) {$bcrypt=$_GET["bcrypt"];} elseif (isset($_POST["bcrypt"])) {$bcrypt=$_POST["bcrypt"];} if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} + else {$called_count=0;} if (isset($_GET["list_name"])) {$list_name=$_GET["list_name"];} elseif (isset($_POST["list_name"])) {$list_name=$_POST["list_name"];} + else {$list_name="";} if (isset($_GET["list_description"])) {$list_description=$_GET["list_description"];} elseif (isset($_POST["list_description"])) {$list_description=$_POST["list_description"];} + else {$list_description="";} if (isset($_GET["did_custom_one"])) {$did_custom_one=$_GET["did_custom_one"];} elseif (isset($_POST["did_custom_one"])) {$did_custom_one=$_POST["did_custom_one"];} + else {$did_custom_one="";} if (isset($_GET["did_custom_two"])) {$did_custom_two=$_GET["did_custom_two"];} elseif (isset($_POST["did_custom_two"])) {$did_custom_two=$_POST["did_custom_two"];} + else {$did_custom_two="";} if (isset($_GET["did_custom_three"])) {$did_custom_three=$_GET["did_custom_three"];} elseif (isset($_POST["did_custom_three"])) {$did_custom_three=$_POST["did_custom_three"];} + else {$did_custom_three="";} if (isset($_GET["did_custom_four"])) {$did_custom_four=$_GET["did_custom_four"];} elseif (isset($_POST["did_custom_four"])) {$did_custom_four=$_POST["did_custom_four"];} + else {$did_custom_four="";} if (isset($_GET["did_custom_five"])) {$did_custom_five=$_GET["did_custom_five"];} elseif (isset($_POST["did_custom_five"])) {$did_custom_five=$_POST["did_custom_five"];} + else {$did_custom_five="";} if (isset($_GET["ig_custom_one"])) {$ig_custom_one=$_GET["ig_custom_one"];} elseif (isset($_POST["ig_custom_one"])) {$ig_custom_one=$_POST["ig_custom_one"];} + else {$ig_custom_one="";} if (isset($_GET["ig_custom_two"])) {$ig_custom_two=$_GET["ig_custom_two"];} elseif (isset($_POST["ig_custom_two"])) {$ig_custom_two=$_POST["ig_custom_two"];} + else {$ig_custom_two="";} if (isset($_GET["ig_custom_three"])) {$ig_custom_three=$_GET["ig_custom_three"];} elseif (isset($_POST["ig_custom_three"])) {$ig_custom_three=$_POST["ig_custom_three"];} + else {$ig_custom_three="";} if (isset($_GET["ig_custom_four"])) {$ig_custom_four=$_GET["ig_custom_four"];} elseif (isset($_POST["ig_custom_four"])) {$ig_custom_four=$_POST["ig_custom_four"];} + else {$ig_custom_four="";} if (isset($_GET["ig_custom_five"])) {$ig_custom_five=$_GET["ig_custom_five"];} elseif (isset($_POST["ig_custom_five"])) {$ig_custom_five=$_POST["ig_custom_five"];} + else {$ig_custom_five="";} if (isset($_GET["hide_gender"])) {$hide_gender=$_GET["hide_gender"];} elseif (isset($_POST["hide_gender"])) {$hide_gender=$_POST["hide_gender"];} + else {$hide_gender=0;} if (isset($_GET["button_action"])) {$button_action=$_GET["button_action"];} elseif (isset($_POST["button_action"])) {$button_action=$_POST["button_action"];} + else {$button_action="";} if (isset($_GET["only_field"])) {$only_field=$_GET["only_field"];} elseif (isset($_POST["only_field"])) {$only_field=$_POST["only_field"];} + else {$only_field="";} if (isset($_GET["source_field"])) {$source_field=$_GET["source_field"];} elseif (isset($_POST["source_field"])) {$source_field=$_POST["source_field"];} + else {$source_field="";} if (isset($_GET["source_field_value"])) {$source_field_value=$_GET["source_field_value"];} elseif (isset($_POST["source_field_value"])) {$source_field_value=$_POST["source_field_value"];} + else {$source_field_value="";} if (isset($_GET["orig_URL"])) {$orig_URL=$_GET["orig_URL"];} elseif (isset($_POST["orig_URL"])) {$orig_URL=$_POST["orig_URL"];} + else {$orig_URL="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); - if ($bcrypt == 'OFF') {$bcrypt=0;} @@ -271,8 +349,8 @@ $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); $MT[0]=''; $agents='@agents'; -$script_height = ($script_height - 20); -if (strlen($bgcolor) < 6) {$bgcolor='FFFFFF';} +$script_height = ($script_height > 20 ? ($script_height - 20) : 0); +if (!isset($bgcolor) || strlen($bgcolor) < 6) {$bgcolor='FFFFFF';} $startMS = microtime(); $ip = getenv("REMOTE_ADDR"); $query_string = getenv("QUERY_STRING"); @@ -332,7 +410,8 @@ if ($qm_conf_ct > 0) $SSagent_debug_logging = $row[6]; $SSallow_web_debug = $row[7]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -349,14 +428,13 @@ if ($sl_ct > 0) ########################################### $agent_email = preg_replace("/\<|\>|\"|\\\\|;/",'-',$agent_email); -$agent_log_id = preg_replace("/\<|\>|\"|\\\\|;/",'-',$agent_log_id); $agent_log_id = preg_replace('/[^0-9]/', '', $agent_log_id); -$button_action = preg_replace('/[^-_0-9a-zA-Z]/','',$button_action); -$call_id = preg_replace('/[^-_\.0-9a-zA-Z]/','',$call_id); -$called_count = preg_replace("/\<|\>|\"|\\\\|;/",'-',$called_count); +# $button_action = preg_replace('/[^-_0-9a-zA-Z]/','',$button_action); +# $call_id = preg_replace('/[^-_\.0-9a-zA-Z]/','',$call_id); +$called_count = preg_replace("/[^0-9]/",'',$called_count); $camp_script = preg_replace("/\<|\>|\"|\\\\|;/",'-',$camp_script); $channel_group = preg_replace("/\<|\>|\"|\\\\|;/",'-',$channel_group); -$closecallid = preg_replace("/[^-_0-9a-zA-Z]/",'-',$closecallid); +$closecallid = preg_replace("/[^0-9]/",'',$closecallid); $closer = preg_replace("/\<|\>|\"|\\\\|;/",'-',$closer); $customer_server_ip = preg_replace("/\<|\>|\"|\\\\|;/",'-',$customer_server_ip); $customer_zap_channel = preg_replace("/\<|\>|\"|\\\\|;/",'-',$customer_zap_channel); @@ -370,16 +448,16 @@ $did_custom_three = preg_replace("/\<|\>|\"|\\\\|;/",'-',$did_custom_three); $did_custom_two = preg_replace("/\<|\>|\"|\\\\|;/",'-',$did_custom_two); $did_description = preg_replace("/\<|\>|\"|\\\\|;/",'-',$did_description); $did_extension = preg_replace("/\<|\>|\"|\\\\|;/",'-',$did_extension); -$did_id = preg_replace("/\<|\>|\"|\\\\|;/",'-',$did_id); +$did_id = preg_replace("/[^0-9]/",'',$did_id); $did_pattern = preg_replace("/\<|\>|\"|\\\\|;/",'-',$did_pattern); -$epoch = preg_replace("/\<|\>|\"|\\\\|;/",'-',$epoch); +$epoch = preg_replace("/[^0-9]/",'',$epoch); $fronter = preg_replace("/\<|\>|\"|\\\\|;/",'-',$fronter); $fullname = preg_replace("/\<|\>|\"|\\\\|;/",'-',$fullname); $in_script = preg_replace("/\<|\>|\"|\\\\|;/",'-',$in_script); $lead_id = preg_replace('/[^0-9]/', '', $lead_id); $list_id = preg_replace('/[^0-9]/', '', $list_id); $new_list_id = preg_replace('/[^0-9]/', '', $new_list_id); -$only_field = preg_replace('/[^-_0-9a-zA-Z]/','',$only_field); +# $only_field = preg_replace('/[^-_0-9a-zA-Z]/','',$only_field); $original_phone_login = preg_replace("/\<|\>|\"|\\\\|;/",'-',$original_phone_login); $parked_by = preg_replace("/\<|\>|\"|\\\\|;/",'-',$parked_by); $pass = preg_replace("/\<|\>|\"|\\\\|;/",'-',$pass); @@ -395,16 +473,16 @@ $preset_number_d = preg_replace("/\<|\>|\"|\\\\|;/",'-',$preset_number_d); $preset_number_e = preg_replace("/\<|\>|\"|\\\\|;/",'-',$preset_number_e); $preset_number_f = preg_replace("/\<|\>|\"|\\\\|;/",'-',$preset_number_f); $recording_filename = preg_replace("/\<|\>|\"|\\\\|;/",'-',$recording_filename); -$recording_id = preg_replace("/\<|\>|\"|\\\\|;/",'-',$recording_id); +$recording_id = preg_replace("/[^0-9]/",'',$recording_id); $script_height = preg_replace("/\<|\>|\"|\\\\|;/",'-',$script_height); -$script_width = preg_replace("/\<|\>|\"|\\\\|;/",'-',$script_width); -$server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); +$script_width = preg_replace("/[^0-9]/",'',$script_width); +# $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); $session_id = preg_replace('/[^0-9]/','',$session_id); $SIPexten = preg_replace("/\<|\>|\"|\\\\|;/",'-',$SIPexten); -$source_field = preg_replace('/[^-_0-9a-zA-Z]/','',$source_field); +# $source_field = preg_replace('/[^-_0-9a-zA-Z]/','',$source_field); $source_field_value = preg_replace("/\'|\"|\\\\|;/",'',$source_field_value); $SQLdate = preg_replace("/\<|\>|\"|\\\\|;/",'-',$SQLdate); -$uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); +# $uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); $user_custom_five = preg_replace("/\"|\\\\|;/",'-',$user_custom_five); $user_custom_four = preg_replace("/\"|\\\\|;/",'-',$user_custom_four); $user_custom_one = preg_replace("/\"|\\\\|;/",'-',$user_custom_one); @@ -413,12 +491,12 @@ $user_custom_two = preg_replace("/\"|\\\\|;/",'-',$user_custom_two); $user_group = preg_replace("/\<|\>|\"|\\\\|;/",'-',$user_group); $web_vars = preg_replace("/\<|\>|\'|\"|\\\\|;/",'-',$web_vars); $xfercallid = preg_replace("/\<|\>|\"|\\\\|;/",'-',$xfercallid); -$stage = preg_replace('/[^-_\.0-9a-zA-Z]/','',$stage); -$submit_button = preg_replace('/[^-_0-9a-zA-Z]/','',$submit_button); -$admin_submit = preg_replace('/[^-_0-9a-zA-Z]/','',$admin_submit); +# $stage = preg_replace('/[^-_\.0-9a-zA-Z]/','',$stage); +# $submit_button = preg_replace('/[^-_0-9a-zA-Z]/','',$submit_button); +# $admin_submit = preg_replace('/[^-_0-9a-zA-Z]/','',$admin_submit); $bgcolor = preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$bgcolor); -$bcrypt = preg_replace('/[^-_0-9a-zA-Z]/','',$bcrypt); -$hide_gender = preg_replace('/[^-_0-9a-zA-Z]/','',$hide_gender); +# $bcrypt = preg_replace('/[^-_0-9a-zA-Z]/','',$bcrypt); +$hide_gender = preg_replace('/[^0-9]/','',$hide_gender); $orig_URL = preg_replace("/\<|\>|\"|\\\\|;/",'-',$orig_URL); if ($non_latin < 1) @@ -429,14 +507,13 @@ if ($non_latin < 1) $campaign = preg_replace('/[^-_0-9a-zA-Z]/','',$campaign); $group = preg_replace('/[^-_0-9a-zA-Z]/','',$group); $agent_email = preg_replace("/[^-\.\:\/\@\_0-9a-zA-Z]/",'-',$agent_email); - $did_id = preg_replace("/[^-_0-9a-zA-Z]/",'-',$did_id); +# $did_id = preg_replace("/[^-_0-9a-zA-Z]/",'-',$did_id); $did_extension = preg_replace("/[^-_0-9a-zA-Z]/",'-',$did_extension); $did_pattern = preg_replace("/[^:\+\*\#\.\_0-9a-zA-Z]/",'-',$did_pattern); $did_description = preg_replace("/[^- \.\,\_0-9a-zA-Z]/",'-',$did_description); $xfercallid = preg_replace("/[^-_0-9a-zA-Z]/",'-',$xfercallid); - $agent_log_id = preg_replace("/[^-_0-9a-zA-Z]/",'-',$agent_log_id); $user_group = preg_replace("/[^-_0-9a-zA-Z]/",'-',$user_group); - $called_count = preg_replace("/[^-_0-9a-zA-Z]/",'-',$called_count); +# $called_count = preg_replace("/[^-_0-9a-zA-Z]/",'-',$called_count); $did_custom_one = preg_replace('/[^- \.\:\/\@\_0-9a-zA-Z]/','-',$did_custom_one); $did_custom_two = preg_replace('/[^- \.\:\/\@\_0-9a-zA-Z]/','-',$did_custom_two); $did_custom_three = preg_replace('/[^- \.\:\/\@\_0-9a-zA-Z]/','-',$did_custom_three); @@ -454,6 +531,15 @@ if ($non_latin < 1) $ig_custom_three = preg_replace('/[^- \.\:\/\@\_0-9a-zA-Z]/','-',$ig_custom_three); $ig_custom_four = preg_replace('/[^- \.\:\/\@\_0-9a-zA-Z]/','-',$ig_custom_four); $ig_custom_five = preg_replace('/[^- \.\:\/\@\_0-9a-zA-Z]/','-',$ig_custom_five ); + $admin_submit = preg_replace('/[^-_0-9a-zA-Z]/','',$admin_submit); + $bcrypt = preg_replace('/[^-_0-9a-zA-Z]/','',$bcrypt); + $button_action = preg_replace('/[^-_0-9a-zA-Z]/','',$button_action); + $call_id = preg_replace('/[^-_\.0-9a-zA-Z]/','',$call_id); + $only_field = preg_replace('/[^-_0-9a-zA-Z]/','',$only_field); + $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); + $source_field = preg_replace('/[^-_0-9a-zA-Z]/','',$source_field); + $stage = preg_replace('/[^-_\.0-9a-zA-Z]/','',$stage); + $submit_button = preg_replace('/[^-_0-9a-zA-Z]/','',$submit_button); } else { @@ -463,14 +549,13 @@ else $campaign = preg_replace('/[^-_0-9\p{L}]/u','',$campaign); $group = preg_replace('/[^-_0-9\p{L}]/u','',$group); $agent_email = preg_replace("/[^-\.\:\/\@\_0-9\p{L}]/u",'-',$agent_email); - $did_id = preg_replace("/[^-_0-9\p{L}]/u",'-',$did_id); +# $did_id = preg_replace("/[^-_0-9\p{L}]/u",'-',$did_id); $did_extension = preg_replace("/[^-_0-9\p{L}]/u",'-',$did_extension); $did_pattern = preg_replace("/[^:\+\*\#\.\_0-9\p{L}]/u",'-',$did_pattern); $did_description = preg_replace("/[^- \.\,\_0-9\p{L}]/u",'-',$did_description); $xfercallid = preg_replace("/[^-_0-9\p{L}]/u",'-',$xfercallid); - $agent_log_id = preg_replace("/[^-_0-9\p{L}]/u",'-',$agent_log_id); $user_group = preg_replace("/[^-_0-9\p{L}]/u",'-',$user_group); - $called_count = preg_replace("/[^-_0-9\p{L}]/u",'-',$called_count); +# $called_count = preg_replace("/[^-_0-9\p{L}]/u",'-',$called_count); $did_custom_one = preg_replace('/[^- \.\:\/\@\_0-9\p{L}]/u','-',$did_custom_one); $did_custom_two = preg_replace('/[^- \.\:\/\@\_0-9\p{L}]/u','-',$did_custom_two); $did_custom_three = preg_replace('/[^- \.\:\/\@\_0-9\p{L}]/u','-',$did_custom_three); @@ -488,6 +573,15 @@ else $ig_custom_three = preg_replace('/[^- \.\:\/\@\_0-9\p{L}]/u','-',$ig_custom_three); $ig_custom_four = preg_replace('/[^- \.\:\/\@\_0-9\p{L}]/u','-',$ig_custom_four); $ig_custom_five = preg_replace('/[^- \.\:\/\@\_0-9\p{L}]/u','-',$ig_custom_five ); + $admin_submit = preg_replace('/[^-_0-9\p{L}]/u','',$admin_submit); + $bcrypt = preg_replace('/[^-_0-9\p{L}]/u','',$bcrypt); + $button_action = preg_replace('/[^-_0-9\p{L}]/u','',$button_action); + $call_id = preg_replace('/[^-_\.0-9\p{L}]/u','',$call_id); + $only_field = preg_replace('/[^-_0-9\p{L}]/u','',$only_field); + $server_ip = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$server_ip); + $source_field = preg_replace('/[^-_0-9\p{L}]/u','',$source_field); + $stage = preg_replace('/[^-_\.0-9\p{L}]/u','',$stage); + $submit_button = preg_replace('/[^-_0-9\p{L}]/u','',$submit_button); } if (strlen($SSagent_debug_logging) > 1) diff --git a/agc_2-X/trunk/www/agc/vdc_script_display.php b/agc_2-X/trunk/www/agc/vdc_script_display.php index e12392f0..afc4000c 100644 --- a/agc_2-X/trunk/www/agc/vdc_script_display.php +++ b/agc_2-X/trunk/www/agc/vdc_script_display.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed display the contents of the SCRIPT tab in the agent interface # @@ -47,10 +47,11 @@ # 220219-0144 - Added allow_web_debug system setting # 220901-0849 - Added campaign user_group_script option # 230518-1046 - Added in-group and campaign custom fields 1-5, for script/webform/dispo-call-url use +# 260302-1410 - Code updates for PHP8 compatibility # -$version = '2.14-41'; -$build = '230518-1046'; +$version = '2.14-42'; +$build = '260302-1410'; $php_script = 'vdc_script_display.php'; require_once("dbconnect_mysqli.php"); @@ -58,243 +59,356 @@ require_once("functions.php"); if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} + else {$lead_id=0;} if (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} elseif (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} + else {$vendor_id="";} $vendor_lead_code = $vendor_id; if (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} elseif (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} + else {$list_id=0;} if (isset($_GET["gmt_offset_now"])) {$gmt_offset_now=$_GET["gmt_offset_now"];} elseif (isset($_POST["gmt_offset_now"])) {$gmt_offset_now=$_POST["gmt_offset_now"];} + else {$gmt_offset_now="";} if (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} elseif (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} + else {$phone_code="";} if (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} elseif (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} + else {$phone_number="";} if (isset($_GET["title"])) {$title=$_GET["title"];} elseif (isset($_POST["title"])) {$title=$_POST["title"];} + else {$title="";} if (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} elseif (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} + else {$first_name="";} if (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} elseif (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} + else {$middle_initial="";} if (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} elseif (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} + else {$last_name="";} if (isset($_GET["address1"])) {$address1=$_GET["address1"];} elseif (isset($_POST["address1"])) {$address1=$_POST["address1"];} + else {$address1="";} if (isset($_GET["address2"])) {$address2=$_GET["address2"];} elseif (isset($_POST["address2"])) {$address2=$_POST["address2"];} + else {$address2="";} if (isset($_GET["address3"])) {$address3=$_GET["address3"];} elseif (isset($_POST["address3"])) {$address3=$_POST["address3"];} + else {$address3="";} if (isset($_GET["city"])) {$city=$_GET["city"];} elseif (isset($_POST["city"])) {$city=$_POST["city"];} + else {$city="";} if (isset($_GET["state"])) {$state=$_GET["state"];} elseif (isset($_POST["state"])) {$state=$_POST["state"];} + else {$state="";} if (isset($_GET["province"])) {$province=$_GET["province"];} elseif (isset($_POST["province"])) {$province=$_POST["province"];} + else {$province="";} if (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} elseif (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} + else {$postal_code="";} if (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} elseif (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} + else {$country_code="";} if (isset($_GET["gender"])) {$gender=$_GET["gender"];} elseif (isset($_POST["gender"])) {$gender=$_POST["gender"];} + else {$gender="";} if (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} elseif (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} + else {$date_of_birth="";} if (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} elseif (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} + else {$alt_phone="";} if (isset($_GET["email"])) {$email=$_GET["email"];} elseif (isset($_POST["email"])) {$email=$_POST["email"];} + else {$email="";} if (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} elseif (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} + else {$security_phrase="";} if (isset($_GET["comments"])) {$comments=$_GET["comments"];} elseif (isset($_POST["comments"])) {$comments=$_POST["comments"];} + else {$comments="";} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} elseif (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} + else {$campaign="";} if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} + else {$phone_login="";} if (isset($_GET["original_phone_login"])) {$original_phone_login=$_GET["original_phone_login"];} elseif (isset($_POST["original_phone_login"])) {$original_phone_login=$_POST["original_phone_login"];} + else {$original_phone_login="";} if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} + else {$phone_pass="";} if (isset($_GET["fronter"])) {$fronter=$_GET["fronter"];} elseif (isset($_POST["fronter"])) {$fronter=$_POST["fronter"];} + else {$fronter="";} if (isset($_GET["closer"])) {$closer=$_GET["closer"];} elseif (isset($_POST["closer"])) {$closer=$_POST["closer"];} + else {$closer="";} if (isset($_GET["group"])) {$group=$_GET["group"];} elseif (isset($_POST["group"])) {$group=$_POST["group"];} + else {$group="";} if (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} elseif (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} + else {$channel_group="";} if (isset($_GET["SQLdate"])) {$SQLdate=$_GET["SQLdate"];} elseif (isset($_POST["SQLdate"])) {$SQLdate=$_POST["SQLdate"];} + else {$SQLdate="";} if (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];} elseif (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];} + else {$epoch=0;} if (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} elseif (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} + else {$uniqueid="";} if (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} elseif (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} + else {$customer_zap_channel="";} if (isset($_GET["customer_server_ip"])) {$customer_server_ip=$_GET["customer_server_ip"];} elseif (isset($_POST["customer_server_ip"])) {$customer_server_ip=$_POST["customer_server_ip"];} + else {$customer_server_ip="";} if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} if (isset($_GET["SIPexten"])) {$SIPexten=$_GET["SIPexten"];} elseif (isset($_POST["SIPexten"])) {$SIPexten=$_POST["SIPexten"];} + else {$SIPexten="";} if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} + else {$session_id="";} if (isset($_GET["phone"])) {$phone=$_GET["phone"];} elseif (isset($_POST["phone"])) {$phone=$_POST["phone"];} + else {$phone="";} if (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];} elseif (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];} + else {$parked_by="";} if (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} elseif (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} + else {$dispo="";} if (isset($_GET["dialed_number"])) {$dialed_number=$_GET["dialed_number"];} elseif (isset($_POST["dialed_number"])) {$dialed_number=$_POST["dialed_number"];} + else {$dialed_number="";} if (isset($_GET["dialed_label"])) {$dialed_label=$_GET["dialed_label"];} elseif (isset($_POST["dialed_label"])) {$dialed_label=$_POST["dialed_label"];} + else {$dialed_label="";} if (isset($_GET["source_id"])) {$source_id=$_GET["source_id"];} elseif (isset($_POST["source_id"])) {$source_id=$_POST["source_id"];} + else {$source_id="";} if (isset($_GET["rank"])) {$rank=$_GET["rank"];} elseif (isset($_POST["rank"])) {$rank=$_POST["rank"];} + else {$rank="";} if (isset($_GET["owner"])) {$owner=$_GET["owner"];} elseif (isset($_POST["owner"])) {$owner=$_POST["owner"];} + else {$owner="";} if (isset($_GET["camp_script"])) {$camp_script=$_GET["camp_script"];} elseif (isset($_POST["camp_script"])) {$camp_script=$_POST["camp_script"];} + else {$camp_script="";} if (isset($_GET["in_script"])) {$in_script=$_GET["in_script"];} elseif (isset($_POST["in_script"])) {$in_script=$_POST["in_script"];} + else {$in_script="";} if (isset($_GET["SCRIPTcamp_script"])) {$SCRIPTcamp_script=$_GET["SCRIPTcamp_script"];} elseif (isset($_POST["SCRIPTcamp_script"])) {$SCRIPTcamp_script=$_POST["SCRIPTcamp_script"];} + else {$SCRIPTcamp_script="";} if (isset($_GET["SCRIPTin_script"])) {$SCRIPTin_script=$_GET["SCRIPTin_script"];} elseif (isset($_POST["SCRIPTin_script"])) {$SCRIPTin_script=$_POST["SCRIPTin_script"];} + else {$SCRIPTin_script="";} if (isset($_GET["script_width"])) {$script_width=$_GET["script_width"];} elseif (isset($_POST["script_width"])) {$script_width=$_POST["script_width"];} + else {$script_width=0;} if (isset($_GET["script_height"])) {$script_height=$_GET["script_height"];} elseif (isset($_POST["script_height"])) {$script_height=$_POST["script_height"];} + else {$script_height=0;} if (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} elseif (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} + else {$fullname="";} if (isset($_GET["agent_email"])) {$agent_email=$_GET["agent_email"];} elseif (isset($_POST["agent_email"])) {$agent_email=$_POST["agent_email"];} + else {$agent_email="";} if (isset($_GET["recording_filename"])) {$recording_filename=$_GET["recording_filename"];} elseif (isset($_POST["recording_filename"])) {$recording_filename=$_POST["recording_filename"];} + else {$recording_filename="";} if (isset($_GET["recording_id"])) {$recording_id=$_GET["recording_id"];} elseif (isset($_POST["recording_id"])) {$recording_id=$_POST["recording_id"];} + else {$recording_id=0;} if (isset($_GET["user_custom_one"])) {$user_custom_one=$_GET["user_custom_one"];} elseif (isset($_POST["user_custom_one"])) {$user_custom_one=$_POST["user_custom_one"];} + else {$user_custom_one="";} if (isset($_GET["user_custom_two"])) {$user_custom_two=$_GET["user_custom_two"];} elseif (isset($_POST["user_custom_two"])) {$user_custom_two=$_POST["user_custom_two"];} + else {$user_custom_two="";} if (isset($_GET["user_custom_three"])) {$user_custom_three=$_GET["user_custom_three"];} elseif (isset($_POST["user_custom_three"])) {$user_custom_three=$_POST["user_custom_three"];} + else {$user_custom_three="";} if (isset($_GET["user_custom_four"])) {$user_custom_four=$_GET["user_custom_four"];} elseif (isset($_POST["user_custom_four"])) {$user_custom_four=$_POST["user_custom_four"];} + else {$user_custom_four="";} if (isset($_GET["user_custom_five"])) {$user_custom_five=$_GET["user_custom_five"];} elseif (isset($_POST["user_custom_five"])) {$user_custom_five=$_POST["user_custom_five"];} + else {$user_custom_five="";} if (isset($_GET["preset_number_a"])) {$preset_number_a=$_GET["preset_number_a"];} elseif (isset($_POST["preset_number_a"])) {$preset_number_a=$_POST["preset_number_a"];} + else {$preset_number_a="";} if (isset($_GET["preset_number_b"])) {$preset_number_b=$_GET["preset_number_b"];} elseif (isset($_POST["preset_number_b"])) {$preset_number_b=$_POST["preset_number_b"];} + else {$preset_number_b="";} if (isset($_GET["preset_number_c"])) {$preset_number_c=$_GET["preset_number_c"];} elseif (isset($_POST["preset_number_c"])) {$preset_number_c=$_POST["preset_number_c"];} + else {$preset_number_c="";} if (isset($_GET["preset_number_d"])) {$preset_number_d=$_GET["preset_number_d"];} elseif (isset($_POST["preset_number_d"])) {$preset_number_d=$_POST["preset_number_d"];} + else {$preset_number_d="";} if (isset($_GET["preset_number_e"])) {$preset_number_e=$_GET["preset_number_e"];} elseif (isset($_POST["preset_number_e"])) {$preset_number_e=$_POST["preset_number_e"];} + else {$preset_number_e="";} if (isset($_GET["preset_number_f"])) {$preset_number_f=$_GET["preset_number_f"];} elseif (isset($_POST["preset_number_f"])) {$preset_number_f=$_POST["preset_number_f"];} + else {$preset_number_f="";} if (isset($_GET["preset_dtmf_a"])) {$preset_dtmf_a=$_GET["preset_dtmf_a"];} elseif (isset($_POST["preset_dtmf_a"])) {$preset_dtmf_a=$_POST["preset_dtmf_a"];} + else {$preset_dtmf_a="";} if (isset($_GET["preset_dtmf_b"])) {$preset_dtmf_b=$_GET["preset_dtmf_b"];} elseif (isset($_POST["preset_dtmf_b"])) {$preset_dtmf_b=$_POST["preset_dtmf_b"];} + else {$preset_dtmf_b="";} if (isset($_GET["did_id"])) {$did_id=$_GET["did_id"];} elseif (isset($_POST["did_id"])) {$did_id=$_POST["did_id"];} + else {$did_id="";} if (isset($_GET["did_extension"])) {$did_extension=$_GET["did_extension"];} elseif (isset($_POST["did_extension"])) {$did_extension=$_POST["did_extension"];} + else {$did_extension="";} if (isset($_GET["did_pattern"])) {$did_pattern=$_GET["did_pattern"];} elseif (isset($_POST["did_pattern"])) {$did_pattern=$_POST["did_pattern"];} + else {$did_pattern="";} if (isset($_GET["did_description"])) {$did_description=$_GET["did_description"];} elseif (isset($_POST["did_description"])) {$did_description=$_POST["did_description"];} + else {$did_description="";} if (isset($_GET["closecallid"])) {$closecallid=$_GET["closecallid"];} elseif (isset($_POST["closecallid"])) {$closecallid=$_POST["closecallid"];} + else {$closecallid=0;} if (isset($_GET["xfercallid"])) {$xfercallid=$_GET["xfercallid"];} elseif (isset($_POST["xfercallid"])) {$xfercallid=$_POST["xfercallid"];} + else {$xfercallid="";} if (isset($_GET["agent_log_id"])) {$agent_log_id=$_GET["agent_log_id"];} elseif (isset($_POST["agent_log_id"])) {$agent_log_id=$_POST["agent_log_id"];} + else {$agent_log_id="";} if (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];} elseif (isset($_POST["ScrollDIV"])) {$ScrollDIV=$_POST["ScrollDIV"];} + else {$ScrollDIV=0;} if (isset($_GET["ignore_list_script"])) {$ignore_list_script=$_GET["ignore_list_script"];} elseif (isset($_POST["ignore_list_script"])) {$ignore_list_script=$_POST["ignore_list_script"];} + else {$ignore_list_script="";} if (isset($_GET["CF_uses_custom_fields"])) {$CF_uses_custom_fields=$_GET["CF_uses_custom_fields"];} elseif (isset($_POST["CF_uses_custom_fields"])) {$CF_uses_custom_fields=$_POST["CF_uses_custom_fields"];} + else {$CF_uses_custom_fields="";} if (isset($_GET["entry_list_id"])) {$entry_list_id=$_GET["entry_list_id"];} elseif (isset($_POST["entry_list_id"])) {$entry_list_id=$_POST["entry_list_id"];} + else {$entry_list_id=0;} if (isset($_GET["call_id"])) {$call_id=$_GET["call_id"];} elseif (isset($_POST["call_id"])) {$call_id=$_POST["call_id"];} + else {$call_id="";} if (isset($_GET["user_group"])) {$user_group=$_GET["user_group"];} elseif (isset($_POST["user_group"])) {$user_group=$_POST["user_group"];} + else {$user_group="";} if (isset($_GET["web_vars"])) {$web_vars=$_GET["web_vars"];} elseif (isset($_POST["web_vars"])) {$web_vars=$_POST["web_vars"];} + else {$web_vars="";} if (isset($_GET["orig_pass"])) {$orig_pass=$_GET["orig_pass"];} elseif (isset($_POST["orig_pass"])) {$orig_pass=$_POST["orig_pass"];} + else {$orig_pass="";} if (isset($_GET["called_count"])) {$called_count=$_GET["called_count"];} elseif (isset($_POST["called_count"])) {$called_count=$_POST["called_count"];} + else {$called_count=0;} if (isset($_GET["script_override"])) {$script_override=$_GET["script_override"];} elseif (isset($_POST["script_override"])) {$script_override=$_POST["script_override"];} + else {$script_override="";} if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} if (isset($_GET["entry_date"])) {$entry_date=$_GET["entry_date"];} elseif (isset($_POST["entry_date"])) {$entry_date=$_POST["entry_date"];} + else {$entry_date="";} if (isset($_GET["did_custom_one"])) {$did_custom_one=$_GET["did_custom_one"];} elseif (isset($_POST["did_custom_one"])) {$did_custom_one=$_POST["did_custom_one"];} + else {$did_custom_one="";} if (isset($_GET["did_custom_two"])) {$did_custom_two=$_GET["did_custom_two"];} elseif (isset($_POST["did_custom_two"])) {$did_custom_two=$_POST["did_custom_two"];} + else {$did_custom_two="";} if (isset($_GET["did_custom_three"])) {$did_custom_three=$_GET["did_custom_three"];} elseif (isset($_POST["did_custom_three"])) {$did_custom_three=$_POST["did_custom_three"];} + else {$did_custom_three="";} if (isset($_GET["did_custom_four"])) {$did_custom_four=$_GET["did_custom_four"];} elseif (isset($_POST["did_custom_four"])) {$did_custom_four=$_POST["did_custom_four"];} + else {$did_custom_four="";} if (isset($_GET["did_custom_five"])) {$did_custom_five=$_GET["did_custom_five"];} elseif (isset($_POST["did_custom_five"])) {$did_custom_five=$_POST["did_custom_five"];} + else {$did_custom_five="";} if (isset($_GET["email_row_id"])) {$email_row_id=$_GET["email_row_id"];} elseif (isset($_POST["email_row_id"])) {$email_row_id=$_POST["email_row_id"];} + else {$email_row_id="";} if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["inOUT"])) {$inOUT=$_GET["inOUT"];} elseif (isset($_POST["inOUT"])) {$inOUT=$_POST["inOUT"];} + else {$inOUT="";} if (isset($_GET["LOGINvarONE"])) {$LOGINvarONE=$_GET["LOGINvarONE"];} elseif (isset($_POST["LOGINvarONE"])) {$LOGINvarONE=$_POST["LOGINvarONE"];} + else {$LOGINvarONE="";} if (isset($_GET["LOGINvarTWO"])) {$LOGINvarTWO=$_GET["LOGINvarTWO"];} elseif (isset($_POST["LOGINvarTWO"])) {$LOGINvarTWO=$_POST["LOGINvarTWO"];} + else {$LOGINvarTWO="";} if (isset($_GET["LOGINvarTHREE"])) {$LOGINvarTHREE=$_GET["LOGINvarTHREE"];} elseif (isset($_POST["LOGINvarTHREE"])) {$LOGINvarTHREE=$_POST["LOGINvarTHREE"];} + else {$LOGINvarTHREE="";} if (isset($_GET["LOGINvarFOUR"])) {$LOGINvarFOUR=$_GET["LOGINvarFOUR"];} elseif (isset($_POST["LOGINvarFOUR"])) {$LOGINvarFOUR=$_POST["LOGINvarFOUR"];} + else {$LOGINvarFOUR="";} if (isset($_GET["LOGINvarFIVE"])) {$LOGINvarFIVE=$_GET["LOGINvarFIVE"];} elseif (isset($_POST["LOGINvarFIVE"])) {$LOGINvarFIVE=$_POST["LOGINvarFIVE"];} + else {$LOGINvarFIVE="";} if (isset($_GET["script_span"])) {$script_span=$_GET["script_span"];} elseif (isset($_POST["script_span"])) {$script_span=$_POST["script_span"];} + else {$script_span="";} if (isset($_GET["user_group_script"])) {$user_group_script=$_GET["user_group_script"];} elseif (isset($_POST["user_group_script"])) {$user_group_script=$_POST["user_group_script"];} + else {$user_group_script="";} if (isset($_GET["UGscript_id"])) {$UGscript_id=$_GET["UGscript_id"];} elseif (isset($_POST["UGscript_id"])) {$UGscript_id=$_POST["UGscript_id"];} + else {$UGscript_id="";} if (isset($_GET["camp_custom_one"])) {$camp_custom_one=$_GET["camp_custom_one"];} elseif (isset($_POST["camp_custom_one"])) {$camp_custom_one=$_POST["camp_custom_one"];} + else {$camp_custom_one="";} if (isset($_GET["camp_custom_two"])) {$camp_custom_two=$_GET["camp_custom_two"];} elseif (isset($_POST["camp_custom_two"])) {$camp_custom_two=$_POST["camp_custom_two"];} + else {$camp_custom_two="";} if (isset($_GET["camp_custom_three"])) {$camp_custom_three=$_GET["camp_custom_three"];} elseif (isset($_POST["camp_custom_three"])) {$camp_custom_three=$_POST["camp_custom_three"];} + else {$camp_custom_three="";} if (isset($_GET["camp_custom_four"])) {$camp_custom_four=$_GET["camp_custom_four"];} elseif (isset($_POST["camp_custom_four"])) {$camp_custom_four=$_POST["camp_custom_four"];} + else {$camp_custom_four="";} if (isset($_GET["camp_custom_five"])) {$camp_custom_five=$_GET["camp_custom_five"];} elseif (isset($_POST["camp_custom_five"])) {$camp_custom_five=$_POST["camp_custom_five"];} + else {$camp_custom_five="";} if (isset($_GET["ig_custom_one"])) {$ig_custom_one=$_GET["ig_custom_one"];} elseif (isset($_POST["ig_custom_one"])) {$ig_custom_one=$_POST["ig_custom_one"];} + else {$ig_custom_one="";} if (isset($_GET["ig_custom_two"])) {$ig_custom_two=$_GET["ig_custom_two"];} elseif (isset($_POST["ig_custom_two"])) {$ig_custom_two=$_POST["ig_custom_two"];} + else {$ig_custom_two="";} if (isset($_GET["ig_custom_three"])) {$ig_custom_three=$_GET["ig_custom_three"];} elseif (isset($_POST["ig_custom_three"])) {$ig_custom_three=$_POST["ig_custom_three"];} + else {$ig_custom_three="";} if (isset($_GET["ig_custom_four"])) {$ig_custom_four=$_GET["ig_custom_four"];} elseif (isset($_POST["ig_custom_four"])) {$ig_custom_four=$_POST["ig_custom_four"];} + else {$ig_custom_four="";} if (isset($_GET["ig_custom_five"])) {$ig_custom_five=$_GET["ig_custom_five"];} elseif (isset($_POST["ig_custom_five"])) {$ig_custom_five=$_POST["ig_custom_five"];} - -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); + else {$ig_custom_five="";} # if options file exists, use the override values for the above variables # see the options-example.php file for more information @@ -315,7 +429,7 @@ $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); $MT[0]=''; $agents='@agents'; -$script_height = ($script_height - 20); +$script_height = ($script_height > 20 ? ($script_height - 20) : 0); $full_script_height = ($script_height + 200); $server_name = getenv("SERVER_NAME"); @@ -356,7 +470,8 @@ if ($qm_conf_ct > 0) $SSenable_second_script = $row[6]; $SSallow_web_debug = $row[7]; } -if ($SSallow_web_debug < 1) {$DB=0; $format='text';} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0; $format='text';} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -379,12 +494,11 @@ $agent_email = preg_replace("/\<|\>|\"|\\\\|;/",'-',$agent_email); $agent_log_id = preg_replace("/\<|\>|\"|\\\\|;/",'-',$agent_log_id); $alt_phone = preg_replace("/\"|\\\\|;/",'-',$alt_phone); $call_id = preg_replace("/[^-_0-9a-zA-Z]/",'-',$call_id); -$called_count = preg_replace("/\<|\>|\"|\\\\|;/",'-',$called_count); +$called_count = preg_replace("/[^0-9]/",'',$called_count); $camp_script = preg_replace("/\<|\>|\"|\\\\|;/",'-',$camp_script); -$CF_uses_custom_fields = preg_replace("/[^-_0-9a-zA-Z]/",'-',$CF_uses_custom_fields); $channel_group = preg_replace("/\<|\>|\"|\\\\|;/",'-',$channel_group); $city = preg_replace("/\"|\\\\|;/",'-',$city); -$closecallid = preg_replace("/[^-_0-9a-zA-Z]/",'-',$closecallid); +$closecallid = preg_replace("/[^0-9]/",'-',$closecallid); $closer = preg_replace("/\<|\>|\"|\\\\|;/",'-',$closer); $comments = preg_replace("/\"|\\\\|;/",'-',$comments); $country_code = preg_replace("/\"|\\\\|;/",'-',$country_code); @@ -407,8 +521,8 @@ $dispo = preg_replace("/\<|\>|\"|\\\\|;/",'-',$dispo); $email = preg_replace("/\"|\\\\|;/",'-',$email); $email_row_id = preg_replace('/[^0-9]/', '', $email_row_id); $entry_date = preg_replace("/\<|\>|\"|\\\\|;/",'-',$entry_date); -$entry_list_id = preg_replace("/^0-9]/",'',$entry_list_id); -$epoch = preg_replace("/\<|\>|\"|\\\\|;/",'-',$epoch); +$entry_list_id = preg_replace("/^[0-9]/",'',$entry_list_id); +$epoch = preg_replace("/[^0-9]/",'',$epoch); $first_name = preg_replace("/\"|\\\\|;/",'-',$first_name); $fronter = preg_replace("/\<|\>|\"|\\\\|;/",'-',$fronter); $fullname = preg_replace("/\<|\>|\"|\\\\|;/",'-',$fullname); @@ -416,7 +530,7 @@ $gender = preg_replace("/\"|\\\\|;/",'-',$gender); $gmt_offset_now = preg_replace("/\"|\\\\|;/",'-',$gmt_offset_now); $ignore_list_script = preg_replace("/\<|\>|\"|\\\\|;/",'-',$ignore_list_script); $in_script = preg_replace("/\<|\>|\"|\\\\|;/",'-',$in_script); -$inOUT=preg_replace("/[^-_0-9a-zA-Z]/","",$inOUT); +# $inOUT=preg_replace("/[^-_0-9a-zA-Z]/","",$inOUT); $last_name = preg_replace("/\"|\\\\|;/",'-',$last_name); $lead_id = preg_replace('/[^0-9]/', '', $lead_id); $list_id = preg_replace('/[^0-9]/', '', $list_id); @@ -443,14 +557,14 @@ $preset_number_f = preg_replace("/\<|\>|\"|\\\\|;/",'-',$preset_number_f); $province = preg_replace("/\"|\\\\|;/",'-',$province); $rank = preg_replace("/\<|\>|\"|\\\\|;/",'-',$rank); $recording_filename = preg_replace("/\<|\>|\"|\\\\|;/",'-',$recording_filename); -$recording_id = preg_replace("/\<|\>|\"|\\\\|;/",'-',$recording_id); +$recording_id = preg_replace("/[^0-9]/",'',$recording_id); $script_height = preg_replace("/\<|\>|\"|\\\\|;/",'-',$script_height); $script_override = preg_replace("/\<|\>|\"|\\\\|;/",'-',$script_override); -$script_span=preg_replace("/[^-_0-9a-zA-Z]/","",$script_span); -$script_width = preg_replace("/\<|\>|\"|\\\\|;/",'-',$script_width); +# $script_span=preg_replace("/[^-_0-9a-zA-Z]/","",$script_span); +$script_width = preg_replace("/[^0-9]/",'',$script_width); $SCRIPTcamp_script = preg_replace("/\<|\>|\"|\\\\|;/",'-',$SCRIPTcamp_script); $SCRIPTin_script = preg_replace("/\<|\>|\"|\\\\|;/",'-',$SCRIPTin_script); -$ScrollDIV = preg_replace("/\<|\>|\"|\\\\|;/",'-',$ScrollDIV); +$ScrollDIV = preg_replace("/[^0-9]/",'',$ScrollDIV); $security_phrase = preg_replace("/\"|\\\\|;/",'-',$security_phrase); $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); $session_id = preg_replace('/[^0-9]/','',$session_id); @@ -460,7 +574,7 @@ $source_id = preg_replace("/\<|\>|\"|\\\\|;/",'-',$source_id); $SQLdate = preg_replace("/\<|\>|\"|\\\\|;/",'-',$SQLdate); $state = preg_replace("/\"|\\\\|;/",'-',$state); $title = preg_replace("/\"|\\\\|;/",'-',$title); -$uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); +# $uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); $user_custom_five = preg_replace("/\"|\\\\|;/",'-',$user_custom_five); $user_custom_four = preg_replace("/\"|\\\\|;/",'-',$user_custom_four); $user_custom_one = preg_replace("/\"|\\\\|;/",'-',$user_custom_one); @@ -471,7 +585,7 @@ $vendor_id = preg_replace("/\"|\\\\|;/",'-',$vendor_id); $vendor_lead_code = preg_replace("/\"|\\\\|;/",'-',$vendor_lead_code); $web_vars = preg_replace("/\<|\>|\'|\"|\\\\|;/",'-',$web_vars); $xfercallid = preg_replace("/\<|\>|\"|\\\\|;/",'-',$xfercallid); -$user_group_script=preg_replace("/[^-_0-9a-zA-Z]/","",$user_group_script); +# $user_group_script=preg_replace("/[^-_0-9a-zA-Z]/","",$user_group_script); if ($non_latin < 1) { @@ -489,6 +603,7 @@ if ($non_latin < 1) $SCRIPTcamp_script = preg_replace("/[^-_0-9a-zA-Z]/",'',$SCRIPTcamp_script); $SCRIPTin_script = preg_replace("/[^-_0-9a-zA-Z]/",'',$SCRIPTin_script); $agent_email = preg_replace("/[^-\.\:\/\@\_0-9a-zA-Z]/",'-',$agent_email); + $CF_uses_custom_fields = preg_replace("/[^-_0-9a-zA-Z]/",'-',$CF_uses_custom_fields); $did_id = preg_replace("/[^-_0-9a-zA-Z]/",'-',$did_id); $did_extension = preg_replace("/[^-_0-9a-zA-Z]/",'-',$did_extension); $did_pattern = preg_replace("/[^:\+\*\#\.\_0-9a-zA-Z]/",'-',$did_pattern); @@ -496,7 +611,7 @@ if ($non_latin < 1) $xfercallid = preg_replace("/[^-_0-9a-zA-Z]/",'-',$xfercallid); $agent_log_id = preg_replace("/[^-_0-9a-zA-Z]/",'-',$agent_log_id); $user_group = preg_replace("/[^-_0-9a-zA-Z]/",'-',$user_group); - $called_count = preg_replace("/[^-_0-9a-zA-Z]/",'-',$called_count); +# $called_count = preg_replace("/[^-_0-9a-zA-Z]/",'-',$called_count); $script_override = preg_replace("/[^-_0-9a-zA-Z]/",'-',$script_override); $entry_date = preg_replace("/[^- \.\:\,\_0-9a-zA-Z]/",'-',$entry_date); $did_custom_one = preg_replace('/[^- \.\:\/\@\_0-9a-zA-Z]/','-',$did_custom_one); @@ -515,6 +630,10 @@ if ($non_latin < 1) $ig_custom_three = preg_replace('/[^- \.\:\/\@\_0-9a-zA-Z]/','-',$ig_custom_three); $ig_custom_four = preg_replace('/[^- \.\:\/\@\_0-9a-zA-Z]/','-',$ig_custom_four); $ig_custom_five = preg_replace('/[^- \.\:\/\@\_0-9a-zA-Z]/','-',$ig_custom_five ); + $inOUT=preg_replace("/[^-_0-9a-zA-Z]/","",$inOUT); + $script_span=preg_replace("/[^-_0-9a-zA-Z]/","",$script_span); + $uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); + $user_group_script=preg_replace("/[^-_0-9a-zA-Z]/","",$user_group_script); } else { @@ -532,6 +651,7 @@ else $SCRIPTcamp_script = preg_replace("/[^-_0-9\p{L}]/u",'',$SCRIPTcamp_script); $SCRIPTin_script = preg_replace("/[^-_0-9\p{L}]/u",'',$SCRIPTin_script); $agent_email = preg_replace("/[^-\.\:\/\@\_0-9\p{L}]/u",'-',$agent_email); + $CF_uses_custom_fields = preg_replace("/[^-_0-9\p{L}]/u",'-',$CF_uses_custom_fields); $did_id = preg_replace("/[^-_0-9\p{L}]/u",'-',$did_id); $did_extension = preg_replace("/[^-_0-9\p{L}]/u",'-',$did_extension); $did_pattern = preg_replace("/[^:\+\*\#\.\_0-9\p{L}]/u",'-',$did_pattern); @@ -539,7 +659,7 @@ else $xfercallid = preg_replace("/[^-_0-9\p{L}]/u",'-',$xfercallid); $agent_log_id = preg_replace("/[^-_0-9\p{L}]/u",'-',$agent_log_id); $user_group = preg_replace("/[^-_0-9\p{L}]/u",'-',$user_group); - $called_count = preg_replace("/[^-_0-9\p{L}]/u",'-',$called_count); +# $called_count = preg_replace("/[^-_0-9\p{L}]/u",'-',$called_count); $script_override = preg_replace("/[^-_0-9\p{L}]/u",'-',$script_override); $entry_date = preg_replace("/[^- \.\:\,\_0-9\p{L}]/u",'-',$entry_date); $did_custom_one = preg_replace('/[^- \.\:\/\@\_0-9\p{L}]/u','-',$did_custom_one); @@ -558,6 +678,10 @@ else $ig_custom_three = preg_replace('/[^- \.\:\/\@\_0-9\p{L}]/u','-',$ig_custom_three); $ig_custom_four = preg_replace('/[^- \.\:\/\@\_0-9\p{L}]/u','-',$ig_custom_four); $ig_custom_five = preg_replace('/[^- \.\:\/\@\_0-9\p{L}]/u','-',$ig_custom_five ); + $inOUT=preg_replace("/[^-_0-9\p{L}]/u","",$inOUT); + $script_span=preg_replace("/[^-_0-9\p{L}]/u","",$script_span); + $uniqueid = preg_replace('/[^-_\.0-9\p{L}]/u','',$uniqueid); + $user_group_script=preg_replace("/[^-_0-9\p{L}]/u","",$user_group_script); } $auth=0; @@ -608,30 +732,47 @@ if ($DB > 0) {echo "DEBUG: |$ignore_list_script|$script_span|$user_group_script| if ( ($ignore_list_script < 1) and ($script_span != 'Script2Contents') and ( ($user_group_script != 'ENABLED') or (strlen($UGscript_id)<1) ) ) { # $stmt="SELECT agent_script_override from vicidial_lists where list_id='$list_id';"; + $agent_script_override=''; $stmt="SELECT if('$inOUT'= 'IN',if(inbound_list_script_override is null or inbound_list_script_override='',agent_script_override,inbound_list_script_override),agent_script_override) from vicidial_lists where list_id='$list_id';"; if ($DB) {echo "$stmt\n";} $rslt=mysql_to_mysqli($stmt, $link); - $row=mysqli_fetch_row($rslt); - $agent_script_override = $row[0]; + if (mysqli_num_rows($rslt)>0) + { + $row=mysqli_fetch_row($rslt); + $agent_script_override = $row[0]; + } if (strlen($agent_script_override) > 0) {$call_script = $agent_script_override;} } +$list_name=''; $list_description=''; $stmt="SELECT list_name,list_description from vicidial_lists where list_id='$list_id';"; $rslt=mysql_to_mysqli($stmt, $link); -$row=mysqli_fetch_row($rslt); -$list_name = $row[0]; -$list_description = $row[1]; +if (mysqli_num_rows($rslt)>0) + { + $row=mysqli_fetch_row($rslt); + $list_name = $row[0]; + $list_description = $row[1]; + } if (strlen($script_override)>1) {$call_script = $script_override;} $stmt="SELECT script_name,script_text,script_color from vicidial_scripts where script_id='$call_script';"; $rslt=mysql_to_mysqli($stmt, $link); -$row=mysqli_fetch_row($rslt); -$script_name = $row[0]; -$script_text = stripslashes($row[1]); -$script_color = $row[2]; +if (mysqli_num_rows($rslt)>0) + { + $row=mysqli_fetch_row($rslt); + $script_name = $row[0]; + $script_text = stripslashes($row[1]); + $script_color = $row[2]; + } +else + { + $script_name=""; + $script_text=""; + $script_color=""; + } if (preg_match("/iframe\ssrc/i",$script_text)) { @@ -1208,7 +1349,7 @@ $script_text = stripslashes($script_text); echo "\n"; -echo "\n"; +# echo "\n"; # Never used if ( ( ($IFRAME < 1) and ($ScrollDIV > 0) ) or (preg_match("/IGNORENOSCROLL/i",$script_text)) ) { echo "
    "._QXZ("Date received:")."$row[email_date]
    "._QXZ("From:")."$row[email_from]
    "._QXZ("Subject:")."$row[subject]
    -
    "; diff --git a/agc_2-X/trunk/www/agc/vdc_script_dispo_example.php b/agc_2-X/trunk/www/agc/vdc_script_dispo_example.php index c0adebd6..115a458d 100644 --- a/agc_2-X/trunk/www/agc/vdc_script_dispo_example.php +++ b/agc_2-X/trunk/www/agc/vdc_script_dispo_example.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed to be used in the SCRIPT tab in an IFRAME and will not submit unless a specific field is filled in # @@ -25,10 +25,11 @@ # 210616-2035 - Added optional CORS support, see options.php for details # 210825-0838 - Fix for security issue # 220219-0137 - Added allow_web_debug system setting +# 260303-0720 - Code updates for PHP8 compatibility # -$version = '2.14-13'; -$build = '220219-0136'; +$version = '2.14-14'; +$build = '260303-0720'; $php_script = 'vdc_script_dispo_example.php'; require_once("dbconnect_mysqli.php"); @@ -50,192 +51,272 @@ $extra_statuses = "'CALLBK'"; if (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} elseif (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + else {$lead_id=0;} if (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} elseif (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} + else {$vendor_id="";} $vendor_lead_code = $vendor_id; if (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} elseif (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + else {$list_id=0;} if (isset($_POST["gmt_offset_now"])) {$gmt_offset_now=$_POST["gmt_offset_now"];} elseif (isset($_GET["gmt_offset_now"])) {$gmt_offset_now=$_GET["gmt_offset_now"];} + else {$gmt_offset_now="";} if (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} elseif (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + else {$phone_code="";} if (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} elseif (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + else {$phone_number="";} if (isset($_POST["title"])) {$title=$_POST["title"];} elseif (isset($_GET["title"])) {$title=$_GET["title"];} + else {$title="";} if (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} elseif (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} + else {$first_name="";} if (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} elseif (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} + else {$middle_initial="";} if (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} elseif (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} + else {$last_name="";} if (isset($_POST["address1"])) {$address1=$_POST["address1"];} elseif (isset($_GET["address1"])) {$address1=$_GET["address1"];} + else {$address1="";} if (isset($_POST["address2"])) {$address2=$_POST["address2"];} elseif (isset($_GET["address2"])) {$address2=$_GET["address2"];} + else {$address2="";} if (isset($_POST["address3"])) {$address3=$_POST["address3"];} elseif (isset($_GET["address3"])) {$address3=$_GET["address3"];} + else {$address3="";} if (isset($_POST["city"])) {$city=$_POST["city"];} elseif (isset($_GET["city"])) {$city=$_GET["city"];} + else {$city="";} if (isset($_POST["state"])) {$state=$_POST["state"];} elseif (isset($_GET["state"])) {$state=$_GET["state"];} + else {$state="";} if (isset($_POST["province"])) {$province=$_POST["province"];} elseif (isset($_GET["province"])) {$province=$_GET["province"];} + else {$province="";} if (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} elseif (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} + else {$postal_code="";} if (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} elseif (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} + else {$country_code="";} if (isset($_POST["gender"])) {$gender=$_POST["gender"];} elseif (isset($_GET["gender"])) {$gender=$_GET["gender"];} + else {$gender="";} if (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} elseif (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} + else {$date_of_birth="";} if (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} elseif (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} + else {$alt_phone="";} if (isset($_POST["email"])) {$email=$_POST["email"];} elseif (isset($_GET["email"])) {$email=$_GET["email"];} + else {$email="";} if (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} elseif (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} + else {$security_phrase="";} if (isset($_POST["comments"])) {$comments=$_POST["comments"];} elseif (isset($_GET["comments"])) {$comments=$_GET["comments"];} + else {$comments="";} if (isset($_POST["user"])) {$user=$_POST["user"];} elseif (isset($_GET["user"])) {$user=$_GET["user"];} + else {$user="";} if (isset($_POST["pass"])) {$pass=$_POST["pass"];} elseif (isset($_GET["pass"])) {$pass=$_GET["pass"];} + else {$pass="";} if (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} elseif (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} + else {$campaign="";} if (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} elseif (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + else {$phone_login="";} if (isset($_POST["original_phone_login"])) {$original_phone_login=$_POST["original_phone_login"];} elseif (isset($_GET["original_phone_login"])) {$original_phone_login=$_GET["original_phone_login"];} + else {$original_phone_login="";} if (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} elseif (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + else {$phone_pass="";} if (isset($_POST["fronter"])) {$fronter=$_POST["fronter"];} elseif (isset($_GET["fronter"])) {$fronter=$_GET["fronter"];} + else {$fronter="";} if (isset($_POST["closer"])) {$closer=$_POST["closer"];} elseif (isset($_GET["closer"])) {$closer=$_GET["closer"];} + else {$closer="";} if (isset($_POST["group"])) {$group=$_POST["group"];} elseif (isset($_GET["group"])) {$group=$_GET["group"];} + else {$group="";} if (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} elseif (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} + else {$channel_group="";} if (isset($_POST["SQLdate"])) {$SQLdate=$_POST["SQLdate"];} elseif (isset($_GET["SQLdate"])) {$SQLdate=$_GET["SQLdate"];} + else {$SQLdate="";} if (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];} elseif (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];} + else {$epoch="";} if (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} elseif (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} + else {$uniqueid="";} if (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} elseif (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} + else {$customer_zap_channel="";} if (isset($_POST["customer_server_ip"])) {$customer_server_ip=$_POST["customer_server_ip"];} elseif (isset($_GET["customer_server_ip"])) {$customer_server_ip=$_GET["customer_server_ip"];} + else {$customer_server_ip="";} if (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} elseif (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} if (isset($_POST["SIPexten"])) {$SIPexten=$_POST["SIPexten"];} elseif (isset($_GET["SIPexten"])) {$SIPexten=$_GET["SIPexten"];} + else {$SIPexten="";} if (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} elseif (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + else {$session_id="";} if (isset($_POST["phone"])) {$phone=$_POST["phone"];} elseif (isset($_GET["phone"])) {$phone=$_GET["phone"];} + else {$phone="";} if (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];} elseif (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];} + else {$parked_by="";} if (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} elseif (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} + else {$dispo="";} if (isset($_POST["dialed_number"])) {$dialed_number=$_POST["dialed_number"];} elseif (isset($_GET["dialed_number"])) {$dialed_number=$_GET["dialed_number"];} + else {$dialed_number="";} if (isset($_POST["dialed_label"])) {$dialed_label=$_POST["dialed_label"];} elseif (isset($_GET["dialed_label"])) {$dialed_label=$_GET["dialed_label"];} + else {$dialed_label="";} if (isset($_POST["source_id"])) {$source_id=$_POST["source_id"];} elseif (isset($_GET["source_id"])) {$source_id=$_GET["source_id"];} + else {$source_id="";} if (isset($_POST["rank"])) {$rank=$_POST["rank"];} elseif (isset($_GET["rank"])) {$rank=$_GET["rank"];} + else {$rank="";} if (isset($_POST["owner"])) {$owner=$_POST["owner"];} elseif (isset($_GET["owner"])) {$owner=$_GET["owner"];} + else {$owner="";} if (isset($_POST["camp_script"])) {$camp_script=$_POST["camp_script"];} elseif (isset($_GET["camp_script"])) {$camp_script=$_GET["camp_script"];} + else {$camp_script="";} if (isset($_POST["in_script"])) {$in_script=$_POST["in_script"];} elseif (isset($_GET["in_script"])) {$in_script=$_GET["in_script"];} + else {$in_script="";} if (isset($_POST["script_width"])) {$script_width=$_POST["script_width"];} elseif (isset($_GET["script_width"])) {$script_width=$_GET["script_width"];} + else {$script_width=0;} if (isset($_POST["script_height"])) {$script_height=$_POST["script_height"];} elseif (isset($_GET["script_height"])) {$script_height=$_GET["script_height"];} + else {$script_height=0;} if (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} elseif (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} + else {$fullname="";} if (isset($_POST["recording_filename"])) {$recording_filename=$_POST["recording_filename"];} elseif (isset($_GET["recording_filename"])) {$recording_filename=$_GET["recording_filename"];} + else {$recording_filename="";} if (isset($_POST["recording_id"])) {$recording_id=$_POST["recording_id"];} elseif (isset($_GET["recording_id"])) {$recording_id=$_GET["recording_id"];} + else {$recording_id="";} if (isset($_POST["user_custom_one"])) {$user_custom_one=$_POST["user_custom_one"];} elseif (isset($_GET["user_custom_one"])) {$user_custom_one=$_GET["user_custom_one"];} + else {$user_custom_one="";} if (isset($_POST["user_custom_two"])) {$user_custom_two=$_POST["user_custom_two"];} elseif (isset($_GET["user_custom_two"])) {$user_custom_two=$_GET["user_custom_two"];} + else {$user_custom_two="";} if (isset($_POST["user_custom_three"])) {$user_custom_three=$_POST["user_custom_three"];} elseif (isset($_GET["user_custom_three"])) {$user_custom_three=$_GET["user_custom_three"];} + else {$user_custom_three="";} if (isset($_POST["user_custom_four"])) {$user_custom_four=$_POST["user_custom_four"];} elseif (isset($_GET["user_custom_four"])) {$user_custom_four=$_GET["user_custom_four"];} + else {$user_custom_four="";} if (isset($_POST["user_custom_five"])) {$user_custom_five=$_POST["user_custom_five"];} elseif (isset($_GET["user_custom_five"])) {$user_custom_five=$_GET["user_custom_five"];} + else {$user_custom_five="";} if (isset($_POST["preset_number_a"])) {$preset_number_a=$_POST["preset_number_a"];} elseif (isset($_GET["preset_number_a"])) {$preset_number_a=$_GET["preset_number_a"];} + else {$preset_number_a="";} if (isset($_POST["preset_number_b"])) {$preset_number_b=$_POST["preset_number_b"];} elseif (isset($_GET["preset_number_b"])) {$preset_number_b=$_GET["preset_number_b"];} + else {$preset_number_b="";} if (isset($_POST["preset_number_c"])) {$preset_number_c=$_POST["preset_number_c"];} elseif (isset($_GET["preset_number_c"])) {$preset_number_c=$_GET["preset_number_c"];} + else {$preset_number_c="";} if (isset($_POST["preset_number_d"])) {$preset_number_d=$_POST["preset_number_d"];} elseif (isset($_GET["preset_number_d"])) {$preset_number_d=$_GET["preset_number_d"];} + else {$preset_number_d="";} if (isset($_POST["preset_number_e"])) {$preset_number_e=$_POST["preset_number_e"];} elseif (isset($_GET["preset_number_e"])) {$preset_number_e=$_GET["preset_number_e"];} + else {$preset_number_e="";} if (isset($_POST["preset_number_f"])) {$preset_number_f=$_POST["preset_number_f"];} elseif (isset($_GET["preset_number_f"])) {$preset_number_f=$_GET["preset_number_f"];} + else {$preset_number_f="";} if (isset($_POST["preset_dtmf_a"])) {$preset_dtmf_a=$_POST["preset_dtmf_a"];} elseif (isset($_GET["preset_dtmf_a"])) {$preset_dtmf_a=$_GET["preset_dtmf_a"];} + else {$preset_dtmf_a="";} if (isset($_POST["preset_dtmf_b"])) {$preset_dtmf_b=$_POST["preset_dtmf_b"];} elseif (isset($_GET["preset_dtmf_b"])) {$preset_dtmf_b=$_GET["preset_dtmf_b"];} + else {$preset_dtmf_b="";} if (isset($_POST["ScrollDIV"])) {$ScrollDIV=$_POST["ScrollDIV"];} elseif (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];} + else {$ScrollDIV=0;} if (isset($_POST["ignore_list_script"])) {$ignore_list_script=$_POST["ignore_list_script"];} elseif (isset($_GET["ignore_list_script"])) {$ignore_list_script=$_GET["ignore_list_script"];} + else {$ignore_list_script="";} if (isset($_POST["entry_list_id"])) {$entry_list_id=$_POST["entry_list_id"];} elseif (isset($_GET["entry_list_id"])) {$entry_list_id=$_GET["entry_list_id"];} + else {$entry_list_id=0;} if (isset($_POST["status"])) {$status=$_POST["status"];} elseif (isset($_GET["status"])) {$status=$_GET["status"];} + else {$status="";} if (isset($_POST["pause"])) {$pause=$_POST["pause"];} elseif (isset($_GET["pause"])) {$pause=$_GET["pause"];} + else {$pause="";} if (isset($_POST["DB"])) {$DB=$_POST["DB"];} elseif (isset($_GET["DB"])) {$DB=$_GET["DB"];} if (isset($_POST["process"])) {$process=$_POST["process"];} elseif (isset($_GET["process"])) {$process=$_GET["process"];} + else {$process=0;} if (isset($_POST["vicidial_id"])) {$vicidial_id=$_POST["vicidial_id"];} elseif (isset($_GET["vicidial_id"])) {$vicidial_id=$_GET["vicidial_id"];} if (isset($_POST["closecallid"])) {$closecallid=$_POST["closecallid"];} elseif (isset($_GET["closecallid"])) {$closecallid=$_GET["closecallid"];} + else {$closecallid="";} ##### BEGIN Put custom fields parsing and input here ##### if (isset($_POST["question"])) {$question=$_POST["question"];} elseif (isset($_GET["question"])) {$question=$_GET["question"];} + else {$question="";} if (isset($_POST["answer"])) {$answer=$_POST["answer"];} elseif (isset($_GET["answer"])) {$answer=$_GET["answer"];} + else {$answer="";} if (isset($_POST["call_date"])) {$call_date=$_POST["call_date"];} elseif (isset($_GET["call_date"])) {$call_date=$_GET["call_date"];} + else {$call_date="";} if (isset($_POST["order_id"])) {$order_id=$_POST["order_id"];} elseif (isset($_GET["order_id"])) {$order_id=$_GET["order_id"];} + else {$order_id="";} if (isset($_POST["appointment_date"])) {$appointment_date=$_POST["appointment_date"];} elseif (isset($_GET["appointment_date"])) {$appointment_date=$_GET["appointment_date"];} + else {$appointment_date="";} if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_time"];} elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];} + else {$appointment_time="";} if (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} elseif (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} + else {$call_notes="";} if (isset($_POST["notesid"])) {$notesid=$_POST["notesid"];} elseif (isset($_GET["notesid"])) {$notesid=$_GET["notesid"];} -if ($notesid < 100) - {$notesid=0;} + else {$notesid=0;} $vicidial_id = $closecallid; if (strlen($vicidial_id) < 1) {$vicidial_id = $uniqueid;} if (strlen($appointment_time) < 1) {$appointment_time = '12:00:00';} -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); - ##### END Put custom fields here ##### # if options file exists, use the override values for the above variables @@ -289,7 +370,8 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[5]; $SSallow_web_debug = $row[6]; } -if ($SSallow_web_debug < 1) {$DB=0;} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0;} +$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -310,20 +392,20 @@ $list_id = preg_replace('/[^0-9]/', '', $list_id); $notesid = preg_replace('/[^0-9]/', '', $notesid); $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); $session_id = preg_replace('/[^0-9]/','',$session_id); -$uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); -$campaign = preg_replace('/[^-_0-9a-zA-Z]/','',$campaign); -$group = preg_replace('/[^-_0-9a-zA-Z]/','',$group); -$question = preg_replace("/\'|\"|\\\\|;/","",$question); -$answer = preg_replace("/\'|\"|\\\\|;/","",$answer); +# $uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); +# $campaign = preg_replace('/[^-_0-9a-zA-Z]/','',$campaign); +# $group = preg_replace('/[^-_0-9a-zA-Z]/','',$group); +# $question = preg_replace("/\'|\"|\\\\|;/","",$question); +# $answer = preg_replace("/\'|\"|\\\\|;/","",$answer); $status = preg_replace("/\'|\"|\\\\|;/","",$status); $entry_list_id = preg_replace("/^0-9]/",'',$entry_list_id); -$notesid = preg_replace('/[^0-9]/', '', $notesid); -$server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); -$session_id = preg_replace('/[^0-9]/','',$session_id); -$uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); +# $notesid = preg_replace('/[^0-9]/', '', $notesid); +# $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); +# $session_id = preg_replace('/[^0-9]/','',$session_id); +# $uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); $session_name = preg_replace("/\'|\"|\\\\|;/","",$session_name); -$phone_code = preg_replace("/[^0-9]/","",$phone_code); -$phone_number = preg_replace("/[^0-9]/","",$phone_number); +# $phone_code = preg_replace("/[^0-9]/","",$phone_code); +# $phone_number = preg_replace("/[^0-9]/","",$phone_number); $vendor_id = preg_replace("/\"|\\\\|;/",'-',$vendor_id); $vendor_lead_code = preg_replace("/\"|\\\\|;/",'-',$vendor_lead_code); $gmt_offset_now = preg_replace("/\"|\\\\|;/",'-',$gmt_offset_now); @@ -367,8 +449,8 @@ $rank = preg_replace("/\<|\>|\"|\\\\|;/",'-',$rank); $owner = preg_replace("/\<|\>|\"|\\\\|;/",'-',$owner); $camp_script = preg_replace("/\<|\>|\"|\\\\|;/",'-',$camp_script); $in_script = preg_replace("/\<|\>|\"|\\\\|;/",'-',$in_script); -$script_width = preg_replace("/\<|\>|\"|\\\\|;/",'-',$script_width); -$script_height = preg_replace("/\<|\>|\"|\\\\|;/",'-',$script_height); +$script_width = preg_replace("/[^0-9]/",'',$script_width); +$script_height = preg_replace("/[^0-9]/",'',$script_height); $fullname = preg_replace("/\<|\>|\"|\\\\|;/",'-',$fullname); $recording_filename = preg_replace("/\<|\>|\"|\\\\|;/",'-',$recording_filename); $recording_id = preg_replace("/\<|\>|\"|\\\\|;/",'-',$recording_id); @@ -388,18 +470,18 @@ $preset_dtmf_b = preg_replace("/\<|\>|\"|\\\\|;/",'-',$preset_dtmf_b); $ScrollDIV = preg_replace("/\<|\>|\"|\\\\|;/",'-',$ScrollDIV); $ignore_list_script = preg_replace("/\<|\>|\"|\\\\|;/",'-',$ignore_list_script); $DB = preg_replace("/\"|\\\\|;/",'-',$DB); -$process = preg_replace("/\"|\\\\|;/",'-',$process); +$process = preg_replace("/[^0-9]/",'',$process); $vicidial_id = preg_replace("/\"|\\\\|;/",'-',$vicidial_id); $call_date = preg_replace("/\"|\\\\|;/",'-',$call_date); $order_id = preg_replace("/\"|\\\\|;/",'-',$order_id); $appointment_date = preg_replace("/\<|\>|\"|\\\\|;/",'-',$appointment_date); $appointment_time = preg_replace("/\<|\>|\"|\\\\|;/",'-',$appointment_time); -$call_notes = preg_replace("/\<|\>|\"|\\\\|;/",'-',$call_notes ); +$call_notes = preg_replace("/\<|\>|\"|\\\\|;/",'-',$call_notes); $pause = preg_replace("/\<|\>|\'|\"|\\\\|;/",'-',$pause); -$closecallid = preg_replace("/[^-_0-9a-zA-Z]/",'-',$closecallid); +# $closecallid = preg_replace("/[^-_0-9a-zA-Z]/",'-',$closecallid); $question = preg_replace("/\<|\>|\"|\\\\|;/",'-',$question); $answer = preg_replace("/\<|\>|\"|\\\\|;/",'-',$answer); -$length_in_sec = preg_replace("/[^0-9]/","",$length_in_sec); +# $length_in_sec = preg_replace("/[^0-9]/","",$length_in_sec); $phone_code = preg_replace("/[^0-9]/","",$phone_code); $phone_number = preg_replace("/[^0-9]/","",$phone_number); @@ -409,6 +491,9 @@ if ($non_latin < 1) $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); $status=preg_replace("/[^-_0-9a-zA-Z]/","",$status); $campaign=preg_replace("/[^-_0-9a-zA-Z]/","",$campaign); + $closecallid = preg_replace("/[^-_0-9a-zA-Z]/",'-',$closecallid); + $uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); + $group = preg_replace('/[^-_0-9a-zA-Z]/','',$group); } else { @@ -416,12 +501,18 @@ else $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); $campaign=preg_replace("/[^-_0-9\p{L}]/u","",$campaign); $status=preg_replace("/[^-_0-9\p{L}]/u","",$status); + $closecallid = preg_replace("/[^-_0-9\p{L}]/u",'-',$closecallid); + $uniqueid = preg_replace('/[^-_\.0-9\p{L}]/u','',$uniqueid); + $group = preg_replace('/[^-_0-9\p{L}]/u','',$group); } $appointment_timeARRAY = explode(":",$appointment_time); $appointment_hour = $appointment_timeARRAY[0]; $appointment_min = $appointment_timeARRAY[1]; +if ($notesid < 100) + {$notesid=0;} + if ($DB > 0) { echo "
    $lead_id|$entry_date|$modify_date|$status|$user|$vendor_lead_code|$source_id|$list_id|$gmt_offset_now|$called_since_last_reset|$phone_code|$phone_number|$title|$first_name|$middle_initial|$last_name|$address1|$address2|$address3|$city|$state|$province|$postal_code|$country_code|$gender|$date_of_birth|$alt_phone|$email|$security_phrase|$comments|$called_count|$last_local_call_time|$rank|$owner|\n
    "; diff --git a/agc_2-X/trunk/www/agc/vdc_script_notes.php b/agc_2-X/trunk/www/agc/vdc_script_notes.php index a1a102a4..eebf685d 100644 --- a/agc_2-X/trunk/www/agc/vdc_script_notes.php +++ b/agc_2-X/trunk/www/agc/vdc_script_notes.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed open in the SCRIPT tab in the agent interface through # an IFRAME. It will create a new record for every SUBMIT @@ -23,10 +23,11 @@ # 210616-2034 - Added optional CORS support, see options.php for details # 210825-0901 - Fix for XSS security issue # 220219-0136 - Added allow_web_debug system setting +# 260303-0712 - Code updates for PHP8 compatibility # -$version = '2.14-13'; -$build = '220219-0136'; +$version = '2.14-14'; +$build = '260303-0712'; $php_script = 'vdc_script_notes.php'; require_once("dbconnect_mysqli.php"); @@ -35,177 +36,252 @@ require_once("functions.php"); if (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} elseif (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} + else {$lead_id=0;} if (isset($_POST["vendor_id"])) {$vendor_id=$_POST["vendor_id"];} elseif (isset($_GET["vendor_id"])) {$vendor_id=$_GET["vendor_id"];} + else {$vendor_id="";} $vendor_lead_code = $vendor_id; if (isset($_POST["list_id"])) {$list_id=$_POST["list_id"];} elseif (isset($_GET["list_id"])) {$list_id=$_GET["list_id"];} + else {$list_id=0;} if (isset($_POST["gmt_offset_now"])) {$gmt_offset_now=$_POST["gmt_offset_now"];} elseif (isset($_GET["gmt_offset_now"])) {$gmt_offset_now=$_GET["gmt_offset_now"];} + else {$gmt_offset_now="";} if (isset($_POST["phone_code"])) {$phone_code=$_POST["phone_code"];} elseif (isset($_GET["phone_code"])) {$phone_code=$_GET["phone_code"];} + else {$phone_code="";} if (isset($_POST["phone_number"])) {$phone_number=$_POST["phone_number"];} elseif (isset($_GET["phone_number"])) {$phone_number=$_GET["phone_number"];} + else {$phone_number="";} if (isset($_POST["title"])) {$title=$_POST["title"];} elseif (isset($_GET["title"])) {$title=$_GET["title"];} + else {$title="";} if (isset($_POST["first_name"])) {$first_name=$_POST["first_name"];} elseif (isset($_GET["first_name"])) {$first_name=$_GET["first_name"];} + else {$first_name="";} if (isset($_POST["middle_initial"])) {$middle_initial=$_POST["middle_initial"];} elseif (isset($_GET["middle_initial"])) {$middle_initial=$_GET["middle_initial"];} + else {$middle_initial="";} if (isset($_POST["last_name"])) {$last_name=$_POST["last_name"];} elseif (isset($_GET["last_name"])) {$last_name=$_GET["last_name"];} + else {$last_name="";} if (isset($_POST["address1"])) {$address1=$_POST["address1"];} elseif (isset($_GET["address1"])) {$address1=$_GET["address1"];} + else {$address1="";} if (isset($_POST["address2"])) {$address2=$_POST["address2"];} elseif (isset($_GET["address2"])) {$address2=$_GET["address2"];} + else {$address2="";} if (isset($_POST["address3"])) {$address3=$_POST["address3"];} elseif (isset($_GET["address3"])) {$address3=$_GET["address3"];} + else {$address3="";} if (isset($_POST["city"])) {$city=$_POST["city"];} elseif (isset($_GET["city"])) {$city=$_GET["city"];} + else {$city="";} if (isset($_POST["state"])) {$state=$_POST["state"];} elseif (isset($_GET["state"])) {$state=$_GET["state"];} + else {$state="";} if (isset($_POST["province"])) {$province=$_POST["province"];} elseif (isset($_GET["province"])) {$province=$_GET["province"];} + else {$province="";} if (isset($_POST["postal_code"])) {$postal_code=$_POST["postal_code"];} elseif (isset($_GET["postal_code"])) {$postal_code=$_GET["postal_code"];} + else {$postal_code="";} if (isset($_POST["country_code"])) {$country_code=$_POST["country_code"];} elseif (isset($_GET["country_code"])) {$country_code=$_GET["country_code"];} + else {$country_code="";} if (isset($_POST["gender"])) {$gender=$_POST["gender"];} elseif (isset($_GET["gender"])) {$gender=$_GET["gender"];} + else {$gender="";} if (isset($_POST["date_of_birth"])) {$date_of_birth=$_POST["date_of_birth"];} elseif (isset($_GET["date_of_birth"])) {$date_of_birth=$_GET["date_of_birth"];} + else {$date_of_birth="";} if (isset($_POST["alt_phone"])) {$alt_phone=$_POST["alt_phone"];} elseif (isset($_GET["alt_phone"])) {$alt_phone=$_GET["alt_phone"];} + else {$alt_phone="";} if (isset($_POST["email"])) {$email=$_POST["email"];} elseif (isset($_GET["email"])) {$email=$_GET["email"];} + else {$email="";} if (isset($_POST["security_phrase"])) {$security_phrase=$_POST["security_phrase"];} elseif (isset($_GET["security_phrase"])) {$security_phrase=$_GET["security_phrase"];} + else {$security_phrase="";} if (isset($_POST["comments"])) {$comments=$_POST["comments"];} elseif (isset($_GET["comments"])) {$comments=$_GET["comments"];} + else {$comments="";} if (isset($_POST["user"])) {$user=$_POST["user"];} elseif (isset($_GET["user"])) {$user=$_GET["user"];} + else {$user="";} if (isset($_POST["pass"])) {$pass=$_POST["pass"];} elseif (isset($_GET["pass"])) {$pass=$_GET["pass"];} + else {$pass="";} if (isset($_POST["campaign"])) {$campaign=$_POST["campaign"];} elseif (isset($_GET["campaign"])) {$campaign=$_GET["campaign"];} + else {$campaign="";} if (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} elseif (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + else {$phone_login="";} if (isset($_POST["original_phone_login"])) {$original_phone_login=$_POST["original_phone_login"];} elseif (isset($_GET["original_phone_login"])) {$original_phone_login=$_GET["original_phone_login"];} + else {$original_phone_login="";} if (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} elseif (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} + else {$phone_pass="";} if (isset($_POST["fronter"])) {$fronter=$_POST["fronter"];} elseif (isset($_GET["fronter"])) {$fronter=$_GET["fronter"];} + else {$fronter="";} if (isset($_POST["closer"])) {$closer=$_POST["closer"];} elseif (isset($_GET["closer"])) {$closer=$_GET["closer"];} + else {$closer="";} if (isset($_POST["group"])) {$group=$_POST["group"];} elseif (isset($_GET["group"])) {$group=$_GET["group"];} + else {$group="";} if (isset($_POST["channel_group"])) {$channel_group=$_POST["channel_group"];} elseif (isset($_GET["channel_group"])) {$channel_group=$_GET["channel_group"];} + else {$channel_group="";} if (isset($_POST["SQLdate"])) {$SQLdate=$_POST["SQLdate"];} elseif (isset($_GET["SQLdate"])) {$SQLdate=$_GET["SQLdate"];} + else {$SQLdate="";} if (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];} elseif (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];} + else {$epoch="";} if (isset($_POST["uniqueid"])) {$uniqueid=$_POST["uniqueid"];} elseif (isset($_GET["uniqueid"])) {$uniqueid=$_GET["uniqueid"];} + else {$uniqueid="";} if (isset($_POST["customer_zap_channel"])) {$customer_zap_channel=$_POST["customer_zap_channel"];} elseif (isset($_GET["customer_zap_channel"])) {$customer_zap_channel=$_GET["customer_zap_channel"];} + else {$customer_zap_channel="";} if (isset($_POST["customer_server_ip"])) {$customer_server_ip=$_POST["customer_server_ip"];} elseif (isset($_GET["customer_server_ip"])) {$customer_server_ip=$_GET["customer_server_ip"];} + else {$customer_server_ip="";} if (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} elseif (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} if (isset($_POST["SIPexten"])) {$SIPexten=$_POST["SIPexten"];} elseif (isset($_GET["SIPexten"])) {$SIPexten=$_GET["SIPexten"];} + else {$SIPexten="";} if (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} elseif (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} + else {$session_id=0;} if (isset($_POST["phone"])) {$phone=$_POST["phone"];} elseif (isset($_GET["phone"])) {$phone=$_GET["phone"];} + else {$phone="";} if (isset($_POST["parked_by"])) {$parked_by=$_POST["parked_by"];} elseif (isset($_GET["parked_by"])) {$parked_by=$_GET["parked_by"];} + else {$parked_by="";} if (isset($_POST["dispo"])) {$dispo=$_POST["dispo"];} elseif (isset($_GET["dispo"])) {$dispo=$_GET["dispo"];} + else {$dispo="";} if (isset($_POST["dialed_number"])) {$dialed_number=$_POST["dialed_number"];} elseif (isset($_GET["dialed_number"])) {$dialed_number=$_GET["dialed_number"];} + else {$dialed_number="";} if (isset($_POST["dialed_label"])) {$dialed_label=$_POST["dialed_label"];} elseif (isset($_GET["dialed_label"])) {$dialed_label=$_GET["dialed_label"];} + else {$dialed_label="";} if (isset($_POST["source_id"])) {$source_id=$_POST["source_id"];} elseif (isset($_GET["source_id"])) {$source_id=$_GET["source_id"];} + else {$source_id="";} if (isset($_POST["rank"])) {$rank=$_POST["rank"];} elseif (isset($_GET["rank"])) {$rank=$_GET["rank"];} + else {$rank="";} if (isset($_POST["owner"])) {$owner=$_POST["owner"];} elseif (isset($_GET["owner"])) {$owner=$_GET["owner"];} + else {$owner="";} if (isset($_POST["camp_script"])) {$camp_script=$_POST["camp_script"];} elseif (isset($_GET["camp_script"])) {$camp_script=$_GET["camp_script"];} + else {$camp_script="";} if (isset($_POST["in_script"])) {$in_script=$_POST["in_script"];} elseif (isset($_GET["in_script"])) {$in_script=$_GET["in_script"];} + else {$in_script="";} if (isset($_POST["script_width"])) {$script_width=$_POST["script_width"];} elseif (isset($_GET["script_width"])) {$script_width=$_GET["script_width"];} + else {$script_width=0;} if (isset($_POST["script_height"])) {$script_height=$_POST["script_height"];} elseif (isset($_GET["script_height"])) {$script_height=$_GET["script_height"];} + else {$script_height=0;} if (isset($_POST["fullname"])) {$fullname=$_POST["fullname"];} elseif (isset($_GET["fullname"])) {$fullname=$_GET["fullname"];} + else {$fullname="";} if (isset($_POST["recording_filename"])) {$recording_filename=$_POST["recording_filename"];} elseif (isset($_GET["recording_filename"])) {$recording_filename=$_GET["recording_filename"];} + else {$recording_filename="";} if (isset($_POST["recording_id"])) {$recording_id=$_POST["recording_id"];} elseif (isset($_GET["recording_id"])) {$recording_id=$_GET["recording_id"];} + else {$recording_id="";} if (isset($_POST["user_custom_one"])) {$user_custom_one=$_POST["user_custom_one"];} elseif (isset($_GET["user_custom_one"])) {$user_custom_one=$_GET["user_custom_one"];} + else {$user_custom_one="";} if (isset($_POST["user_custom_two"])) {$user_custom_two=$_POST["user_custom_two"];} elseif (isset($_GET["user_custom_two"])) {$user_custom_two=$_GET["user_custom_two"];} + else {$user_custom_two="";} if (isset($_POST["user_custom_three"])) {$user_custom_three=$_POST["user_custom_three"];} elseif (isset($_GET["user_custom_three"])) {$user_custom_three=$_GET["user_custom_three"];} + else {$user_custom_three="";} if (isset($_POST["user_custom_four"])) {$user_custom_four=$_POST["user_custom_four"];} elseif (isset($_GET["user_custom_four"])) {$user_custom_four=$_GET["user_custom_four"];} + else {$user_custom_four="";} if (isset($_POST["user_custom_five"])) {$user_custom_five=$_POST["user_custom_five"];} elseif (isset($_GET["user_custom_five"])) {$user_custom_five=$_GET["user_custom_five"];} + else {$user_custom_five="";} if (isset($_POST["preset_number_a"])) {$preset_number_a=$_POST["preset_number_a"];} elseif (isset($_GET["preset_number_a"])) {$preset_number_a=$_GET["preset_number_a"];} + else {$preset_number_a="";} if (isset($_POST["preset_number_b"])) {$preset_number_b=$_POST["preset_number_b"];} elseif (isset($_GET["preset_number_b"])) {$preset_number_b=$_GET["preset_number_b"];} + else {$preset_number_b="";} if (isset($_POST["preset_number_c"])) {$preset_number_c=$_POST["preset_number_c"];} elseif (isset($_GET["preset_number_c"])) {$preset_number_c=$_GET["preset_number_c"];} + else {$preset_number_c="";} if (isset($_POST["preset_number_d"])) {$preset_number_d=$_POST["preset_number_d"];} elseif (isset($_GET["preset_number_d"])) {$preset_number_d=$_GET["preset_number_d"];} + else {$preset_number_d="";} if (isset($_POST["preset_number_e"])) {$preset_number_e=$_POST["preset_number_e"];} elseif (isset($_GET["preset_number_e"])) {$preset_number_e=$_GET["preset_number_e"];} + else {$preset_number_e="";} if (isset($_POST["preset_number_f"])) {$preset_number_f=$_POST["preset_number_f"];} elseif (isset($_GET["preset_number_f"])) {$preset_number_f=$_GET["preset_number_f"];} + else {$preset_number_f="";} if (isset($_POST["preset_dtmf_a"])) {$preset_dtmf_a=$_POST["preset_dtmf_a"];} elseif (isset($_GET["preset_dtmf_a"])) {$preset_dtmf_a=$_GET["preset_dtmf_a"];} + else {$preset_dtmf_a="";} if (isset($_POST["preset_dtmf_b"])) {$preset_dtmf_b=$_POST["preset_dtmf_b"];} elseif (isset($_GET["preset_dtmf_b"])) {$preset_dtmf_b=$_GET["preset_dtmf_b"];} + else {$preset_dtmf_b="";} if (isset($_POST["ScrollDIV"])) {$ScrollDIV=$_POST["ScrollDIV"];} elseif (isset($_GET["ScrollDIV"])) {$ScrollDIV=$_GET["ScrollDIV"];} + else {$ScrollDIV=0;} if (isset($_POST["ignore_list_script"])) {$ignore_list_script=$_POST["ignore_list_script"];} elseif (isset($_GET["ignore_list_script"])) {$ignore_list_script=$_GET["ignore_list_script"];} + else {$ignore_list_script="";} if (isset($_POST["DB"])) {$DB=$_POST["DB"];} elseif (isset($_GET["DB"])) {$DB=$_GET["DB"];} if (isset($_POST["process"])) {$process=$_POST["process"];} elseif (isset($_GET["process"])) {$process=$_GET["process"];} + else {$process=0;} if (isset($_POST["vicidial_id"])) {$vicidial_id=$_POST["vicidial_id"];} elseif (isset($_GET["vicidial_id"])) {$vicidial_id=$_GET["vicidial_id"];} + else {$vicidial_id="";} if (isset($_POST["call_date"])) {$call_date=$_POST["call_date"];} elseif (isset($_GET["call_date"])) {$call_date=$_GET["call_date"];} + else {$call_date="";} if (isset($_POST["order_id"])) {$order_id=$_POST["order_id"];} elseif (isset($_GET["order_id"])) {$order_id=$_GET["order_id"];} + else {$order_id="";} if (isset($_POST["appointment_date"])) {$appointment_date=$_POST["appointment_date"];} elseif (isset($_GET["appointment_date"])) {$appointment_date=$_GET["appointment_date"];} + else {$appointment_date="";} if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_time"];} elseif (isset($_GET["appointment_time"])) {$appointment_time=$_GET["appointment_time"];} + else {$appointment_time="";} if (isset($_POST["call_notes"])) {$call_notes=$_POST["call_notes"];} elseif (isset($_GET["call_notes"])) {$call_notes=$_GET["call_notes"];} + else {$call_notes="";} if (isset($_POST["notesid"])) {$notesid=$_POST["notesid"];} elseif (isset($_GET["notesid"])) {$notesid=$_GET["notesid"];} -if ($notesid < 100) - {$notesid=0;} + else {$notesid=0;} if (strlen($vicidial_id) < 1) {$vicidial_id = $uniqueid;} if (strlen($appointment_time) < 1) {$appointment_time = '12:00:00';} -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); - # if options file exists, use the override values for the above variables # see the options-example.php file for more information if (file_exists('options.php')) @@ -257,7 +333,8 @@ if ($qm_conf_ct > 0) $SSlanguage_method = $row[5]; $SSallow_web_debug = $row[6]; } -if ($SSallow_web_debug < 1) {$DB=0; $format='text';} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0; $format='text';} +$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -278,7 +355,7 @@ $list_id = preg_replace('/[^0-9]/', '', $list_id); $notesid = preg_replace('/[^0-9]/', '', $notesid); $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); $session_id = preg_replace('/[^0-9]/','',$session_id); -$uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); +# $uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); $phone_code = preg_replace("/[^0-9]/","",$phone_code); $phone_number = preg_replace("/[^0-9]/","",$phone_number); $vendor_id = preg_replace("/\"|\\\\|;/",'-',$vendor_id); @@ -345,7 +422,7 @@ $preset_dtmf_b = preg_replace("/\<|\>|\"|\\\\|;/",'-',$preset_dtmf_b); $ScrollDIV = preg_replace("/\<|\>|\"|\\\\|;/",'-',$ScrollDIV); $ignore_list_script = preg_replace("/\<|\>|\"|\\\\|;/",'-',$ignore_list_script); $DB = preg_replace("/\"|\\\\|;/",'-',$DB); -$process = preg_replace("/\"|\\\\|;/",'-',$process); +$process = preg_replace("/[^0-9]/",'',$process); $vicidial_id = preg_replace("/\"|\\\\|;/",'-',$vicidial_id); $call_date = preg_replace("/\"|\\\\|;/",'-',$call_date); $order_id = preg_replace("/\"|\\\\|;/",'-',$order_id); @@ -359,6 +436,7 @@ if ($non_latin < 1) $pass=preg_replace("/[^-\.\+\/\=_0-9a-zA-Z]/","",$pass); $campaign = preg_replace('/[^-_0-9a-zA-Z]/','',$campaign); $group = preg_replace('/[^-_0-9a-zA-Z]/','',$group); + $uniqueid = preg_replace('/[^-_\.0-9a-zA-Z]/','',$uniqueid); } else { @@ -366,12 +444,15 @@ else $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); $campaign = preg_replace('/[^-_0-9\p{L}]/u','',$campaign); $group = preg_replace('/[^-_0-9\p{L}]/u','',$group); + $uniqueid = preg_replace('/[^-_\.0-9\p{L}]/u','',$uniqueid); } $appointment_timeARRAY = explode(":",$appointment_time); $appointment_hour = $appointment_timeARRAY[0]; $appointment_min = $appointment_timeARRAY[1]; +if ($notesid < 100) + {$notesid=0;} if ($DB > 0) { diff --git a/agc_2-X/trunk/www/agc/vdc_soundboard_display.php b/agc_2-X/trunk/www/agc/vdc_soundboard_display.php index e43e485a..0884593e 100644 --- a/agc_2-X/trunk/www/agc/vdc_soundboard_display.php +++ b/agc_2-X/trunk/www/agc/vdc_soundboard_display.php @@ -1,7 +1,7 @@ LICENSE: AGPLv2 +# Copyright (C) 2026 Matt Florell LICENSE: AGPLv2 # # This script is designed display the contents of an audio soundboard in the system # @@ -15,10 +15,11 @@ # 191013-2122 - Fixes for PHP7 # 210616-2032 - Added optional CORS support, see options.php for details # 220219-0143 - Added allow_web_debug system setting +# 260302-1408 - Code updates for PHP8 compatibility # -$version = '2.14-9'; -$build = '220219-0143'; +$version = '2.14-10'; +$build = '260302-1408'; $php_script = 'vdc_soundboard_display.php'; require_once("dbconnect_mysqli.php"); @@ -30,29 +31,40 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["soundboard_id"])) {$soundboard_id=$_GET["soundboard_id"];} elseif (isset($_POST["soundboard_id"])) {$soundboard_id=$_POST["soundboard_id"];} + else {$soundboard_id="";} if (isset($_GET["avatar_id"])) {$avatar_id=$_GET["avatar_id"];} elseif (isset($_POST["avatar_id"])) {$avatar_id=$_POST["avatar_id"];} + else {$avatar_id="";} if (isset($_GET["user"])) {$user=$_GET["user"];} elseif (isset($_POST["user"])) {$user=$_POST["user"];} + else {$user="";} if (isset($_GET["pass"])) {$pass=$_GET["pass"];} elseif (isset($_POST["pass"])) {$pass=$_POST["pass"];} + else {$pass="";} if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} if (isset($_GET["session_id"])) {$session_id=$_GET["session_id"];} elseif (isset($_POST["session_id"])) {$session_id=$_POST["session_id"];} + else {$session_id="";} if (isset($_GET["session_name"])) {$session_name=$_GET["session_name"];} elseif (isset($_POST["session_name"])) {$session_name=$_POST["session_name"];} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} + else {$stage="";} if (isset($_GET["submit_button"])) {$submit_button=$_GET["submit_button"];} elseif (isset($_POST["submit_button"])) {$submit_button=$_POST["submit_button"];} + else {$submit_button="";} if (isset($_GET["admin_submit"])) {$admin_submit=$_GET["admin_submit"];} elseif (isset($_POST["admin_submit"])) {$admin_submit=$_POST["admin_submit"];} + else {$admin_submit="";} if (isset($_GET["bgcolor"])) {$bgcolor=$_GET["bgcolor"];} elseif (isset($_POST["bgcolor"])) {$bgcolor=$_POST["bgcolor"];} + else {$bgcolor="";} if (isset($_GET["bcrypt"])) {$bcrypt=$_GET["bcrypt"];} elseif (isset($_POST["bcrypt"])) {$bcrypt=$_POST["bcrypt"];} - +if (isset($_GET["script_height"])) {$script_height=$_GET["script_height"];} + elseif (isset($_POST["script_height"])) {$script_height=$_POST["script_height"];} + else {$script_height=0;} if ($bcrypt == 'OFF') {$bcrypt=0;} @@ -76,7 +88,7 @@ $CIDdate = date("mdHis"); $ENTRYdate = date("YmdHis"); $MT[0]=''; $agents='@agents'; -$script_height = ($script_height - 20); +$script_height = ($script_height>20 ? ($script_height - 20) : 0); if (strlen($bgcolor) < 6) {$bgcolor='FFFFFF';} # default optional vars if not set @@ -90,8 +102,8 @@ $IFRAME=0; $wav='.wav'; $gsm='.gsm'; -$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB); $user=preg_replace("/[^-_0-9\p{L}]/u","",$user); +/* 3/28/25 - Moved to appropriate filtering section $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); $session_id = preg_replace('/[^-_\.0-9a-zA-Z]/','',$session_id); @@ -100,6 +112,7 @@ $submit_button = preg_replace('/[^-_0-9a-zA-Z]/','',$submit_button); $admin_submit = preg_replace('/[^-_0-9a-zA-Z]/','',$admin_submit); $bgcolor = preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$bgcolor); $bcrypt = preg_replace('/[^-_0-9a-zA-Z]/','',$bcrypt); +*/ $PHP_SELF=$_SERVER['PHP_SELF']; $PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF); @@ -122,7 +135,8 @@ if ($qm_conf_ct > 0) $SSagent_soundboards = $row[6]; $SSallow_web_debug = $row[7]; } -if ($SSallow_web_debug < 1) {$DB=0; $format='text';} +if ($SSallow_web_debug < 1 || !isset($DB)) {$DB=0; $format='text';} +$DB=preg_replace("/[^0-9]/","",$DB); $VUselected_language = ''; $stmt="SELECT selected_language from vicidial_users where user='$user';"; @@ -145,6 +159,13 @@ if ($non_latin < 1) $soundboard_id=preg_replace("/[^-_0-9a-zA-Z]/","",$soundboard_id); $avatar_id=preg_replace("/[^-_0-9a-zA-Z]/","",$avatar_id); $session_name=preg_replace("/[^-_0-9a-zA-Z]/","",$session_name); + $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip); + $session_id = preg_replace('/[^-_\.0-9a-zA-Z]/','',$session_id); + $stage = preg_replace('/[^-_\.0-9a-zA-Z]/','',$stage); + $submit_button = preg_replace('/[^-_0-9a-zA-Z]/','',$submit_button); + $admin_submit = preg_replace('/[^-_0-9a-zA-Z]/','',$admin_submit); + $bgcolor = preg_replace("/[^0-9a-zA-Z]/","",$bgcolor); + $bcrypt = preg_replace('/[^-_0-9a-zA-Z]/','',$bcrypt); } else { @@ -152,7 +173,14 @@ else $pass = preg_replace('/[^-\.\+\/\=_0-9\p{L}]/u','',$pass); $soundboard_id=preg_replace("/\'|\"|\\\\|;| /","",$soundboard_id); $avatar_id=preg_replace("/\'|\"|\\\\|;| /","",$avatar_id); - $session_name=preg_replace("/[^-_0-9a-zA-Z]/","",$session_name); + $session_name=preg_replace("/[^-_0-9\p{L}]/u","",$session_name); + $server_ip = preg_replace('/[^-\.\:\_0-9\p{L}]/u','',$server_ip); + $session_id = preg_replace('/[^-_\.0-9\p{L}]/u','',$session_id); + $stage = preg_replace('/[^-_\.0-9\p{L}]/u','',$stage); + $submit_button = preg_replace('/[^-_0-9\p{L}]/u','',$submit_button); + $admin_submit = preg_replace('/[^-_0-9\p{L}]/u','',$admin_submit); + $bgcolor = preg_replace("/[^0-9\p{L}]/u","",$bgcolor); + $bcrypt = preg_replace('/[^-_0-9\p{L}]/u','',$bcrypt); } $auth=0; diff --git a/agc_2-X/trunk/www/agc/vicidial-grey.php b/agc_2-X/trunk/www/agc/vicidial-grey.php index 7dd7b731..2da98648 100644 --- a/agc_2-X/trunk/www/agc/vicidial-grey.php +++ b/agc_2-X/trunk/www/agc/vicidial-grey.php @@ -1,18559 +1 @@ - LICENSE: AGPLv2 -# -# Other scripts that this application depends on: -# - vdc_db_query.php: Updates information in the database -# - manager_send.php: Sends manager actions to the DB for execution -# - conf_exten_check.php: time sync and status updater, calls in queue -# - vdc_script_display.php: displays script with variables -# - vdc_form_display.php: display custom fields form -# - vdc_email_display.php: display email interface -# - vdc_chat_display.php: display chat interface -# - agc_agent_manager_chat_interface.php: display internal chats -# -# CHANGELOG -# 50607-1426 - First Build of VICIDIAL web client basic login process finished -# 50628-1620 - Added some basic formatting and worked on process flow -# 50628-1715 - Startup variables mapped to javascript variables -# 50629-1303 - Added Login Closer in-groups selection box and vla update -# 50629-1530 - Rough layout for customer info form section and button links -# 50630-1453 - Rough Manual Dial/Hangup with customer info displayed -# 50701-1450 - Added vicidial_log entries on dial and hangup -# 50701-1634 - Added Logout function -# 50705-1259 - Added call disposition functionality -# 50705-1432 - Added lead info DB update function -# 50705-1658 - Added web form functionality -# 50706-1043 - Added call park and pickup functions -# 50706-1234 - Added Start/Stop Recording functionality -# 50706-1614 - Added conference channels display option -# 50711-1333 - Removed call check redundancy and fixed a span bug -# 50727-1424 - Added customer channel and participant present sensing/alerts -# 50804-1057 - Added SendDTMF function and reconfigured the transfer span -# 50804-1224 - Added Local and Internal Closer transfer functions -# 50804-1628 - Added Blind transfer, activated LIVE CALL image and fixed bugs -# 50804-1808 - Added button images for left buttons -# 50815-1151 - Added 3Way calling functions to Transfer-conf frame -# 50815-1602 - Added images and buttons for xfer functions -# 50816-1813 - Added basic autodial outbound call pickup functions -# 50817-1113 - Fixes to auto_dialing call receipt -# 50817-1234 - Added inbound call receipt capability -# 50817-1541 - Added customer time display -# 50818-1327 - Added stop-all-recordings-after-each-vicidial-call option -# 50818-1703 - Added pretty login section -# 50825-1200 - Modified form field lengths, added double-click dispositions -# 50831-1603 - Fixed customer time bug and fronter display bug for CLOSER -# 50901-1314 - Fixed CLOSER IN-GROUP Web Form bug -# 50903-0904 - Added preview-lead code for manual dialing -# 50904-0016 - Added ability to hangup manual dials before pickup -# 50906-1319 - Added override for filters on xfer calls, fixed login display bug -# 50909-1243 - Added hotkeys functionality for quick dispoing in auto-dial mode -# 50912-0958 - Modified hotkeys function, agent must have user_level >= 5 to use -# 50913-1212 - Added campaign_cid to 3rd party calls -# 50923-1546 - Modified to work with language translation -# 50926-1656 - Added campaign pull-down at login of active campaigns -# 50928-1633 - Added manual dial alternate number dial option -# 50930-1538 - Added session_id empty login failure and fixed 2 minor bugs -# 51004-1656 - Fixed recording filename bug and new Spanish translation -# 51020-1103 - Added campaign-specific recording control abilities -# 51020-1352 - Added Basic vicidial_agent_log framework -# 51021-1050 - Fixed custtime display and disable Enter/Return keypresses -# 51021-1718 - Allows for multi-line comments (changes \n to !N in database) -# 51110-1432 - Fixed non-standard http port issue -# 51111-1047 - Added vicidial_agent_log lead_id earlier for manual dial -# 51118-1305 - Activate multi-line comments from $multi_line_comments var -# 51118-1313 - Move Transfer DIV to a floating span to preserve 800x600 view -# 51121-1506 - Small PHP optimizations in many scripts and disabled globalize -# 51129-1010 - Added ability to accept calls from other VICIDIAL servers -# 51129-1254 - Fixed Hangups of other agents channels when customer hangs up -# 51208-1732 - Created user-first login that looks for default phone info -# 51219-1526 - Added variable framework for campaign and in-group scripts -# 51221-1200 - Added SCRIPT tab, layout and functionality -# 51221-1714 - Added auto-switch-to-SCRIPT-tab and auto-webform-popup -# 51222-1605 - Added VMail message blind transfer button to xfer-conf frame -# 51229-1028 - Added checks on web_form_address to allow for var in the DB value -# 60117-1312 - Added Transfer-conf frame toggle on button press -# 60208-1152 - Added DTMF-xfernumber preset links to xfer-conf frame -# 60213-1129 - Added vicidial_users.hotkeys_active for any user hotkeys -# 60213-1210 - Added ability to sort routing of calls by user_level -# 60214-0932 - Initial Callback calendar display framework -# 60214-1407 - Added ability to minimize the dispo screen to see info below -# 60215-1104 - Added ANYONE scheduled callbacks functionality -# 60410-1116 - Added persistant pause after dispo option and change dispo text -# - Added web form submit that opens new window with dispo on submit -# - Added PREVIOUS CALLBACK in customer info to flag callbacks -# - Added link to try to hangup the call again in the dispo screen -# - Added link noone-in-session screen to call agent phone again -# - Added link customer-hungup screen to go straight to dispo screen -# 60410-1532 - Added agent status and campaign calls dialing display option -# 60411-1547 - Add ability to set callback as USERONLY and some basic formatting -# 60413-1752 - Add basic USERONLY callback frame and listings -# 60414-1039 - Changed manual dial preview and alt dial checkboxes to spans -# - Added beta-level USERONLY callback functionality -# - Added beta-level manual dialing with lead insertion functionality -# 60415-1534 - Fixed manual dial lead preview and fixed manuald dial override bug -# 60417-1108 - Added capability to do alt-number-dialing in auto-dial mode -# - Changed several permissions to database-defined -# 60419-1529 - Prevent manual dial or callbacks when alt-dial lead not finished -# 60420-1647 - Fixed DiaLDiaLAltPhonE error, Call Agent Again DialControl error -# 60421-1229 - Check GET/POST vars lines with isset to not trigger PHP NOTICES -# 60424-1005 - Fixed Alt phone disabled bug for callbacks and manual dials -# 60426-1058 - Added vicidial_user setting for default blended check for CLOSER -# 60501-1008 - Added option to manual dial screen to manually lookup phone number -# 60503-1653 - Fixed agentonly_callback not-defined bug in scheduled callbacks screen -# 60504-1032 - Fixed manual dial display bug and transfer dispo alert bug -# - Fixed recording filename display to not overrun 25 characters -# 60510-1051 - Added Wrapup timer and wrapup message on wrapup screen after dispo -# 60608-1453 - Added CLOSER campaign allowable in-groups limitations -# 60609-1123 - Added add-number-to-DNC-list function and manual dial check DNC -# 60619-1047 - Added variable filters to close security holes for login form -# 60804-1710 - fixed scheduled CALLBK for other languages build -# 60808-1145 - Added consultative transfers with customer data -# 60808-2232 - Added campaign name to pulldown for login screen -# 60809-1603 - Added option to locally transfer consult xfers -# 60809-1732 - Added recheck of transferred channels before customer gone mesg -# 60810-1011 - Fixed CXFER leave 3way call bugs -# 60816-1602 - Added ALLCALLS recording delay option allcalls_delay -# 60816-1716 - Fixed customer time display bug and client DST setting -# 60821-1555 - Added option to omit phone_code on dialout of leads -# 60821-1628 - Added ALLFORCE recording option -# 60821-1643 - Added no_delete_sessions option to not delete sessions -# 60822-0512 - Changed phone number fields to be maxlength of 12 -# 60829-1531 - Made compatible with WeBRooTWritablE setting in dbconnect.php -# 60906-1152 - Added Previous CallBack info display span -# 60906-1715 - Allow for Local phone extension conferences -# 61004-1729 - Add ability to control volume per channel in "calls in this session" -# 61122-1341 - Added vicidial_user_groups allowed_campaigns restrictions -# 61122-1523 - Added more SCRIPT variables -# 61128-2229 - Added vicidial_live_agents and vicidial_auto_calls manual dial entries -# 61130-1617 - Added lead_id to MonitorConf for recording_log -# 61221-1212 - Changed width to 760 to better fit 800x600 screens, widened SCRIPT -# 70109-1128 - Fixed wrapup timer bug -# 70109-1635 - Added option for HotKeys automatically dialing next number in manual mode -# - Added option for alternate number dialing with hotkeys -# 70111-1600 - Added ability to use BLEND/INBND/*_C/*_B/*_I as closer campaigns -# 70118-1517 - Added vicidial_agent_log and vicidial_user_log logging of user_group -# 70201-1249 - Added FAST DIAL option for manually dialing, added UTF8 compatible code -# 70201-1703 - Fixed cursor bug for most text input fields -# 70202-1453 - Added first portions of Agent Pause Codes -# 70203-0108 - Finished Agent Pause Codes functionality -# 70203-0930 - Added dialed_number to webform output -# 70203-1010 - Added dialed_label to webform output -# 70206-1201 - Fixed allow_closers bug -# 70206-1332 - Added vicidial_recording_override users setting function -# 70212-1252 - Fixed small issue with CXFER -# 70213-1018 - Changed CXFER and AXFER to update customer information before transfer -# 70214-1233 - Added queuemetrics_log_id field for server_id in queue_log -# 70215-1240 - Added queuemetrics_log_id field for server_id in queue_log -# 70222-1617 - Changed queue_log PAUSE/UNPAUSE to PAUSEALL/UNPAUSEALL -# 70226-1252 - Added Mute/UnMute to agent screen -# 70309-1035 - Allow amphersands and questions marks in comments to pass through -# 70313-1052 - Allow pound signs(hash) in comments to pass through -# 70316-1406 - Moved the MUTE button to be accessible during a transfer/conf -# 70319-1446 - Added agent-deactive-display and disable customer info update functions -# 70319-1626 - Added option to allow agent logins to campaigns with no leads in the hopper -# 70320-1501 - Added option to allow retry of leave-3way-call from dispo screen -# 70322-1545 - Added sipsak display ability -# 70510-1319 - Added onUnload force Logout -# 70806-1530 - Added Presets Dial links above agent mute button -# 70823-2118 - Fixed XMLHTTPRequest, HotKeys and Scheduled Callbacks issues with MSIE -# 70828-1443 - Added source_id to output of SCRIPTtab-IFRAME and WEBFORM -# 71022-1427 - Added formatting of the customer phone number in the main status bar -# 71029-1848 - Changed CLOSER-type campaign to not use campaign_id restrictions -# 71101-1204 - Fixed bug in callback calendar with DST -# 71116-0957 - Added campaign_weight and calls_today to the vla table insertion -# 71120-1719 - Added XMLHTPRequest lookup of allowable campaigns for agents during login -# 71122-0256 - Added auto-pause notification -# 71125-1751 - Changed Transfer section to allow for selection of in-groups to send calls to -# 71127-0408 - Added height and width settings for easier modification of screen size -# 71129-2025 - restricted callbacks count and list to campaign only -# 71223-0318 - changed logging of closer calls -# 71226-1117 - added option to kick all calls from conference upon logout -# 80109-1510 - added gender select list -# 80116-1032 - added option on CLOSER-type campaigns to change in-groups when paused -# 80317-2106 - added recording override options for inbound group calls -# 80331-1433 - Added second transfer try for VICIDIAL transfers/hangups on manual dial calls -# 80402-0121 - Fixes for manual dial transfers on some systems -# 80407-2112 - Work on adding phone login load balancing across servers -# 80416-0559 - Added ability to log computer_ip at login, set the $PhonESComPIP variable -# 80428-0413 - UTF8 changes and testing -# 80505-0054 - Added multi-phones load-balanced alias option -# 80507-0932 - Fixed Script display bug (+ instead of space) -# 80519-1425 - Added calls in queue display -# 80523-1630 - Added Timeclock links -# 80625-0047 - Added U option for gender, added date/phone display options -# 80630-2210 - Added queue_log entries for Manual Dial -# 80703-0139 - Added alter customer phone permissions -# 80703-1106 - Added API functionality for Hangup and Dispo, added Agent Display Queue Count -# 80707-2325 - Added vicidial_id to recording_log for tracking of vicidial or closer log to recording -# 80709-0358 - Added Default alt phone dial hard-code option -# 80719-1147 - Changed recording and senddtmf conf prefix -# 80815-1014 - Added manual dial list restriction option -# 80823-2123 - Fixed form scroll for IE, added copy to clipboard(IE-only feature) -# 80831-0548 - Added Extended alt-dial-phone display information for non-manual calls -# 80909-1717 - Added support for campaign-specific DNC lists -# 80915-1754 - Rewrote leave-3way functions for external calling -# 81002-1908 - Fixed double-login bug in some conditions -# 81007-0945 - Added three_way_call_cid option for outbound 3way calls -# 81010-1047 - Fixed conf calling prefix to use settings, other 3way improvements -# 81011-1403 - Fixed bugs in leave3way when transferring a manual dial call -# 81012-1729 - Added INBOUND_MAN dial method to allow manual list dialing and inbound calls -# 81013-1644 - Fixed bug in leave 3way for manual dial fronters -# 81015-0405 - Fixed bug related to hangups on 3way calls -# 81016-0703 - Changed leave 3way to allow function at any time transfer-conf is available -# 81020-1501 - Fixed bugs in queue_log logging -# 81023-0411 - Added compatibility for dial-in agents using AGI, bug fixes -# 81030-0403 - Added option to force Pause Codes on PAUSE -# 81103-1427 - Added 3way call dial prefix -# 81104-0140 - Added mysql error logging capability -# 81104-1618 - Changed MySQL queries logging -# 81106-0411 - Changedthe campaign login list behaviour -# 81110-0057 - Changed Pause time to start new vicidial_agent_log on every pause -# 81110-1514 - Added hangup_all_non_reserved to fix non-Hangup bug -# 81119-1811 - webform backslash fix -# 81124-2213 - Fixes blind transfer bug -# 81209-1617 - Added campaign web form target option and web form address variables -# 81211-0422 - Fixed Manual dial agent_log bug -# 90102-1402 - Added time sync check notification -# 90115-0619 - Added ability to send Local Closer to AGENTDIRECT agent_only -# 90120-1719 - Added API pause/resume and number dial functionality -# 90126-2302 - Added Vtiger login option and agent alert option -# 90128-0230 - Added vendor_lead_code to API dial and manuald dial with lookup -# 90202-0148 - Added option to disable BLENDED checkbox -# 90209-0132 - Changed tab images and color scheme -# 90303-1145 - Fixed rare manual dial live hangup bug -# 90304-1333 - Added user-specific web vars option -# 90305-0917 - Added prefix-choice and group-alias options for calls coming from API -# 90307-1736 - Added Shift enforcement and manager override features -# 90315-1009 - Changed revision for new trunk 2.2.0 -# 90320-0309 - Fixed agent log bug when using wrapup time -# 90323-1555 - Initial call to agent phone now has campaign callerIDnumber -# 90408-0104 - Added Vtiger callback record ability -# 90508-0727 - Changed to PHP long tags -# 90511-1018 - Added restriction not allowing dialing into agent sessions from manual dial -# 90519-0635 - Fixed manual dial status and logging bug -# 90525-1012 - Fixed transfer issue of auto-received call after manual dial call -# 90529-0741 - Added nophone agent phone login that will not show any empty session alerts -# 90531-0635 - Added option to hide customer phone number -# 90611-1422 - Fixed multiple logging bugs -# 90628-0655 - Added Quick Transfer button and Preset Prepopulate option -# 90705-1400 - Added Agent view sidebar option -# 90706-1432 - Added Agent view transfer selection -# 90709-1649 - Fixed alt-number transfers and dispo variable reset for webform -# 90712-2304 - Added ADD-ALL group selection, view calls in queue, grab call from queue, requeue button -# 90717-0640 - Added dialed_label and dialed_number to script variables -# 90721-1114 - Added rank and owner as vicidial_list fields -# 90726-2012 - Added allow_alerts option -# 90729-0647 - Added agent_display_dialable_leads option -# 90730-0145 - Fixed bugs in re-queue and INBOUND_MAN with blended selected -# 90808-0117 - Fixed manual dial calls today bug, added last_state_change to vicidial_live_agents -# 90812-0046 - Added no-delete-sessions = 1 as default, unused sessions cleared out at timeclock end of day -# 90814-0829 - Moved mute button next to hotkeys button -# 90827-0133 - Reworked Script display code -# 90827-1549 - Added list script override option, original_phone_login variable -# 90831-1456 - Added active_agent_login_server option for servers -# 90908-1038 - Added DEAD call display -# 90909-0921 - Fixed park issues -# 90916-1144 - Added Second web form button, Answering Machine Message change -# 90917-1325 - Fixed script loading bug with customer webform at the same time -# 90920-2108 - Changed web forms to use window.open instead of traditional links(IE7 compatibility issue) -# 90923-1310 - Rolled back last change -# 90928-1955 - Added lead update before closer transfer -# 90930-2243 - Added Territory selection functions -# 91108-2118 - Added QM pause code entry -# 91111-1433 - Fixed Gender pulldown list display for IE, remove links for recording channels in SHOW CHANNELS -# 91123-1801 - Added code for outbound_autodial field -# 91130-2021 - Added code for manager override of in-group selection -# 91204-1638 - Added recording_filename and recording_id script variables and script refresh link -# 91205-2055 - Added CONSULTATIVE checkbox in a redesigned Transfer-Conf frame -# 91206-2020 - Fixed vicidial_agent_log logging bug on logout when not paused -# 91211-1412 - Added User custom variables and CRM login popup -# 91219-0657 - Set pause code automatically on ReQueue and INBOUND_MAN Dial-Next-Number -# 91228-1339 - Added API "fields update" functions and "timer action" functions -# 100103-1250 - Added 3 more conf-presets, list ID override presets and call start/dispo URLs -# 100107-0108 - Added dynamic screen size based on login screen browser dimensions -# 100109-0801 - Added ALTNUM alt number status, fixed alt number dialing from setting -# 100109-1338 - Fixed Manual dial live call detection -# 100116-0709 - Added presets to script and web form variables -# 100123-0954 - changes to AGENTDIRECT selection span -# 100131-2233 - Added functions to allow for a webphone loaded in a separate IFRAME -# 100203-0639 - Fixed logging issues related to INBOUND_MAN dial method -# 100207-1103 - Changed Pause Codes function to allow for multiple pause codes per pause period -# 100220-1040 - Added Call Log View and Customer Info View and fixed HotKeys position -# 100221-1107 - Added Custom CID compatibility -# 100301-1330 - Changed AGENTDIRECT user selection launching to AGENTS link next to number-to-dial field -# 100302-2145 - Added scheduled callbacks alert feature -# 100306-0852 - Added options.php optional file for setting interface options that will survive upgrade -# 100309-0525 - Added queuemetrics_loginout option -# 100313-0053 - Added display options for transfer/conf buttons -# 100315-1148 - fix for rare recording_log uniqueid issue on manual dial calls to same number -# 100317-1301 - Added agent_fullscreen User Group option -# 100327-0901 - fix for manual dial answering machine message -# 100331-1220 - Added human-readable hangup codes for manual dial -# 100401-0019 - Added agent_choose_blended option -# 100413-1349 - Various small logging fixes and extended alt-dial fixes -# 100420-1009 - Added scheduled_callbacks_count option -# 100423-1156 - Added more user logging data and manual_dial_override, blind monitor warnings, uniqueid display and codec features -# 100428-0544 - Added uniqueid display option for PRESERVE -# 100513-0714 - Added options.php option to hide the timeclock link -# 100513-2337 - Changed user_login_first to attempt full login if phone_login/pass are filled in -# 100527-2212 - Added API send_dtmf, transfer_conference and park_call functions -# 100616-1622 - Allowed longer manual dial numbers -# 100622-2209 - Added field labels -# 100625-1118 - Added poor-network-connection-mitigating code -# 100629-1158 - Added initial code for custom list fields -# 100702-1315 - Custom List Fields functionality enabled -# 100712-1441 - Added entry_list_id field to vicidial_list to preserve link to custom fields if any -# 100723-1522 - Added LOCKED options for quick transfer button feature -# 100726-1233 - Added HANGUP, CALLMENU, EXTENSION, IN_GROUP timer actions -# 100803-2324 - Cleanup of URLDecode (issue #375) -# 100811-0810 - Added webphone_url_override option from user Groups -# 100813-0554 - Added Campaign presets -# 100815-1015 - Added manual_dial_prefix campaign option -# 100823-1605 - Added DID variables for webform and scripting -# 100827-1436 - Added webphone dialpad options -# 100902-0046 - Added initial loading screen -# 100902-1349 - Added closecallid, xfercallid, agent_log_id as webform and script variables -# 100908-0955 - Added customer 3way hangup -# 100912-1304 - Changed Dispo screen phone number display to dialed_number -# 100927-1616 - Added custom fields ability to web forms and optimized related code -# 101004-1322 - Added "IVR Park Call" button in agent interface -# 101006-1358 - Raised limits on several dynamic items from the database -# 101008-0356 - Added manual_preview_dial and two new variables for recording filenames -# 101012-1656 - Added scroll command at dispo submission to for scrolling to the top of the screen -# 101024-1639 - Added parked call counter -# 101108-0110 - Added ADDMEMBER option for queue_log -# 101124-0436 - Added manual dial queue and manual dial call time check features -# 101125-2151 - Changed CIDname for 3way calls -# 101128-0102 - Added list webform override options -# 101207-1621 - Added scroll to the top after in-group, pause code, etc... selections, and added focus blur to several functions -# 101208-1210 - Fixed focus/blur coding to work after Dispo -# 101216-1758 - Added the ability to hide fields if the label is set to ---HIDE--- in System Settings -# 101227-1645 - Added dialplan off toggle options, and settings and code changes for top bar webphone -# 110109-1205 - Added queuemetrics_loginout NONE option -# 110112-1254 - Added options.php option for focus/blur/enter functions -# 110129-1050 - Changed to XHTML compliant formatting, issue #444 -# 110208-1202 - Made scheduled callbacks notice move when on script/form tabs -# 110212-2206 - Added scheduled callback custom statuses compatibility -# 110215-1412 - Added my_callback_option and per_call_notes options -# 110218-1522 - Added agent_lead_search feature -# 110221-1251 - Changed statuses display to keep track of non-selectable statuses -# 110224-1713 - Added compatibility with QM phone environment logging, QM pause code last call logging and active server twin check -# 110225-1231 - Changed scheduled callbacks list to allow clicking to see lead info without dialing, and separate dial link -# 110303-2321 - Added notice of on-hook phone use, and ability to click 'ring' to call into session, minor queue_log fix -# 110304-1623 - Added callback count notification defer options -# 110310-0331 - Added auto-pause/resume functions in auto-dial mode for pre-call work -# 110310-1627 - Changed most browser alerts to HTML alerts, other bug fixes -# 110322-0923 - Allowed hiding of gender pulldown -# 110413-1244 - Added ALT dialing from scheduled callback list, and other formatting changes -# 110420-1211 - Added web_vars variable -# 110428-1549 - Added use of manual_dial_cid setting -# 110430-1126 - Added ability to use external_dial API function with lead_id and alt_dial options -# 110430-1924 - Added post_phone_time_diff_alert campaign feature -# 110506-1612 - Added custom_3way_button_transfer button feature -# 110510-1637 - Added number validation to custom_3way_button_transfer function -# 110526-1723 - Added webphone_auto_answer option -# 110528-1033 - Added waiting_on_dispo manual dial check -# 110531-2158 - Added callback_days_limit campaign feature -# 110619-2005 - Added disable_dispo_ options -# 110624-2311 - Added screen labels option and status display fields option -# 110626-2234 - Added queuemetrics_pe_phone_append -# 110707-1412 - Added last_inbound_call_time and finish compatibility -# 110713-0048 - Allow for full hiding of the phone number field label -# 110718-1159 - Added logging of skipped leads -# 110719-0854 - Removed debug output and small display alignment changes -# 110723-2308 - Complete hiding of phone numbers in logs when alter phone is set to HIDE -# 110730-2240 - Added option to hide dispo statuses, only to be used with API -# 110802-0122 - Added call_id variable -# 110911-1604 - Added API logout function -# 110916-1514 - Fixed dial timeout to check for dial_timeout setting and greater than 49 seconds -# 110919-1603 - Added Phone login load balancing grouping options -# 111015-2037 - Added contact search functions -# 111018-1528 - Added more contact fields, added code to prevent API transfer duplicates -# 111021-1623 - Fix for rare stuck vac issue with manual alt dial -# 111024-1237 - Added callback_list_calltime option -# 111114-0039 - Added scheduled callback and qm-dispo-code fields to API -# 111202-1444 - Added grade-random next-agent-call options -# 111227-1940 - Added Timer Action for Dx_DIAL_QUIET options -# 120213-2029 - Changed consultative transfer with custom fields behavior for better data updating -# 120223-2119 - Removed logging of good login passwords if webroot writable is enabled -# 120308-1617 - Added compatibility for DAHDI phones using asterisk version for server > 1.4.21.2 -# 120403-1204 - Fixed issue with MANUAL dial method hotkeys, added 1 second delay -# 120420-1621 - Forked 2.4 to branches, changing trunk to 2.6 -# 120427-1718 - Fixed 3-way logging issue -# 120512-0849 - Added In-Group Manual Dial functions -# 120518-1225 - Added transfer call to answering machine message with hotkey (LTMG or XFTAMM) -# 120810-0056 - Added recording api function -# 120819-1747 - Added vicidial_session_data logging for webphone api function -# 120914-1357 - Added group_alias to transfer_conference function -# 121025-2335 - Do not allow AGENTDIRECT transfers without a user defined -# 121029-0122 - Added pause_after_next_call and owner_populate campaign options -# 121114-1759 - Fixed manual dial lead preview script variable issue -# 121114-1937 - Added INGROUP recording option -# 121116-1407 - Added QC functionality -# 121129-2149 - Corrected hotkeys activation conditions -# 121130-0734 - Fixed call notes amphersand issue #612 -# 121206-0634 - Added inbound lead search feature -# 121222-2315 - Added inbound email features -# 130220-1214 - Fixed issue with 3-way call dial timeout -# 130328-0006 - Converted ereg to preg functions -# 130328-0934 - Applied changes from Issue #655 -# 130328-1017 - Added validation for agent manual dial permission on DIAL links -# 130402-2250 - Added user_group variable in scripts, forms and webforms -# 130412-1359 - Added SIP message for failed calls -# 130417-1937 - Changed locked agent choose in-group/closer/territories to auto-close -# 130508-2223 - Cleanup for other language builds -# 130508-2307 - Branched 2.7, trunk becomes 2.8 -# 130603-2209 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes -# 130615-1125 - Added recording_id to dispo url -# 130625-0841 - Added more user log data on login -# 130705-1439 - Added optional encrypted passwords compatibility -# 130718-0745 - Added recording_filename to dispo_call_url -# 130802-1134 - Changed to PHP mysqli functions -# 130822-0656 - Changed all require to require_once in agc directory for PHP backward compatibility -# 130903-1920 - Added security check for browser window name, see launch.php for more information -# 130925-2119 - Fixed span order issue -# 131007-1348 - Added mrglock_ig_select_ct options.php setting -# 131010-2149 - Added option to allow manual dial by lead_id -# 131208-2331 - Added campaign options for max dead, dispo and pause time. Changed CB blink to CSS -# 131209-1604 - Addded called_count logging -# 131210-1354 - Fixed manual dial CID choice issue with AC-CID settings -# 140107-2034 - Added webserver/url login logging -# 140126-0741 - Added pause code API function -# 140204-1230 - Added check for valid date in call log view -# 140214-1851 - Added preview_dial_action API function -# 140301-2059 - Added API functions options for SEARCH for phone within lead_id and Dial Next Number -# 140302-1018 - Changes to allow for & and + in standard fields -# 140312-2109 - Added CALLID as recording filename variable -# 140403-1731 - Added recording filename API append option -# 140418-0937 - Added max inbound calls feature -# 140423-1728 - Added campaign options manual_dial_search_checkbox and hide_call_log_info -# 140428-1514 - Added pause_type -# 140429-2040 - Added called_count and call notes display option as script and form variables -# 140519-1011 - Fixed calls in this session to not count monitoring channels -# 140521-2147 - Added manual alt dial options and more agent login error messages -# 140609-2246 - Fixed issue with webform2 button after manual alt-dial -# 140612-2152 - branched 2.9 version, raised trunk to 2.10 -# 140617-1041 - Fixed issue with non-latin, issue #773 -# 140617-2015 - Added vicidial_users wrapup_seconds_override option -# 140621-1557 - Added update_settings call to grab selected user and campaign settings more frequently -# 140623-1710 - Added wrapup_bypass setting -# 140626-0757 - Added wrapup_after_hotkey setting -# 140630-0921 - Added the FSCREEN option to Wrapup message to allow for message only display -# 140703-1658 - Several logging fixes, mostly related to manual dial calls -# 140706-0932 - Added callback_time_24hour for callback setting screen -# 140811-1219 - Changed to use QXZ function for echoing text -# 140822-0900 - Fixed issue with phone alias login -# 140902-0826 - Added callback_active_limit and callback_active_limit_override -# 140918-1606 - Fixed manual dial pause warning issue -# 141105-1153 - Fixed issue with AGENTDIRECT transfers to agents with IDs over 7 characters long -# 141113-1431 - Added admin_test option to allow login on active_agent=N servers -# 141116-1805 - Fixed issue #801 -# 141118-1229 - Formatting changes for QXZ output -# 141118-1439 - Added agent_email as webform and script variable -# 141121-1005 - Added new QC and comments campaign options -# 141124-1144 - Added new Callback Comments campaign option -# 141124-2146 - Added show_previous_callback campaign option -# 141124-2217 - Fix for issue #798 -# 141124-2234 - Added clear_script campaign option -# 141125-0100 - Added parked_hangup code -# 141125-1235 - Fixed issue with lead info not being updated when Max Dead time is triggered -# 141128-0848 - Code cleanup for QXZ functions -# 141204-1211 - Added more error checking on login -# 141207-1155 - Added pause_trigger to logout to force pause before running logout process -# 141216-1859 - Added agent choose language option -# 141222-2035 - Fix for issue #811 -# 141223-2109 - Fix for hide_gender issue -# 141227-1759 - Found missing phrase for QXZ -# 141229-1429 - Changed single-quote QXZ arguments to double-quotes -# 150101-1516 - Updated for 2015 -# 150108-1725 - Added more validation for API transfer commands -# 150111-1545 - Added manual_dial_search_filter campaign option(Issue #812) -# 150114-2052 - Added list_name web url variable -# 150117-1445 - Added NAME as status display variable -# 150117-1524 - Changed Pause/Resume buttons to single button(Issue #814) -# 150122-0629 - Fixed issue with double dispo warning, Fixed issue with alt-dial/preview-dial custom form reset -# 150123-1505 - Fixed issue with manual dial hotkey usage and agent logs -# 150129-0828 - Added confirmation if agent tries to leave the page without logging out, issue #821 -# 150202-0829 - Reconfigured hotkeys and auto-manual-dial for less delay -# 150203-1331 - Small changes to improve manual dial hotkey use -# 150204-1911 - Changed Manual hotkey auto-manual-dial to a variable delay depending on dispo processing time -# 150210-1225 - Added LOCK options for manual_dial_search_checkbox, fixed missing QXZ tags(issue #827) -# 150212-0034 - Added case-sensitive user validation(issue #682) -# 150218-1356 - Fixes for QXZ enclosed in single-quotes -# 150220-1533 - Fix for leave page confirmation after logout and QXZ fixes -# 150302-0950 - Release of 2.11 stable branch and raising trunk to 2.12 -# 150309-0315 - Added custom agent login prompt option -# 150405-1410 - Fixed issue with API dialing and preview -# 150418-2206 - Fixed issue with manual dial with hotkeys in RATIO method, issue #836 -# 150428-1735 - Added web form three -# 150522-1254 - Fixed issue #859 -# 150608-1126 - Added campaign option to disable the manual dial override field -# 150609-1736 - Added status_display_ingroup option -# 150609-1917 - Added list_description web url variable -# 150610-0940 - Added customer_gone_seconds campaign option -# 150701-1211 - Modified mysqli_error() to mysqli_connect_error() where appropriate -# 150704-0005 - Changed disposubmit to be blocking before resume, Issue #863 -# 150712-2045 - Changed dispo call url to operate through a separate AJAX process -# 150723-1741 - Created method for logging agent button/link clicks -# 150725-1744 - Added Agent Display Fields campaign option -# 150727-0908 - Added default_language -# 150808-1439 - Added compatibility for custom fields data option -# 150909-0212 - Fixed MDlogEPOCH variable issue #882 -# 150917-0926 - Added dynamic default field maxlengths based on DB schema -# 150923-1952 - Added DID custum fields as web and form variables -# 150928-1205 - Fixed issue with API transfers and dial_override flag -# 151022-0004 - Added audio alert when email arrives, issue #899 -# 151028-1458 - Added status groups statuses feature with min/max seconds qualifiers for statuses -# 151119-1925 - Fixed issue with scheduled callbacks and status groups -# 151125-0942 - Fixed manual call only logging bug -# 151212-0922 - Added all chat functionality -# 151218-1200 - Fixes for chat security and language translation -# 151229-2240 - Fixed issue #907, script reload after canceling manual 3way call -# 151229-2331 - Added campaign setting for manual_dial_timeout, Issue #903 -# 151230-0911 - Fixed transfer of parked call logging issue #901 -# 160101-1131 - Added code to handle routing initiated recordings -# 160104-1237 - Added images for live chat and email, and dead chat -# 160106-2215 - Deactivated several call action buttons while Email/Chat handling -# 160306-1019 - Added more webphone options -# 160326-0941 - Fixed issue #933, variables -# 160326-1001 - Fixed issue #934, phone_login -# 160331-2129 - Fixed missing start and dispo call url variables, issue #938 -# 160414-0922 - Added default_phone_code system settings option -# 160420-1342 - Fixed text link overlaps with other languages -# 160428-1826 - Fixed user_authorization bug -# 160618-1006 - Branched old agent screen design, added logging of browser width/height -# NOTE: THIS VERSION WILL EVENTUALLY BECOME UNSUPPORTED!!!!!!!!!! -# 161102-1120 - Fixed QM partition problem -# 190111-0908 - Fix for PHP7 -# 210615-1029 - Default security fixes, CVE-2021-28854 -# 210616-1852 - Added optional CORS support, see options.php for details -# 220220-0926 - Added allow_web_debug system setting -# - -$version = '2.12-496c-grey'; -$build = '220220-0926'; -$php_script = 'vicidial-grey.php'; -$mel=1; # Mysql Error Log enabled = 1 -$mysql_log_count=87; -$one_mysql_log=0; -$DB=0; - -require_once("dbconnect_mysqli.php"); -require_once("functions.php"); - -if (isset($_GET["DB"])) {$DB=$_GET["DB"];} - elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} -if (isset($_GET["JS_browser_width"])) {$JS_browser_width=$_GET["JS_browser_width"];} - elseif (isset($_POST["JS_browser_width"])) {$JS_browser_width=$_POST["JS_browser_width"];} -if (isset($_GET["JS_browser_height"])) {$JS_browser_height=$_GET["JS_browser_height"];} - elseif (isset($_POST["JS_browser_height"])) {$JS_browser_height=$_POST["JS_browser_height"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} -if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} -if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} - elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} -if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} - elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} -if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} - elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} -if (isset($_GET["VD_language"])) {$VD_language=$_GET["VD_language"];} - elseif (isset($_POST["VD_language"])) {$VD_language=$_POST["VD_language"];} -if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} -if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["MGR_override"];} - elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];} -if (isset($_GET["admin_test"])) {$admin_test=$_GET["admin_test"];} - elseif (isset($_POST["admin_test"])) {$admin_test=$_POST["admin_test"];} -if (!isset($phone_login)) - { - if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} - elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} - } -if (!isset($phone_pass)) - { - if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} - elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} - } -if (isset($VD_campaign)) - { - $VD_campaign = strtoupper($VD_campaign); - $VD_campaign = preg_replace("/\s/i",'',$VD_campaign); - } -if (!isset($flag_channels)) - { - $flag_channels=0; - $flag_string=''; - } - -### security strip all non-alphanumeric characters out of the variables ### -$DB=preg_replace("/[^0-9a-z]/","",$DB); -$phone_login=preg_replace("/[^\,0-9a-zA-Z]/","",$phone_login); -$phone_pass=preg_replace("/[^-_0-9a-zA-Z]/","",$phone_pass); -$VD_login=preg_replace("/\'|\"|\\\\|;| /","",$VD_login); -$VD_pass=preg_replace("/\'|\"|\\\\|;| /","",$VD_pass); -$VD_campaign = preg_replace("/[^-_0-9a-zA-Z]/","",$VD_campaign); -$VD_language = preg_replace("/\'|\"|\\\\|;/","",$VD_language); -$admin_test = preg_replace("/[^0-9a-zA-Z]/","",$admin_test); -$JS_browser_width = preg_replace('/[^-_0-9\p{L}]/u',"",$JS_browser_width); -$JS_browser_height = preg_replace('/[^-_0-9\p{L}]/u',"",$JS_browser_height); -$relogin = preg_replace('/[^-_0-9\p{L}]/u',"",$relogin); -$MGR_override = preg_replace('/[^-_0-9\p{L}]/u',"",$MGR_override); - -$forever_stop=0; - -$isdst = date("I"); -$StarTtimE = date("U"); -$NOW_TIME = date("Y-m-d H:i:s"); -$tsNOW_TIME = date("YmdHis"); -$FILE_TIME = date("Ymd-His"); -$loginDATE = date("Ymd"); -$CIDdate = date("ymdHis"); -$month_old = mktime(11, 0, 0, date("m"), date("d")-2, date("Y")); -$past_month_date = date("Y-m-d H:i:s",$month_old); -$minutes_old = mktime(date("H"), date("i")-2, date("s"), date("m"), date("d"), date("Y")); -$past_minutes_date = date("Y-m-d H:i:s",$minutes_old); -$JS_date = $StarTtimE."000"; # milliseconds since epoch or "16,3,31,8,56,1,0" year,month,day,hour,minute,second,millisecond -$webphone_width = 460; -$webphone_height = 500; -$VUselected_language = ''; - -$random = (rand(1000000, 9999999) + 10000000); - - -$stmt="SELECT user,selected_language from vicidial_users where user='$VD_login';"; -#if ($DB) {echo "|$stmt|\n";} -$rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01081',$VD_login,$server_ip,$session_name,$one_mysql_log);} -$sl_ct = mysqli_num_rows($rslt); -if ($sl_ct > 0) - { - $row=mysqli_fetch_row($rslt); - $VUuser = $row[0]; - $VUselected_language = $row[1]; - } - -############################################# -##### START SYSTEM_SETTINGS LOOKUP ##### -$stmt = "SELECT use_non_latin,vdc_header_date_format,vdc_customer_date_format,vdc_header_phone_format,webroot_writable,timeclock_end_of_day,vtiger_url,enable_vtiger_integration,outbound_autodial_active,enable_second_webform,user_territories_active,static_agent_url,custom_fields_enabled,pllb_grouping_limit,qc_features_active,allow_emails,callback_time_24hour,enable_languages,language_method,meetme_enter_login_filename,meetme_enter_leave3way_filename,enable_third_webform,default_language,active_modules,allow_chats,chat_url,default_phone_code,allow_web_debug FROM system_settings;"; -$rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01001',$VD_login,$server_ip,$session_name,$one_mysql_log);} -#if ($DB) {echo "$stmt\n";} -$qm_conf_ct = mysqli_num_rows($rslt); -if ($qm_conf_ct > 0) - { - $row=mysqli_fetch_row($rslt); - $non_latin = $row[0]; - $vdc_header_date_format = $row[1]; - $vdc_customer_date_format = $row[2]; - $vdc_header_phone_format = $row[3]; - $WeBRooTWritablE = $row[4]; - $timeclock_end_of_day = $row[5]; - $vtiger_url = $row[6]; - $enable_vtiger_integration = $row[7]; - $outbound_autodial_active = $row[8]; - $enable_second_webform = $row[9]; - $user_territories_active = $row[10]; - $static_agent_url = $row[11]; - $custom_fields_enabled = $row[12]; - $SSpllb_grouping_limit = $row[13]; - $qc_enabled = $row[14]; - $email_enabled = $row[15]; - $callback_time_24hour = $row[16]; - $SSenable_languages = $row[17]; - $SSlanguage_method = $row[18]; - $meetme_enter_login_filename = $row[19]; - $meetme_enter_leave3way_filename = $row[20]; - $enable_third_webform = $row[21]; - $default_language = $row[22]; - $active_modules = $row[23]; - $chat_enabled = $row[24]; - $chat_URL = $row[25]; - $default_phone_code = $row[26]; - $SSallow_web_debug = $row[27]; - } -else - { - echo _QXZ("ERROR: System Settings missing")."\n"; - exit; - } -if ($SSallow_web_debug < 1) {$DB=0;} -##### END SETTINGS LOOKUP ##### -########################################### - -if ($non_latin < 1) - { - $VD_login=preg_replace("/[^-_0-9a-zA-Z]/","",$VD_login); - $VD_pass=preg_replace("/[^-_0-9a-zA-Z]/","",$VD_pass); - } -else - { - $VD_login = preg_replace('/[^-_0-9\p{L}]/u','',$VD_login); - $VD_pass = preg_replace('/[^-_0-9\p{L}]/u','',$VD_pass); - } - -if ($force_logout) - { - echo _QXZ("You have now logged out. Thank you")."\n"; - exit; - } - - -##### DEFINABLE SETTINGS AND OPTIONS -########################################### - -# set defaults for hard-coded variables -$conf_silent_prefix = '5'; # vicidial_conferences prefix to enter silently and muted for recording -$dtmf_silent_prefix = '7'; # vicidial_conferences prefix to enter silently -$HKuser_level = '1'; # minimum vicidial user_level for HotKeys -$campaign_login_list = '1'; # show drop-down list of campaigns at login -$manual_dial_preview = '1'; # allow preview lead option when manual dial -$multi_line_comments = '1'; # set to 1 to allow multi-line comment box -$user_login_first = '0'; # set to 1 to have the vicidial_user login before the phone login -$view_scripts = '1'; # set to 1 to show the SCRIPTS tab -$dispo_check_all_pause = '0'; # set to 1 to allow for persistent pause after dispo -$callholdstatus = '1'; # set to 1 to show calls on hold count -$agentcallsstatus = '0'; # set to 1 to show agent status and call dialed count - $campagentstatctmax = '3'; # Number of seconds for campaign call and agent stats -$show_campname_pulldown = '1'; # set to 1 to show campaign name on login pulldown -$webform_sessionname = '1'; # set to 1 to include the session_name in webform URL -$local_consult_xfers = '1'; # set to 1 to send consultative transfers from original server -$clientDST = '1'; # set to 1 to check for DST on server for agent time -$no_delete_sessions = '1'; # set to 1 to not delete sessions at logout -$volumecontrol_active = '1'; # set to 1 to allow agents to alter volume of channels -$PreseT_DiaL_LinKs = '0'; # set to 1 to show a DIAL link for Dial Presets -$LogiNAJAX = '1'; # set to 1 to do lookups on campaigns for login -$HidEMonitoRSessionS = '1'; # set to 1 to hide remote monitoring channels from "session calls" -$hangup_all_non_reserved= '1'; # set to 1 to force hangup all non-reserved channels upon Hangup Customer -$LogouTKicKAlL = '1'; # set to 1 to hangup all calls in session upon agent logout -$PhonESComPIP = '1'; # set to 1 to log computer IP to phone if blank, set to 2 to force log each login -$DefaulTAlTDiaL = '0'; # set to 1 to enable ALT DIAL by default if enabled for the campaign -$AgentAlert_allowed = '1'; # set to 1 to allow Agent alert option -$disable_blended_checkbox='0'; # set to 1 to disable the BLENDED checkbox from the in-group chooser screen -$hide_timeclock_link = '0'; # set to 1 to hide the timeclock link on the agent login screen -$conf_check_attempts = '3'; # number of attempts to try before loosing webserver connection, for bad network setups -$focus_blur_enabled = '0'; # set to 1 to enable the focus/blur enter key blocking(some IE instances have issues) -$consult_custom_delay = '2'; # number of seconds to delay consultative transfers when customfields are active -$mrglock_ig_select_ct = '4'; # number of seconds to leave in-group select screen open if agent select is disabled - -$TEST_all_statuses = '0'; # TEST variable allows all statuses in dispo screen, FOR DEBUG ONLY - -$stretch_dimensions = '1'; # sets the vicidial screen to the size of the browser window -$BROWSER_HEIGHT = 500; # set to the minimum browser height, default=500 -$BROWSER_WIDTH = 770; # set to the minimum browser width, default=770 -$webphone_width = 460; # set the webphone frame width -$webphone_height = 500; # set the webphone frame height -$webphone_pad = 0; # set the table cellpadding for the webphone -$webphone_location = 'right'; # set the location on the agent screen 'right' or 'bar' -$MAIN_COLOR = '#CCCCCC'; # old default is E0C2D6 -$SCRIPT_COLOR = '#E6E6E6'; # old default is FFE7D0 -$FORM_COLOR = '#EFEFEF'; -$SIDEBAR_COLOR = '#F6F6F6'; - -$window_validation = 0; # set to 1 to disallow direct logins to vicidial.php -$win_valid_name = 'subwindow_launch'; # only window name to allow if validation enabled - -# if options file exists, use the override values for the above variables -# see the options-example.php file for more information -if (file_exists('options.php')) - { - require('options.php'); - } - -$hide_gender=0; -$US='_'; -$CL=':'; -$AT='@'; -$DS='-'; -$date = date("r"); -$ip = getenv("REMOTE_ADDR"); -$browser = getenv("HTTP_USER_AGENT"); -$browser=preg_replace("/\'|\"|\\\\/","",$browser); -$script_name = getenv("SCRIPT_NAME"); -$server_name = getenv("SERVER_NAME"); -$server_port = getenv("SERVER_PORT"); -$PHP_SELF=$_SERVER['PHP_SELF']; -$PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF); -if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';} - else {$HTTPprotocol = 'http://';} -if (($server_port == '80') or ($server_port == '443') ) {$server_port='';} -else {$server_port = "$CL$server_port";} -$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name"; -$agcDIR = preg_replace('/vicidial\.php/i','',$agcPAGE); -if (strlen($static_agent_url) > 5) - {$agcPAGE = $static_agent_url;} -if (strlen($VUselected_language) < 1) - {$VUselected_language = $default_language;} -$vdc_form_display = 'vdc_form_display.php'; -if (preg_match("/cf_encrypt/",$active_modules)) - {$vdc_form_display = 'vdc_form_display_encrypt.php';} -header ("Content-type: text/html; charset=utf-8"); -header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 -header ("Pragma: no-cache"); // HTTP/1.0 -echo ' - - - - - - -'; -echo "\n"; -echo "\n"; - -if ($campaign_login_list > 0) - { - $camp_form_code = "\n"; - echo "\n"; - echo "\n"; - } - } - - ### code for manager override of shift restrictions - if ($MGR_override > 0) - { - if (isset($_GET["MGR_login$loginDATE"])) {$MGR_login=$_GET["MGR_login$loginDATE"];} - elseif (isset($_POST["MGR_login$loginDATE"])) {$MGR_login=$_POST["MGR_login$loginDATE"];} - if (isset($_GET["MGR_pass$loginDATE"])) {$MGR_pass=$_GET["MGR_pass$loginDATE"];} - elseif (isset($_POST["MGR_pass$loginDATE"])) {$MGR_pass=$_POST["MGR_pass$loginDATE"];} - - $MGR_login = preg_replace("/\'|\"|\\\\|;/","",$MGR_login); - $MGR_pass = preg_replace("/\'|\"|\\\\|;/","",$MGR_pass); - - $MGR_auth=0; - $auth_message = user_authorization($MGR_login,$MGR_pass,'MGR',0,0,0,0,'vicidial-grey'); - if (preg_match("/^GOOD/",$auth_message)) - {$MGR_auth=1;} - - if($MGR_auth>0) - { - $stmt="UPDATE vicidial_users SET shift_override_flag='1' where user='$VD_login';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01059',$VD_login,$server_ip,$session_name,$one_mysql_log);} - echo "\n"; - - ### Add a record to the vicidial_admin_log - $SQL_log = "$stmt|"; - $SQL_log = preg_replace('/;/','',$SQL_log); - $SQL_log = addslashes($SQL_log); - $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$MGR_login', ip_address='$ip', event_section='AGENT', event_type='OVERRIDE', record_id='$VD_login', event_code='MANAGER OVERRIDE OF AGENT SHIFT ENFORCEMENT', event_sql=\"$SQL_log\", event_notes='user: $VD_login';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01060',$VD_login,$server_ip,$session_name,$one_mysql_log);} - } - } - - - $stmt="SELECT campaign_id,campaign_name from vicidial_campaigns where active='Y' $LOGallowed_campaignsSQL order by campaign_id;"; - if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01004',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $camps_to_print = mysqli_num_rows($rslt); - - $o=0; - while ($camps_to_print > $o) - { - $rowx=mysqli_fetch_row($rslt); - if ($show_campname_pulldown) - {$campname = " - $rowx[1]";} - else - {$campname = '';} - if ($VD_campaign) - { - if ( (preg_match("/$VD_campaign/i",$rowx[0])) and (strlen($VD_campaign) == strlen($rowx[0])) ) - {$camp_form_code .= "\n";} - else - { - if (!preg_match('/login_allowable_campaigns/',$camp_form_code)) - {$camp_form_code .= "\n";} - } - } - else - { - if (!preg_match('/login_allowable_campaigns/',$camp_form_code)) - {$camp_form_code .= "\n";} - } - $o++; - } - $camp_form_code .= "\n"; - } -else - { - $camp_form_code = "\n"; - } - - -if ($LogiNAJAX > 0) - { - ?> - - - - - - - - "._QXZ("Agent web client: Re-Login")."\n"; - echo "\n"; - echo "\n"; - if ($hide_timeclock_link < 1) - {echo " "._QXZ("Timeclock")."
    \n";} - echo "\n"; - echo "\n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


    "; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
    \"VICIdial\" "._QXZ("Re-Login")."
     
    "._QXZ("Phone Login:")."
    "._QXZ("Phone Password:")."
    "._QXZ("User Login").":
    "._QXZ("User Password:")."
    "._QXZ("Campaign:")." $camp_form_code
      \n"; - echo "

    "._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
    \n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - -if ($user_login_first == 1) - { - if ( (strlen($VD_login)<1) or (strlen($VD_pass)<1) or (strlen($VD_campaign)<1) ) - { - echo ""._QXZ("Agent web client: Campaign Login")."\n"; - echo "\n"; - echo "\n"; - if ($hide_timeclock_link < 1) - {echo " "._QXZ("Timeclock")."
    \n";} - echo "\n"; - echo "\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - #echo "\n"; - #echo "\n"; - echo "

    "._QXZ("User Login")."

    "; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
    \"VICIdial\" "._QXZ("Campaign Login")."
     
    "._QXZ("User Login").":
    "._QXZ("User Password:")."
    "._QXZ("Campaign:")." $camp_form_code
      \n"; - echo "

    "._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
    \n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and user_level > 0 and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $row=mysqli_fetch_row($rslt); - $phone_login=$row[0]; - $phone_pass=$row[1]; - - if ( (strlen($phone_login) < 1) or (strlen($phone_pass) < 1) ) - { - echo ""._QXZ("Agent web client: Login")."\n"; - echo "\n"; - echo "\n"; - if ($hide_timeclock_link < 1) - {echo " "._QXZ("Timeclock")."
    \n";} - echo "\n"; - echo "\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


    "; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
    \"VICIdial\" "._QXZ("Login")."
     
    "._QXZ("Phone Login:")."
    "._QXZ("Phone Password:")."
    "._QXZ("User Login").":
    "._QXZ("User Password:")."
    "._QXZ("Campaign:")." $camp_form_code
      \n"; - echo "

    "._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
    \n"; - echo "
    \n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - } - } - } - -if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) - { - echo ""._QXZ("Agent web client: Phone Login")."\n"; - echo "\n"; - echo "\n"; - if ($hide_timeclock_link < 1) - {echo " "._QXZ("Timeclock")."
    \n";} - echo "\n"; - echo "\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


    "; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
    \"VICIdial\" "._QXZ("phone login")."
     
    "._QXZ("Phone Login:")."
    "._QXZ("Phone Password:")."
      \n"; - echo "

    "._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
    \n"; - echo "
    \n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } -else - { - if ($WeBRooTWritablE > 0) - {$fp = fopen ("./vicidial_auth_entries.txt", "w");} - $VDloginDISPLAY=0; - - if ( (strlen($VD_login)<2) or (strlen($VD_pass)<2) or (strlen($VD_campaign)<2) ) - { - $VDloginDISPLAY=1; - } - else - { - $auth=0; - $auth_message = user_authorization($VD_login,$VD_pass,'',1,0,1,0,'vicidial-grey'); - if (preg_match("/^GOOD/",$auth_message)) - { - $auth=1; - $pass_hash = preg_replace("/GOOD\|/",'',$auth_message); - } - # case-sensitive check for user - if($auth>0) - { - if ($VD_login != "$VUuser") - { - $auth=0; - $auth_message='ERRCASE'; - } - } - - if($auth>0) - { - ##### grab the full name and other settings of the agent - $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,agent_call_log_view_override,agent_choose_blended,agent_lead_search_override,preset_contact_search,max_inbound_calls,wrapup_seconds_override,email,user_choose_language from vicidial_users where user='$VD_login' and active='Y';"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $row=mysqli_fetch_row($rslt); - $LOGfullname = $row[0]; - $user_level = $row[1]; - $VU_hotkeys_active = $row[2]; - $VU_agent_choose_ingroups = $row[3]; - $VU_scheduled_callbacks = $row[4]; - $agentonly_callbacks = $row[5]; - $agentcall_manual = $row[6]; - $VU_vicidial_recording = $row[7]; - $VU_vicidial_transfers = $row[8]; - $VU_closer_default_blended = $row[9]; - $VU_user_group = $row[10]; - $VU_vicidial_recording_override = $row[11]; - $VU_alter_custphone_override = $row[12]; - $VU_alert_enabled = $row[13]; - $VU_agent_shift_enforcement_override = $row[14]; - $VU_shift_override_flag = $row[15]; - $VU_allow_alerts = $row[16]; - $VU_closer_campaigns = $row[17]; - $VU_agent_choose_territories = $row[18]; - $VU_custom_one = $row[19]; - $VU_custom_two = $row[20]; - $VU_custom_three = $row[21]; - $VU_custom_four = $row[22]; - $VU_custom_five = $row[23]; - $VU_agent_call_log_view_override = $row[24]; - $VU_agent_choose_blended = $row[25]; - $VU_agent_lead_search_override = $row[26]; - $VU_preset_contact_search = $row[27]; - $VU_max_inbound_calls = $row[28]; - $VU_wrapup_seconds_override = $row[29]; - $LOGemail = $row[30]; - $VU_user_choose_language = $row[31]; - - if ( ($VU_alert_enabled > 0) and ($VU_allow_alerts > 0) ) {$VU_alert_enabled = 'ON';} - else {$VU_alert_enabled = 'OFF';} - $AgentAlert_allowed = $VU_allow_alerts; - - ### Gather timeclock and shift enforcement restriction settings - $stmt="SELECT forced_timeclock_login,shift_enforcement,group_shifts,agent_status_viewable_groups,agent_status_view_time,agent_call_log_view,agent_xfer_consultative,agent_xfer_dial_override,agent_xfer_vm_transfer,agent_xfer_blind_transfer,agent_xfer_dial_with_customer,agent_xfer_park_customer_dial,agent_fullscreen,webphone_url_override,webphone_dialpad_override,webphone_systemkey_override,admin_viewable_groups from vicidial_user_groups where user_group='$VU_user_group';"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01052',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $row=mysqli_fetch_row($rslt); - $forced_timeclock_login = $row[0]; - $shift_enforcement = $row[1]; - $LOGgroup_shiftsSQL = preg_replace('/\s\s/i','',$row[2]); - $LOGgroup_shiftsSQL = preg_replace('/\s/i',"','",$LOGgroup_shiftsSQL); - $LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')"; - $agent_status_viewable_groups = $row[3]; - $agent_status_viewable_groupsSQL = preg_replace('/\s\s/i','',$agent_status_viewable_groups); - $agent_status_viewable_groupsSQL = preg_replace('/\s/i',"','",$agent_status_viewable_groupsSQL); - $agent_status_viewable_groupsSQL = "user_group IN('$agent_status_viewable_groupsSQL')"; - $agent_status_view = 0; - if (strlen($agent_status_viewable_groups) > 2) - {$agent_status_view = 1;} - $agent_status_view_time=0; - if ($row[4] == 'Y') - {$agent_status_view_time=1;} - if ($row[5] == 'Y') - {$agent_call_log_view=1;} - if ($row[6] == 'Y') - {$agent_xfer_consultative=1;} - if ($row[7] == 'Y') - {$agent_xfer_dial_override=1;} - if ($row[8] == 'Y') - {$agent_xfer_vm_transfer=1;} - if ($row[9] == 'Y') - {$agent_xfer_blind_transfer=1;} - if ($row[10] == 'Y') - {$agent_xfer_dial_with_customer=1;} - if ($row[11] == 'Y') - {$agent_xfer_park_customer_dial=1;} - if ($VU_agent_call_log_view_override == 'Y') - {$agent_call_log_view=1;} - if ($VU_agent_call_log_view_override == 'N') - {$agent_call_log_view=0;} - $agent_fullscreen = $row[12]; - $webphone_url = $row[13]; - $webphone_dialpad_override = $row[14]; - $system_key = $row[15]; - $admin_viewable_groups = $row[16]; - - $admin_viewable_groupsALL=0; - $LOGadmin_viewable_groupsSQL=''; - $whereLOGadmin_viewable_groupsSQL=''; - $valLOGadmin_viewable_groupsSQL=''; - $vmLOGadmin_viewable_groupsSQL=''; - if ( (!preg_match('/\-\-ALL\-\-/i',$admin_viewable_groups)) and (strlen($admin_viewable_groups) > 3) ) - { - $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$admin_viewable_groups); - $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); - $LOGadmin_viewable_groupsSQL = "and user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; - $whereLOGadmin_viewable_groupsSQL = "where user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; - $valLOGadmin_viewable_groupsSQL = "and val.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; - $vmLOGadmin_viewable_groupsSQL = "and vm.user_group IN('---ALL---','$rawLOGadmin_viewable_groupsSQL')"; - } - else - {$admin_viewable_groupsALL=1;} - - if ( ($webphone_dialpad_override != 'DISABLED') and (strlen($webphone_dialpad_override) > 0) ) - {$webphone_dialpad = $webphone_dialpad_override;} - - if ( (strlen($VD_language)>0) and ($VU_user_choose_language == '1') ) - { - $LANGUAGEactive=0; - if ($VD_language == 'default English') - {$LANGUAGEactive=1;} - else - { - $stmt="SELECT count(*) FROM vicidial_languages where language_id='$VD_language' and active='Y' $LOGadmin_viewable_groupsSQL;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01082',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $row=mysqli_fetch_row($rslt); - $LANGUAGEactive=$row[0]; - } - - if ($LANGUAGEactive > 0) - { - $stmt="UPDATE vicidial_users SET selected_language='$VD_language' where user='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01083',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $VUlanguage_affected_rows = mysqli_affected_rows($link); - - echo "\n"; - - $VUselected_language=$VD_language; - } - } - - ### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR - if ( (preg_match('/Y/',$forced_timeclock_login)) or ( (preg_match('/ADMIN_EXEMPT/',$forced_timeclock_login)) and ($VU_user_level < 8) ) ) - { - $last_agent_event=''; - $HHMM = date("Hi"); - $HHteod = substr($timeclock_end_of_day,0,2); - $MMteod = substr($timeclock_end_of_day,2,2); - - if ($HHMM < $timeclock_end_of_day) - {$EoD = mktime($HHteod, $MMteod, 10, date("m"), date("d")-1, date("Y"));} - else - {$EoD = mktime($HHteod, $MMteod, 10, date("m"), date("d"), date("Y"));} - - $EoDdate = date("Y-m-d H:i:s", $EoD); - - ##### grab timeclock logged-in time for each user ##### - $stmt="SELECT event from vicidial_timeclock_log where user='$VD_login' and event_epoch >= '$EoD' order by timeclock_id desc limit 1;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01053',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $events_to_parse = mysqli_num_rows($rslt); - if ($events_to_parse > 0) - { - $rowx=mysqli_fetch_row($rslt); - $last_agent_event = $rowx[0]; - } - if ($DB>0) {echo "|$stmt|$events_to_parse|$last_agent_event|";} - if ( (strlen($last_agent_event)<2) or (preg_match('/LOGOUT/',$last_agent_event)) ) - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = _QXZ("YOU MUST LOG IN TO THE TIMECLOCK FIRST")."
    "; - } - } - ### END - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR - - ### BEGIN - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR - if ( ( (preg_match("/START|ALL/",$shift_enforcement)) and (!preg_match("/OFF/",$VU_agent_shift_enforcement_override)) ) or (preg_match("/START|ALL/",$VU_agent_shift_enforcement_override)) ) - { - $shift_ok=0; - if ( (strlen($LOGgroup_shiftsSQL) < 3) and ($VU_shift_override_flag < 1) ) - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = _QXZ("ERROR: There are no Shifts enabled for your user group")."
    "; - } - else - { - $HHMM = date("Hi"); - $wday = date("w"); - - $stmt="SELECT shift_id,shift_start_time,shift_length,shift_weekdays from vicidial_shifts where $LOGgroup_shiftsSQL order by shift_id"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $shifts_to_print = mysqli_num_rows($rslt); - - $o=0; - while ( ($shifts_to_print > $o) and ($shift_ok < 1) ) - { - $rowx=mysqli_fetch_row($rslt); - $shift_id = $rowx[0]; - $shift_start_time = $rowx[1]; - $shift_length = $rowx[2]; - $shift_weekdays = $rowx[3]; - - if (preg_match("/$wday/i",$shift_weekdays)) - { - $HHshift_length = substr($shift_length,0,2); - $MMshift_length = substr($shift_length,3,2); - $HHshift_start_time = substr($shift_start_time,0,2); - $MMshift_start_time = substr($shift_start_time,2,2); - $HHshift_end_time = ($HHshift_length + $HHshift_start_time); - $MMshift_end_time = ($MMshift_length + $MMshift_start_time); - if ($MMshift_end_time > 59) - { - $MMshift_end_time = ($MMshift_end_time - 60); - $HHshift_end_time++; - } - if ($HHshift_end_time > 23) - {$HHshift_end_time = ($HHshift_end_time - 24);} - $HHshift_end_time = sprintf("%02s", $HHshift_end_time); - $MMshift_end_time = sprintf("%02s", $MMshift_end_time); - $shift_end_time = "$HHshift_end_time$MMshift_end_time"; - - if ( - ( ($HHMM >= $shift_start_time) and ($HHMM < $shift_end_time) ) or - ( ($HHMM < $shift_start_time) and ($HHMM < $shift_end_time) and ($shift_end_time <= $shift_start_time) ) or - ( ($HHMM >= $shift_start_time) and ($HHMM >= $shift_end_time) and ($shift_end_time <= $shift_start_time) ) - ) - {$shift_ok++;} - } - $o++; - } - - if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) ) - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = _QXZ("ERROR: You are not allowed to log in outside of your shift")."
    "; - } - } - if ( ($shift_ok < 1) and ($VU_shift_override_flag < 1) and ($VDloginDISPLAY > 0) ) - { - $VDdisplayMESSAGE.= "

    "._QXZ("MANAGER OVERRIDE:")."
    \n"; - $VDdisplayMESSAGE.= "
    \n"; - $VDdisplayMESSAGE.= "\n"; - $VDdisplayMESSAGE.= "\n"; - $VDdisplayMESSAGE.= "\n"; - $VDdisplayMESSAGE.= "\n"; - $VDdisplayMESSAGE.= "\n"; - $VDdisplayMESSAGE.= "\n"; - $VDdisplayMESSAGE.= "\n"; - $VDdisplayMESSAGE.= "Manager Login:
    \n"; - $VDdisplayMESSAGE.= "Manager Password:
    \n"; - $VDdisplayMESSAGE.= "
    \n"; - } - } - ### END - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR - - ### BEGIN find any custom field labels ### - $label_title = _QXZ(" Title"); - $label_first_name = _QXZ("First"); - $label_middle_initial = _QXZ("MI"); - $label_last_name = _QXZ("Last "); - $label_address1 = _QXZ("Address1"); - $label_address2 = _QXZ("Address2"); - $label_address3 = _QXZ("Address3"); - $label_city = _QXZ("City"); - $label_state = _QXZ(" State"); - $label_province = _QXZ("Province"); - $label_postal_code = _QXZ("PostCode"); - $label_vendor_lead_code = _QXZ("Vendor ID"); - $label_gender = _QXZ(" Gender"); - $label_phone_number = _QXZ("Phone"); - $label_phone_code = _QXZ("DialCode"); - $label_alt_phone = _QXZ("Alt. Phone"); - $label_security_phrase = _QXZ("Show"); - $label_email = _QXZ("Email"); - $label_comments = _QXZ(" Comments"); - - $stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from system_settings;"; - $rslt=mysql_to_mysqli($stmt, $link); - $row=mysqli_fetch_row($rslt); - if (strlen($row[0])>0) {$label_title = $row[0];} - if (strlen($row[1])>0) {$label_first_name = $row[1];} - if (strlen($row[2])>0) {$label_middle_initial = $row[2];} - if (strlen($row[3])>0) {$label_last_name = $row[3];} - if (strlen($row[4])>0) {$label_address1 = $row[4];} - if (strlen($row[5])>0) {$label_address2 = $row[5];} - if (strlen($row[6])>0) {$label_address3 = $row[6];} - if (strlen($row[7])>0) {$label_city = $row[7];} - if (strlen($row[8])>0) {$label_state = $row[8];} - if (strlen($row[9])>0) {$label_province = $row[9];} - if (strlen($row[10])>0) {$label_postal_code = $row[10];} - if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} - if (strlen($row[12])>0) {$label_gender = $row[12];} - if (strlen($row[13])>0) {$label_phone_number = $row[13];} - if (strlen($row[14])>0) {$label_phone_code = $row[14];} - if (strlen($row[15])>0) {$label_alt_phone = $row[15];} - if (strlen($row[16])>0) {$label_security_phrase = $row[16];} - if (strlen($row[17])>0) {$label_email = $row[17];} - if (strlen($row[18])>0) {$label_comments = $row[18];} - ### END find any custom field labels ### - if ($label_gender == '---HIDE---') - {$hide_gender=1;} - - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "vdweb|GOOD|$date|\n"); - fclose($fp); - } - $user_abb = "$VD_login$VD_login$VD_login$VD_login"; - while ( (strlen($user_abb) > 4) and ($forever_stop < 200) ) - {$user_abb = preg_replace("/^\./i","",$user_abb); $forever_stop++;} - - $stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01008',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $row=mysqli_fetch_row($rslt); - $LOGallowed_campaigns =$row[0]; - - if ( (!preg_match("/\s$VD_campaign\s/i",$LOGallowed_campaigns)) and (!preg_match("/ALL-CAMPAIGNS/i",$LOGallowed_campaigns)) ) - { - echo ""._QXZ("Agent web client: Campaign Login")."\n"; - echo "\n"; - echo "\n"; - if ($hide_timeclock_link < 1) - {echo " "._QXZ("Timeclock")."
    \n";} - echo "\n"; - echo "\n"; - echo "
    \n"; - echo ""._QXZ("Sorry, you are not allowed to login to this campaign:")." $VD_campaign\n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo _QXZ("Login").": \n
    "; - echo _QXZ("Password").":
    \n"; - echo _QXZ("Campaign").": $camp_form_code
    \n"; - echo "   \n"; - echo "\n"; - echo "
    \n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - ##### check to see that the campaign is active - $stmt="SELECT count(*) FROM vicidial_campaigns where campaign_id='$VD_campaign' and active='Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01009',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $row=mysqli_fetch_row($rslt); - $CAMPactive=$row[0]; - if($CAMPactive>0) - { - $VARstatuses=''; - $VARstatusnames=''; - $VARSELstatuses=''; - $VARSELstatuses_ct=0; - $VARCBstatuses=''; - $VARMINstatuses=''; - $VARMAXstatuses=''; - $VARCBstatusesLIST=''; - $cVARstatuses=''; - $cVARstatusnames=''; - $cVARSELstatuses=''; - $cVARSELstatuses_ct=0; - $cVARCBstatuses=''; - $cVARMINstatuses=''; - $cVARMAXstatuses=''; - $cVARCBstatusesLIST=''; - ##### grab the statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name,scheduled_callback,selectable,min_sec,max_sec FROM vicidial_statuses WHERE status != 'NEW' order by status limit 500;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01010',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $VD_statuses_ct = mysqli_num_rows($rslt); - $i=0; - while ($i < $VD_statuses_ct) - { - $row=mysqli_fetch_row($rslt); - $statuses[$i] = $row[0]; - $status_names[$i] = $row[1]; - $CBstatuses[$i] = $row[2]; - $SELstatuses[$i] = $row[3]; - $MINsec[$i] = $row[4]; - $MAXsec[$i] = $row[5]; - if ($TEST_all_statuses > 0) {$SELstatuses[$i]='Y';} - $VARstatuses = "$VARstatuses'$statuses[$i]',"; - $VARstatusnames = "$VARstatusnames'$status_names[$i]',"; - $VARSELstatuses = "$VARSELstatuses'$SELstatuses[$i]',"; - $VARCBstatuses = "$VARCBstatuses'$CBstatuses[$i]',"; - $VARMINstatuses = "$VARMINstatuses'$MINsec[$i]',"; - $VARMAXstatuses = "$VARMAXstatuses'$MAXsec[$i]',"; - if ($CBstatuses[$i] == 'Y') - {$VARCBstatusesLIST .= " $statuses[$i]";} - if ($SELstatuses[$i] == 'Y') - {$VARSELstatuses_ct++;} - $i++; - } - - ##### grab the campaign-specific statuses that can be used for dispositioning by an agent - $stmt="SELECT status,status_name,scheduled_callback,selectable,min_sec,max_sec FROM vicidial_campaign_statuses WHERE status != 'NEW' and campaign_id='$VD_campaign' order by status limit 500;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01011',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $VD_statuses_camp = mysqli_num_rows($rslt); - $j=0; - while ($j < $VD_statuses_camp) - { - $row=mysqli_fetch_row($rslt); - $statuses[$i] = $row[0]; - $status_names[$i] = $row[1]; - $CBstatuses[$i] = $row[2]; - $SELstatuses[$i] = $row[3]; - $MINsec[$i] = $row[4]; - $MAXsec[$i] = $row[5]; - if ($TEST_all_statuses > 0) {$SELstatuses[$i]='Y';} - $cVARstatuses = "$cVARstatuses'$statuses[$i]',"; - $cVARstatusnames = "$cVARstatusnames'$status_names[$i]',"; - $cVARSELstatuses = "$cVARSELstatuses'$SELstatuses[$i]',"; - $cVARCBstatuses = "$cVARCBstatuses'$CBstatuses[$i]',"; - $cVARMINstatuses = "$cVARMINstatuses'$MINsec[$i]',"; - $cVARMAXstatuses = "$cVARMAXstatuses'$MAXsec[$i]',"; - if ($CBstatuses[$i] == 'Y') - {$cVARCBstatusesLIST .= " $statuses[$i]";} - if ($SELstatuses[$i] == 'Y') - {$cVARSELstatuses_ct++;} - $i++; - $j++; - } - # $VD_statuses_ct = ($VD_statuses_ct+$VD_statuses_camp); - $VARstatuses = substr("$VARstatuses", 0, -1); - $VARstatusnames = substr("$VARstatusnames", 0, -1); - $VARSELstatuses = substr("$VARSELstatuses", 0, -1); - $VARCBstatuses = substr("$VARCBstatuses", 0, -1); - $VARMINstatuses = substr("$VARMINstatuses", 0, -1); - $VARMAXstatuses = substr("$VARMAXstatuses", 0, -1); - $VARCBstatusesLIST .= " "; - $cVARstatuses = substr("$cVARstatuses", 0, -1); - $cVARstatusnames = substr("$cVARstatusnames", 0, -1); - $cVARSELstatuses = substr("$cVARSELstatuses", 0, -1); - $cVARCBstatuses = substr("$cVARCBstatuses", 0, -1); - $cVARMINstatuses = substr("$cVARMINstatuses", 0, -1); - $cVARMAXstatuses = substr("$cVARMAXstatuses", 0, -1); - $cVARCBstatusesLIST .= " "; - - ##### grab the campaign-specific HotKey statuses that can be used for dispositioning by an agent - $stmt="SELECT hotkey,status,status_name FROM vicidial_campaign_hotkeys WHERE selectable='Y' and status != 'NEW' and campaign_id='$VD_campaign' order by hotkey limit 9;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01012',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $HK_statuses_camp = mysqli_num_rows($rslt); - $w=0; - $HKboxA=''; - $HKboxB=''; - $HKboxC=''; - while ($w < $HK_statuses_camp) - { - $row=mysqli_fetch_row($rslt); - $HKhotkey[$w] =$row[0]; - $HKstatus[$w] =$row[1]; - $HKstatus_name[$w] =$row[2]; - $HKhotkeys = "$HKhotkeys'$HKhotkey[$w]',"; - $HKstatuses = "$HKstatuses'$HKstatus[$w]',"; - $HKstatusnames = "$HKstatusnames'$HKstatus_name[$w]',"; - if ($w < 3) - {$HKboxA = "$HKboxA $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
    ";} - if ( ($w >= 3) and ($w < 6) ) - {$HKboxB = "$HKboxB $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
    ";} - if ($w >= 6) - {$HKboxC = "$HKboxC $HKhotkey[$w] - $HKstatus[$w] - $HKstatus_name[$w]
    ";} - $w++; - } - $HKhotkeys = substr("$HKhotkeys", 0, -1); - $HKstatuses = substr("$HKstatuses", 0, -1); - $HKstatusnames = substr("$HKstatusnames", 0, -1); - - ##### grab the campaign settings - $stmt="SELECT park_ext,park_file_name,web_form_address,allow_closers,auto_dial_level,dial_timeout,dial_prefix,campaign_cid,campaign_vdad_exten,campaign_rec_exten,campaign_recording,campaign_rec_filename,campaign_script,get_call_launch,am_message_exten,xferconf_a_dtmf,xferconf_a_number,xferconf_b_dtmf,xferconf_b_number,alt_number_dialing,scheduled_callbacks,wrapup_seconds,wrapup_message,closer_campaigns,use_internal_dnc,allcalls_delay,omit_phone_code,agent_pause_codes_active,no_hopper_leads_logins,campaign_allow_inbound,manual_dial_list_id,default_xfer_group,xfer_groups,disable_alter_custphone,display_queue_count,manual_dial_filter,agent_clipboard_copy,use_campaign_dnc,three_way_call_cid,dial_method,three_way_dial_prefix,web_form_target,vtiger_screen_login,agent_allow_group_alias,default_group_alias,quick_transfer_button,prepopulate_transfer_preset,view_calls_in_queue,view_calls_in_queue_launch,call_requeue_button,pause_after_each_call,no_hopper_dialing,agent_dial_owner_only,agent_display_dialable_leads,web_form_address_two,agent_select_territories,crm_popup_login,crm_login_address,timer_action,timer_action_message,timer_action_seconds,start_call_url,dispo_call_url,xferconf_c_number,xferconf_d_number,xferconf_e_number,use_custom_cid,scheduled_callbacks_alert,scheduled_callbacks_count,manual_dial_override,blind_monitor_warning,blind_monitor_message,blind_monitor_filename,timer_action_destination,enable_xfer_presets,hide_xfer_number_to_dial,manual_dial_prefix,customer_3way_hangup_logging,customer_3way_hangup_seconds,customer_3way_hangup_action,ivr_park_call,manual_preview_dial,api_manual_dial,manual_dial_call_time_check,my_callback_option,per_call_notes,agent_lead_search,agent_lead_search_method,queuemetrics_phone_environment,auto_pause_precall,auto_pause_precall_code,auto_resume_precall,manual_dial_cid,custom_3way_button_transfer,callback_days_limit,disable_dispo_screen,disable_dispo_status,screen_labels,status_display_fields,pllb_grouping,pllb_grouping_limit,in_group_dial,in_group_dial_select,pause_after_next_call,owner_populate,manual_dial_lead_id,dead_max,dispo_max,pause_max,dead_max_dispo,dispo_max_dispo,max_inbound_calls,manual_dial_search_checkbox,hide_call_log_info,timer_alt_seconds,wrapup_bypass,wrapup_after_hotkey,callback_active_limit,callback_active_limit_override,comments_all_tabs,comments_dispo_screen,comments_callback_screen,qc_comment_history,show_previous_callback,clear_script,manual_dial_search_filter,web_form_address_three,manual_dial_override_field,status_display_ingroup,customer_gone_seconds,agent_display_fields,manual_dial_timeout FROM vicidial_campaigns where campaign_id = '$VD_campaign';"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01013',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $row=mysqli_fetch_row($rslt); - $park_ext = $row[0]; - $park_file_name = $row[1]; - $web_form_address = stripslashes($row[2]); - $allow_closers = $row[3]; - $auto_dial_level = $row[4]; - $dial_timeout = $row[5]; - $dial_prefix = $row[6]; - $campaign_cid = $row[7]; - $campaign_vdad_exten = $row[8]; - $campaign_rec_exten = $row[9]; - $campaign_recording = $row[10]; - $campaign_rec_filename = $row[11]; - $campaign_script = $row[12]; - $get_call_launch = $row[13]; - $campaign_am_message_exten = '8320'; - $xferconf_a_dtmf = $row[15]; - $xferconf_a_number = $row[16]; - $xferconf_b_dtmf = $row[17]; - $xferconf_b_number = $row[18]; - $alt_number_dialing = $row[19]; - $VC_scheduled_callbacks = $row[20]; - $wrapup_seconds = $row[21]; - $wrapup_message = $row[22]; - $closer_campaigns = $row[23]; - $use_internal_dnc = $row[24]; - $allcalls_delay = $row[25]; - $omit_phone_code = $row[26]; - $agent_pause_codes_active = $row[27]; - $no_hopper_leads_logins = $row[28]; - $campaign_allow_inbound = $row[29]; - $manual_dial_list_id = $row[30]; - $default_xfer_group = $row[31]; - $xfer_groups = $row[32]; - $disable_alter_custphone = $row[33]; - $display_queue_count = $row[34]; - $manual_dial_filter = $row[35]; - $CopY_tO_ClipboarD = $row[36]; - $use_campaign_dnc = $row[37]; - $three_way_call_cid = $row[38]; - $dial_method = $row[39]; - $three_way_dial_prefix = $row[40]; - $web_form_target = $row[41]; - $vtiger_screen_login = $row[42]; - $agent_allow_group_alias = $row[43]; - $default_group_alias = $row[44]; - $quick_transfer_button = $row[45]; - $prepopulate_transfer_preset = $row[46]; - $view_calls_in_queue = $row[47]; - $view_calls_in_queue_launch = $row[48]; - $call_requeue_button = $row[49]; - $pause_after_each_call = $row[50]; - $no_hopper_dialing = $row[51]; - $agent_dial_owner_only = $row[52]; - $agent_display_dialable_leads = $row[53]; - $web_form_address_two = $row[54]; - $agent_select_territories = $row[55]; - $crm_popup_login = $row[56]; - $crm_login_address = $row[57]; - $timer_action = $row[58]; - $timer_action_message = $row[59]; - $timer_action_seconds = $row[60]; - $start_call_url = $row[61]; - $dispo_call_url = $row[62]; - $xferconf_c_number = $row[63]; - $xferconf_d_number = $row[64]; - $xferconf_e_number = $row[65]; - $use_custom_cid = $row[66]; - $scheduled_callbacks_alert = $row[67]; - $scheduled_callbacks_count = $row[68]; - $manual_dial_override = $row[69]; - $blind_monitor_warning = $row[70]; - $blind_monitor_message = $row[71]; - $blind_monitor_filename = $row[72]; - $timer_action_destination = $row[73]; - $enable_xfer_presets = $row[74]; - $hide_xfer_number_to_dial = $row[75]; - $manual_dial_prefix = $row[76]; - $customer_3way_hangup_logging = $row[77]; - $customer_3way_hangup_seconds = $row[78]; - $customer_3way_hangup_action = $row[79]; - $ivr_park_call = $row[80]; - $manual_preview_dial = $row[81]; - $api_manual_dial = $row[82]; - $manual_dial_call_time_check = $row[83]; - $my_callback_option = $row[84]; - $per_call_notes = $row[85]; - $agent_lead_search = $row[86]; - $agent_lead_search_method = $row[87]; - $qm_phone_environment = $row[88]; - $auto_pause_precall = $row[89]; - $auto_pause_precall_code = $row[90]; - $auto_resume_precall = $row[91]; - $manual_dial_cid = $row[92]; - $custom_3way_button_transfer = $row[93]; - $callback_days_limit = $row[94]; - $disable_dispo_screen = $row[95]; - $disable_dispo_status = $row[96]; - $screen_labels = $row[97]; - $status_display_fields = $row[98]; - $pllb_grouping = $row[99]; - $pllb_grouping_limit = $row[100]; - $in_group_dial = $row[101]; - $in_group_dial_select = $row[102]; - $pause_after_next_call = $row[103]; - $owner_populate = $row[104]; - $manual_dial_lead_id = $row[105]; - $dead_max = $row[106]; - $dispo_max = $row[107]; - $pause_max = $row[108]; - $dead_max_dispo = $row[109]; - $dispo_max_dispo = $row[110]; - $CP_max_inbound_calls = $row[111]; - $manual_dial_search_checkbox = $row[112]; - $hide_call_log_info = $row[113]; - $timer_alt_seconds = $row[114]; - $wrapup_bypass = $row[115]; - $wrapup_after_hotkey = $row[116]; - $callback_active_limit = $row[117]; - $callback_active_limit_override = $row[118]; - $comments_all_tabs = $row[119]; - $comments_dispo_screen = $row[120]; - $comments_callback_screen = $row[121]; - $qc_comment_history = $row[122]; - $show_previous_callback = $row[123]; - $clear_script = $row[124]; - $manual_dial_search_filter =$row[125]; - $web_form_address_three = $row[126]; - $manual_dial_override_field=$row[127]; - $status_display_ingroup = $row[128]; - $customer_gone_seconds = $row[129]; - $agent_display_fields = $row[130]; - $manual_dial_timeout = $row[131]; - - if ( ($manual_dial_timeout < 1) or (strlen($manual_dial_timeout) < 1) ) - {$manual_dial_timeout = $dial_timeout;} - - if ( (strlen($customer_gone_seconds) < 1) or ($customer_gone_seconds < 1) ) - {$customer_gone_seconds=30;} - $customer_gone_seconds_negative = ($customer_gone_seconds * -1); - - if ( ($callback_active_limit_override == 'Y') and ($callback_active_limit > 0) ) - { - $temp_cb_act_lmt_ovrd = preg_replace("/[^0-9]/",'',$VU_custom_three); - if (strlen($temp_cb_act_lmt_ovrd) > 0) - $callback_active_limit = $temp_cb_act_lmt_ovrd; - } - if ($VU_wrapup_seconds_override >= 0) - {$wrapup_seconds = $VU_wrapup_seconds_override;} - if ( ($pause_max < 10) or (strlen($pause_max)<2) ) - {$pause_max=0;} - if ( ($pause_max > 9) and ($pause_max <= $dial_timeout) ) - {$pause_max = ($dial_timeout + 10);} - if ( ($queuemetrics_pe_phone_append > 0) and (strlen($qm_phone_environment)>0) ) - {$qm_phone_environment .= "-$qm_extension";} - - $status_display_NAME=0; - $status_display_CALLID=0; - $status_display_LEADID=0; - $status_display_LISTID=0; - if (preg_match("/NAME/",$status_display_fields)) - {$status_display_NAME=1;} - if (preg_match("/CALLID/",$status_display_fields)) - {$status_display_CALLID=1;} - if (preg_match("/LEADID/",$status_display_fields)) - {$status_display_LEADID=1;} - if (preg_match("/LISTID/",$status_display_fields)) - {$status_display_LISTID=1;} - - if ( ($screen_labels != '--SYSTEM-SETTINGS--') and (strlen($screen_labels)>1) ) - { - $stmt="SELECT label_title,label_first_name,label_middle_initial,label_last_name,label_address1,label_address2,label_address3,label_city,label_state,label_province,label_postal_code,label_vendor_lead_code,label_gender,label_phone_number,label_phone_code,label_alt_phone,label_security_phrase,label_email,label_comments from vicidial_screen_labels where label_id='$screen_labels' and active='Y' limit 1;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01073',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $screenlabels_count = mysqli_num_rows($rslt); - if ($screenlabels_count > 0) - { - $row=mysqli_fetch_row($rslt); - if (strlen($row[0])>0) {$label_title = $row[0];} - if (strlen($row[1])>0) {$label_first_name = $row[1];} - if (strlen($row[2])>0) {$label_middle_initial = $row[2];} - if (strlen($row[3])>0) {$label_last_name = $row[3];} - if (strlen($row[4])>0) {$label_address1 = $row[4];} - if (strlen($row[5])>0) {$label_address2 = $row[5];} - if (strlen($row[6])>0) {$label_address3 = $row[6];} - if (strlen($row[7])>0) {$label_city = $row[7];} - if (strlen($row[8])>0) {$label_state = $row[8];} - if (strlen($row[9])>0) {$label_province = $row[9];} - if (strlen($row[10])>0) {$label_postal_code = $row[10];} - if (strlen($row[11])>0) {$label_vendor_lead_code = $row[11];} - if (strlen($row[12])>0) {$label_gender = $row[12]; $hide_gender=0;} - if (strlen($row[13])>0) {$label_phone_number = $row[13];} - if (strlen($row[14])>0) {$label_phone_code = $row[14];} - if (strlen($row[15])>0) {$label_alt_phone = $row[15];} - if (strlen($row[16])>0) {$label_security_phrase = $row[16];} - if (strlen($row[17])>0) {$label_email = $row[17];} - if (strlen($row[18])>0) {$label_comments = $row[18];} - ### END find any custom field labels ### - if ($label_gender == '---HIDE---') - {$hide_gender=1;} - } - } - - $hide_dispo_list=0; - if ( ($disable_dispo_screen == 'DISPO_ENABLED') or ($disable_dispo_screen == 'DISPO_SELECT_DISABLED') or (strlen($disable_dispo_status) < 1) ) - { - if ($disable_dispo_screen == 'DISPO_SELECT_DISABLED') - {$hide_dispo_list=1;} - $disable_dispo_screen=0; - $disable_dispo_status=''; - } - if ( ($disable_dispo_screen == 'DISPO_DISABLED') and (strlen($disable_dispo_status) > 0) ) - {$disable_dispo_screen=1;} - - if ( ($VU_agent_lead_search_override == 'ENABLED') or ($VU_agent_lead_search_override == 'LIVE_CALL_INBOUND') or ($VU_agent_lead_search_override == 'LIVE_CALL_INBOUND_AND_MANUAL') or ($VU_agent_lead_search_override == 'DISABLED') ) - {$agent_lead_search = $VU_agent_lead_search_override;} - $AllowManualQueueCalls=1; - $AllowManualQueueCallsChoice=0; - if ($api_manual_dial == 'QUEUE') - { - $AllowManualQueueCalls=0; - $AllowManualQueueCallsChoice=1; - } - if ($manual_preview_dial == 'DISABLED') - {$manual_dial_preview = 0;} - if ($manual_dial_override == 'ALLOW_ALL') - {$agentcall_manual = 1;} - if ($manual_dial_override == 'DISABLE_ALL') - {$agentcall_manual = 0;} - if ($user_territories_active < 1) - {$agent_select_territories = 0;} - if (preg_match("/Y/",$agent_select_territories)) - {$agent_select_territories=1;} - else - {$agent_select_territories=0;} - - if (preg_match("/Y/",$agent_display_dialable_leads)) - {$agent_display_dialable_leads=1;} - else - {$agent_display_dialable_leads=0;} - - if (preg_match("/Y/",$no_hopper_dialing)) - {$no_hopper_dialing=1;} - else - {$no_hopper_dialing=0;} - - if ( (preg_match("/Y/",$call_requeue_button)) and ($auto_dial_level > 0) ) - {$call_requeue_button=1;} - else - {$call_requeue_button=0;} - - if ( (preg_match("/AUTO/",$view_calls_in_queue_launch)) and ($auto_dial_level > 0) ) - {$view_calls_in_queue_launch=1;} - else - {$view_calls_in_queue_launch=0;} - - if ( (!preg_match("/NONE/",$view_calls_in_queue)) and ($auto_dial_level > 0) ) - {$view_calls_in_queue=1;} - else - {$view_calls_in_queue=0;} - - if (preg_match("/Y/",$pause_after_each_call)) - {$dispo_check_all_pause=1;} - - $quick_transfer_button_enabled=0; - $quick_transfer_button_locked=0; - if (preg_match("/IN_GROUP|PRESET_1|PRESET_2|PRESET_3|PRESET_4|PRESET_5/",$quick_transfer_button)) - {$quick_transfer_button_enabled=1;} - if (preg_match("/LOCKED/",$quick_transfer_button)) - {$quick_transfer_button_locked=1;} - - $custom_3way_button_transfer_enabled=0; - $custom_3way_button_transfer_park=0; - $custom_3way_button_transfer_view=0; - $custom_3way_button_transfer_contacts=0; - if (preg_match("/PRESET_|FIELD_/",$custom_3way_button_transfer)) - {$custom_3way_button_transfer_enabled=1;} - if (preg_match("/PARK_/",$custom_3way_button_transfer)) - {$custom_3way_button_transfer_park=1; $custom_3way_button_transfer_enabled=1;} - if (preg_match("/VIEW_PRESET/",$custom_3way_button_transfer)) - {$custom_3way_button_transfer_view=1; $custom_3way_button_transfer_enabled=1;} - if ( (preg_match("/VIEW_CONTACTS/",$custom_3way_button_transfer)) and ($enable_xfer_presets == 'CONTACTS') and ($VU_preset_contact_search != 'DISABLED') ) - {$custom_3way_button_transfer_contacts=1; $custom_3way_button_transfer_enabled=1;} - - $preset_populate=''; - $prepopulate_transfer_preset_enabled=0; - if (preg_match("/PRESET_1|PRESET_2|PRESET_3|PRESET_4|PRESET_5/",$prepopulate_transfer_preset)) - { - $prepopulate_transfer_preset_enabled=1; - if (preg_match("/PRESET_1/",$prepopulate_transfer_preset)) - {$preset_populate = $xferconf_a_number;} - if (preg_match("/PRESET_2/",$prepopulate_transfer_preset)) - {$preset_populate = $xferconf_b_number;} - if (preg_match("/PRESET_3/",$prepopulate_transfer_preset)) - {$preset_populate = $xferconf_c_number;} - if (preg_match("/PRESET_4/",$prepopulate_transfer_preset)) - {$preset_populate = $xferconf_d_number;} - if (preg_match("/PRESET_5/",$prepopulate_transfer_preset)) - {$preset_populate = $xferconf_e_number;} - } - - $VARpreset_names=''; - $VARpreset_numbers=''; - $VARpreset_dtmfs=''; - $VARpreset_hide_numbers=''; - if ($enable_xfer_presets == 'ENABLED') - { - ##### grab the presets for this campaign - $stmt="SELECT preset_name,preset_number,preset_dtmf,preset_hide_number FROM vicidial_xfer_presets WHERE campaign_id='$VD_campaign' order by preset_name limit 500;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01067',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $VD_presets = mysqli_num_rows($rslt); - $j=0; - while ($j < $VD_presets) - { - $row=mysqli_fetch_row($rslt); - $preset_names[$j] = $row[0]; - $preset_numbers[$j] = $row[1]; - $preset_dtmfs[$j] = $row[2]; - $preset_hide_numbers[$j] = $row[3]; - $VARpreset_names = "$VARpreset_names'$preset_names[$j]',"; - $VARpreset_numbers = "$VARpreset_numbers'$preset_numbers[$j]',"; - $VARpreset_dtmfs = "$VARpreset_dtmfs'$preset_dtmfs[$j]',"; - $VARpreset_hide_numbers = "$VARpreset_hide_numbers'$preset_hide_numbers[$j]',"; - $j++; - } - $VARpreset_names = substr("$VARpreset_names", 0, -1); - $VARpreset_numbers = substr("$VARpreset_numbers", 0, -1); - $VARpreset_dtmfs = substr("$VARpreset_dtmfs", 0, -1); - $VARpreset_hide_numbers = substr("$VARpreset_hide_numbers", 0, -1); - $VD_preset_names_ct = $j; - if ($j < 1) - {$enable_xfer_presets='DISABLED';} - } - - $default_group_alias_cid=''; - if (strlen($default_group_alias)>1) - { - $stmt = "select caller_id_number from groups_alias where group_alias_id='$default_group_alias';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01055',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $VDIG_cidnum_ct = mysqli_num_rows($rslt); - if ($VDIG_cidnum_ct > 0) - { - $row=mysqli_fetch_row($rslt); - $default_group_alias_cid = $row[0]; - } - } - - $stmt = "select group_web_vars from vicidial_campaign_agents where campaign_id='$VD_campaign' and user='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01056',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $VDIG_cidogwv = mysqli_num_rows($rslt); - if ($VDIG_cidogwv > 0) - { - $row=mysqli_fetch_row($rslt); - $default_web_vars = $row[0]; - } - - if ( (!preg_match('/DISABLED/',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) ) - { - $campaign_recording = $VU_vicidial_recording_override; - echo "\n"; - } - if ( ($VC_scheduled_callbacks=='Y') and ($VU_scheduled_callbacks=='1') ) - {$scheduled_callbacks='1';} - if ($VU_vicidial_recording=='0') - {$campaign_recording='NEVER';} - if ($VU_alter_custphone_override=='ALLOW_ALTER') - {$disable_alter_custphone='N';} - if (strlen($manual_dial_prefix) < 1) - {$manual_dial_prefix = $dial_prefix;} - if (strlen($three_way_dial_prefix) < 1) - {$three_way_dial_prefix = $dial_prefix;} - if ( ($alt_number_dialing=='Y') or ($alt_number_dialing=='SELECTED') or ($alt_number_dialing=='SELECTED_TIMER_ALT') or ($alt_number_dialing=='SELECTED_TIMER_ADDR3') ) - {$alt_phone_dialing='1';} - else - { - $alt_phone_dialing='0'; - $DefaulTAlTDiaL='0'; - } - if ($display_queue_count=='N') - {$callholdstatus='0';} - if ( ($dial_method == 'INBOUND_MAN') or ($outbound_autodial_active < 1) ) - {$VU_closer_default_blended=0;} - - $closer_campaigns = preg_replace("/^ | -$/","",$closer_campaigns); - $closer_campaigns = preg_replace("/ /","','",$closer_campaigns); - $closer_campaigns = "'$closer_campaigns'"; - - if ( (preg_match('/Y/',$agent_pause_codes_active)) or (preg_match('/FORCE/',$agent_pause_codes_active)) ) - { - ##### grab the pause codes for this campaign - $stmt="SELECT pause_code,pause_code_name FROM vicidial_pause_codes WHERE campaign_id='$VD_campaign' order by pause_code limit 100;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01014',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $VD_pause_codes = mysqli_num_rows($rslt); - $j=0; - while ($j < $VD_pause_codes) - { - $row=mysqli_fetch_row($rslt); - $pause_codes[$i] =$row[0]; - $pause_code_names[$i] =$row[1]; - $VARpause_codes = "$VARpause_codes'$pause_codes[$i]',"; - $VARpause_code_names = "$VARpause_code_names'$pause_code_names[$i]',"; - $i++; - $j++; - } - $VD_pause_codes_ct = ($VD_pause_codes_ct+$VD_pause_codes); - $VARpause_codes = substr("$VARpause_codes", 0, -1); - $VARpause_code_names = substr("$VARpause_code_names", 0, -1); - } - - ##### grab the inbound groups to choose from if campaign contains CLOSER - $VARingroups="''"; - $VARingroup_handlers="''"; - $VARphonegroups="''"; - $VARemailgroups="''"; - $VARchatgroups="''"; - if ( ($campaign_allow_inbound == 'Y') and ($dial_method != 'MANUAL') ) - { - ### validate that the agent has not exceeded their max inbound calls for today - if ( ($VU_max_inbound_calls > 0) or ($CP_max_inbound_calls > 0) ) - { - $max_inbound_calls = $CP_max_inbound_calls; - if ($VU_max_inbound_calls > 0) - {$max_inbound_calls = $VU_max_inbound_calls;} - - $stmt = "SELECT sum(calls_today) FROM vicidial_inbound_group_agents where user='$VD_login' and group_type='C';"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01080',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "\n";} - $vigagt_ct = mysqli_num_rows($rslt); - if ($vigagt_ct > 0) - { - $row=mysqli_fetch_row($rslt); - $max_inbound_count = $row[0]; - - if ($max_inbound_count >= $max_inbound_calls) - {$closer_campaigns = "''";} - } - } - - $VARingroups=''; - $VARingroup_handlers=''; - $VARphonegroups=''; - $VARemailgroups=''; - $VARchatgroups=''; - $stmt="SELECT group_id,group_handling from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 800;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01015',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $closer_ct = mysqli_num_rows($rslt); - $INgrpCT=0; - $EMAILgrpCT=0; - $CHATgrpCT=0; - $PHONEgrpCT=0; - while ($INgrpCT < $closer_ct) - { - $row=mysqli_fetch_row($rslt); - $closer_groups[$INgrpCT] =$row[0]; - $closer_group_handling[$INgrpCT] =$row[1]; // PHONE OR EMAIL OR CHAT - this is important - $VARingroups = "$VARingroups'$closer_groups[$INgrpCT]',"; - $VARingroup_handlers = "$VARingroup_handlers'$closer_group_handling[$INgrpCT]',"; - if ($row[1]=="EMAIL") // Make a list of ingroups for email handling groups, chat handling groups and one for phones, so there is no overlap - { - $VARemailgroups = "$VARemailgroups'$closer_groups[$INgrpCT]',"; - $VARemailgroupsURL = $VARemailgroupsURL."&email_group_ids[]=$closer_groups[$INgrpCT]"; - $EMAILgrpCT++; - } - else if ($row[1]=="CHAT") - { - $VARchatgroups = "$VARchatgroups'$closer_groups[$INgrpCT]',"; - $VARchatgroupsURL = $VARchatgroupsURL."&chat_group_ids[]=$closer_groups[$INgrpCT]"; - $CHATgrpCT++; - } - else - { - $VARphonegroups = "$VARphonegroups'$closer_groups[$INgrpCT]',"; - $VARphonegroupsURL = $VARphonegroupsURL."&phone_group_ids[]=$closer_groups[$INgrpCT]"; - $PHONEgrpCT++; - } - $INgrpCT++; - } - $VARingroups = substr("$VARingroups", 0, -1); - $VARingroup_handlers = substr("$VARingroup_handlers", 0, -1); - $VARphonegroups = substr("$VARphonegroups", 0, -1); - $VARemailgroups = substr("$VARemailgroups", 0, -1); - $VARchatgroups = substr("$VARchatgroups", 0, -1); - } - else - {$closer_campaigns = "''";} - - $in_group_dial_display=0; - if ($in_group_dial != 'DISABLED') - { - $in_group_dial_display=1; - - if ($in_group_dial_select == 'CAMPAIGN_SELECTED') - { - $VARdialingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and group_id IN($closer_campaigns) order by group_id limit 800;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01076',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $dialcloser_ct = mysqli_num_rows($rslt); - $dialINgrpCT=0; - while ($dialINgrpCT < $dialcloser_ct) - { - $row=mysqli_fetch_row($rslt); - $dial_closer_groups[$dialINgrpCT] =$row[0]; - $VARdialingroups = "$VARdialingroups'$dial_closer_groups[$dialINgrpCT]',"; - $dialINgrpCT++; - } - $VARdialingroups = substr("$VARdialingroups", 0, -1); - } - if ($in_group_dial_select == 'ALL_USER_GROUP') - { - $VARdialingroups=''; - $stmt="select group_id from vicidial_inbound_groups where active = 'Y' and user_group IN('---ALL---','$user_group') order by group_id limit 800;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01077',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $dialcloser_ct = mysqli_num_rows($rslt); - $dialINgrpCT=0; - while ($dialINgrpCT < $dialcloser_ct) - { - $row=mysqli_fetch_row($rslt); - $dial_closer_groups[$dialINgrpCT] =$row[0]; - $VARdialingroups = "$VARdialingroups'$dial_closer_groups[$dialINgrpCT]',"; - $dialINgrpCT++; - } - $VARdialingroups = substr("$VARdialingroups", 0, -1); - } - } - - - ##### gather territory listings for this agent if select territories is enabled - $VARterritories=''; - if ($agent_select_territories > 0) - { - $stmt="SELECT territory from vicidial_user_territories where user='$VD_login';"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01062',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $territory_ct = mysqli_num_rows($rslt); - $territoryCT=0; - while ($territoryCT < $territory_ct) - { - $row=mysqli_fetch_row($rslt); - $territories[$territoryCT] =$row[0]; - $VARterritories = "$VARterritories'$territories[$territoryCT]',"; - $territoryCT++; - } - $VARterritories = substr("$VARterritories", 0, -1); - echo "\n"; - } - - ##### grab the allowable inbound groups to choose from for transfer options - $xfer_groups = preg_replace("/^ | -$/","",$xfer_groups); - $xfer_groups = preg_replace("/ /","','",$xfer_groups); - $xfer_groups = "'$xfer_groups'"; - $VARxfergroups="''"; - if ($allow_closers == 'Y') - { - $VARxfergroups=''; - $stmt="select group_id,group_name from vicidial_inbound_groups where active = 'Y' and group_id IN($xfer_groups) order by group_id limit 800;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01016',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $xfer_ct = mysqli_num_rows($rslt); - $XFgrpCT=0; - while ($XFgrpCT < $xfer_ct) - { - $row=mysqli_fetch_row($rslt); - $VARxfergroups = "$VARxfergroups'$row[0]',"; - $VARxfergroupsnames = "$VARxfergroupsnames'$row[1]',"; - if ($row[0] == "$default_xfer_group") {$default_xfer_group_name = $row[1];} - $XFgrpCT++; - } - $VARxfergroups = substr("$VARxfergroups", 0, -1); - $VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1); - } - - if (preg_match('/Y/',$agent_allow_group_alias)) - { - ##### grab the active group aliases - $stmt="SELECT group_alias_id,group_alias_name,caller_id_number FROM groups_alias WHERE active='Y' order by group_alias_id limit 1000;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01054',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $VD_group_aliases = mysqli_num_rows($rslt); - $j=0; - while ($j < $VD_group_aliases) - { - $row=mysqli_fetch_row($rslt); - $group_alias_id[$i] = $row[0]; - $group_alias_name[$i] = $row[1]; - $caller_id_number[$i] = $row[2]; - $VARgroup_alias_ids = "$VARgroup_alias_ids'$group_alias_id[$i]',"; - $VARgroup_alias_names = "$VARgroup_alias_names'$group_alias_name[$i]',"; - $VARcaller_id_numbers = "$VARcaller_id_numbers'$caller_id_number[$i]',"; - $i++; - $j++; - } - $VD_group_aliases_ct = ($VD_group_aliases_ct+$VD_group_aliases); - $VARgroup_alias_ids = substr("$VARgroup_alias_ids", 0, -1); - $VARgroup_alias_names = substr("$VARgroup_alias_names", 0, -1); - $VARcaller_id_numbers = substr("$VARcaller_id_numbers", 0, -1); - } - - ##### grab the number of leads in the hopper for this campaign - $stmt="SELECT count(*) FROM vicidial_hopper where campaign_id = '$VD_campaign' and status='READY';"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01017',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $row=mysqli_fetch_row($rslt); - $campaign_leads_to_call = $row[0]; - echo "\n"; - } - else - { - $VDloginDISPLAY=1; - $VDdisplayMESSAGE = _QXZ("Campaign not active, please try again")."
    "; - } - } - else - { - if ($WeBRooTWritablE > 0) - { - fwrite ($fp, "vdweb|FAIL|$date|\n"); - fclose($fp); - } - $VDloginDISPLAY=1; - - $VDdisplayMESSAGE = _QXZ("Login incorrect, please try again")."
    "; - if ($auth_message == 'LOCK') - {$VDdisplayMESSAGE = _QXZ("Too many login attempts, try again in 15 minutes")."
    ";} - if ($auth_message == 'ERRNETWORK') - {$VDdisplayMESSAGE = _QXZ("Too many network errors, please contact your administrator")."
    ";} - if ($auth_message == 'ERRSERVERS') - {$VDdisplayMESSAGE = _QXZ("No available servers, please contact your administrator")."
    ";} - if ($auth_message == 'ERRPHONES') - {$VDdisplayMESSAGE = _QXZ("No available phones, please contact your administrator")."
    ";} - if ($auth_message == 'ERRDUPLICATE') - {$VDdisplayMESSAGE = _QXZ("You are already logged in, please log out of your other session first")."
    ";} - if ($auth_message == 'ERRAGENTS') - {$VDdisplayMESSAGE = _QXZ("Too many agents logged in, please contact your administrator")."
    ";} - if ($auth_message == 'ERRCASE') - {$VDdisplayMESSAGE = _QXZ("Login incorrect, user names are case sensitive")."
    ";} - } - } - if ($VDloginDISPLAY) - { - echo ""._QXZ("Agent web client: Campaign Login")."\n"; - echo "\n"; - echo "\n"; - if ($hide_timeclock_link < 1) - {echo " "._QXZ("Timeclock")."
    \n";} - echo "\n"; - echo "\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "

    $VDdisplayMESSAGE

    "; - echo ""; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
    \"VICIdial\" "._QXZ("Campaign Login")."
     
    "._QXZ("User Login").":
    "._QXZ("User Password:")."
    "._QXZ("Campaign:")." $camp_form_code
      \n"; - echo "

    "._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
    \n"; - echo "\n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - $original_phone_login = $phone_login; - - # code for parsing load-balanced agent phone allocation where agent interface - # will send multiple phones-table logins so that the script can determine the - # server that has the fewest agents logged into it. - # login: ca101,cb101,cc101 - $alias_found=0; - $stmt="select count(*) from phones_alias where alias_id = '$phone_login';"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01018',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $alias_ct = mysqli_num_rows($rslt); - if ($alias_ct > 0) - { - $row=mysqli_fetch_row($rslt); - $alias_found = $row[0]; - } - if ($alias_found > 0) - { - $stmt="select alias_name,logins_list from phones_alias where alias_id = '$phone_login' limit 1;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01019',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $alias_ct = mysqli_num_rows($rslt); - if ($alias_ct > 0) - { - $row=mysqli_fetch_row($rslt); - $alias_name = $row[0]; - $phone_login = $row[1]; - } - } - - $pa=0; - if ( (preg_match('/,/i',$phone_login)) and (strlen($phone_login) > 2) ) - { - $phoneSQL = "("; - $phones_auto = explode(',',$phone_login); - $phones_auto_ct = count($phones_auto); - while($pa < $phones_auto_ct) - { - if ($pa > 0) - {$phoneSQL .= " or ";} - $desc = ($phones_auto_ct - $pa - 1); # traverse in reverse order - $phoneSQL .= "(login='$phones_auto[$desc]' and pass='$phone_pass')"; - $pa++; - } - $phoneSQL .= ")"; - } - else {$phoneSQL = "login='$phone_login' and pass='$phone_pass'";} - - $authphone=0; - #$stmt="SELECT count(*) from phones where $phoneSQL and active = 'Y';"; - - $active_agentSQL = "and active_agent_login_server='Y'"; - if ($admin_test == 'YES') - {$active_agentSQL='';} - $stmt="SELECT count(*) from phones,servers where $phoneSQL and phones.active = 'Y' and phones.server_ip=servers.server_ip $active_agentSQL;"; - if ($DB) {echo "|$stmt|\n";} - echo "\n"; - - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01020',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $row=mysqli_fetch_row($rslt); - $authphone=$row[0]; - if (!$authphone) - { - echo ""._QXZ("Agent web client: Phone Login Error")."\n"; - echo "\n"; - echo "\n"; - if ($hide_timeclock_link < 1) - {echo " "._QXZ("Timeclock")."
    \n";} - echo "\n"; - echo "\n"; - echo "
    \n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "


    "; - echo ""; - echo ""; - echo "\n"; - echo "\n"; - echo ""; - echo "\n"; - echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
    \"VICIdial\" "._QXZ("Login Error")."
     
    "._QXZ("Sorry, your phone login and password are not active in this system, please try again:")."
     
    "._QXZ("Phone Login:")."
    "._QXZ("Phone Password:")."

    "._QXZ("VERSION:")." $version       "._QXZ("BUILD:")." $build
    \n"; - echo "
    \n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - else - { - ##### BEGIN phone login load balancing functions ##### - ### go through the phones logins list to figure out which server has - ### fewest non-remote agents logged in and use that phone login account - if ($pa > 0) - { - $pb=0; - $pb_login=''; - $pb_server_ip=''; - $pb_count=0; - $pb_log=''; - $pb_valid_server_ips=''; - $pb_force_set=0; - while ( ($pb < $phones_auto_ct) and ($pb_force_set < 1) ) - { - ### find the server_ip of each phone_login - $stmtn="SELECT count(*) from phones where login = '$phones_auto[$pb]';"; - if ($DB) {echo "|$stmtx|\n";} - if ($non_latin > 0) {$rslt=mysql_to_mysqli("SET NAMES 'UTF8'", $link);} - $rslt=mysql_to_mysqli($stmtn, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01084',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $rown=mysqli_fetch_row($rslt); - if ($rown[0] > 0) - { - $stmtx="SELECT server_ip from phones where login = '$phones_auto[$pb]';"; - if ($DB) {echo "|$stmtx|\n";} - $rslt=mysql_to_mysqli($stmtx, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01021',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $rowx=mysqli_fetch_row($rslt); - } - else - {$rowx[0]='0.0.0.0';} - - ### get number of agents logged in to each server - $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]' and extension NOT LIKE \"R%\";"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01022',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $row=mysqli_fetch_row($rslt); - - ### find out whether the server is set to active - $stmt="SELECT count(*) from servers where server_ip = '$rowx[0]' and active='Y' $active_agentSQL;"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01023',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $rowy=mysqli_fetch_row($rslt); - - $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$rowx[0]' and ((extension='') or (extension is null));"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01085',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $rowys=mysqli_fetch_row($rslt); - - ### find out if this server has a twin - $twin_not_live=0; - if ($rowy[0] > 0) - { - $stmt="SELECT active_twin_server_ip from servers where server_ip = '$rowx[0]';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01070',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $rowyy=mysqli_fetch_row($rslt); - if (strlen($rowyy[0]) > 4) - { - ### find out whether the twin server_updater is running - $stmt="SELECT count(*) from server_updater where server_ip = '$rowyy[0]' and last_update > '$past_minutes_date';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01071',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $rowyz=mysqli_fetch_row($rslt); - if ($rowyz[0] < 1) {$twin_not_live=1;} - } - } - - ### find out whether the server_updater is running - $stmt="SELECT count(*) from server_updater where server_ip = '$rowx[0]' and last_update > '$past_minutes_date';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01024',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $rowz=mysqli_fetch_row($rslt); - - $pb_log .= "$phones_auto[$pb]|$rowx[0]|$row[0]|$rowy[0]|$rowys[0]|$rowz[0]|$twin_not_live| "; - - if ( ($rowy[0] > 0) and ($rowys[0] > 0) and ($rowz[0] > 0) and ($twin_not_live < 1) ) - { - if ( ($pllb_grouping == 'ONE_SERVER_ONLY') or ($pllb_grouping == 'CASCADING') ) - { - if ($pllb_grouping == 'ONE_SERVER_ONLY') - { - ### one-server-only plib check - ### get number of agents logged in to each server - $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]' and campaign_id='$VD_campaign' and extension NOT LIKE \"R%\";"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01074',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $rowG=mysqli_fetch_row($rslt); - - if ($rowG[0] > 0) - { - $pb_count=$row[0]; - $pb_server_ip=$rowx[0]; - $phone_login=$phones_auto[$pb]; - $pb_force_set++; - echo "\n"; - } - } - else - { - ### cascading plib check - ### get number of agents logged in to each server - $stmt="SELECT count(*) from vicidial_live_agents where server_ip = '$rowx[0]' and campaign_id='$VD_campaign' and extension NOT LIKE \"R%\";"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01075',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $rowG=mysqli_fetch_row($rslt); - - echo "\n"; - if ( ($rowG[0] > 0) and ($rowG[0] < $pllb_grouping_limit) and ($row[0] < $SSpllb_grouping_limit) ) - { - $pb_count=$row[0]; - $pb_server_ip=$rowx[0]; - $phone_login=$phones_auto[$pb]; - $pb_force_set++; - echo "\n"; - } - } - } - if ($DB > 0) {echo "($pb_count <> $row[0]) $pb|$pb_force_set|$phones_auto[$pb]|$pb_server_ip|$pb_count| -->\n";} - if ($pb_force_set < 1) - { - if ( ($pb_count >= $row[0]) or (strlen($pb_server_ip) < 4) ) - { - $pb_count=$row[0]; - $pb_server_ip=$rowx[0]; - $phone_login=$phones_auto[$pb]; - } - } - } - $pb++; - } - - - echo "\n"; - } - ##### END phone login load balancing functions ##### - - echo "Agent web client\n"; - $stmt="SELECT extension,dialplan_number,voicemail_id,phone_ip,computer_ip,server_ip,login,pass,status,active,phone_type,fullname,company,picture,messages,old_messages,protocol,local_gmt,ASTmgrUSERNAME,ASTmgrSECRET,login_user,login_pass,login_campaign,park_on_extension,conf_on_extension,VICIDIAL_park_on_extension,VICIDIAL_park_on_filename,monitor_prefix,recording_exten,voicemail_exten,voicemail_dump_exten,ext_context,dtmf_send_extension,call_out_number_group,client_browser,install_directory,local_web_callerID_URL,VICIDIAL_web_URL,AGI_call_logging_enabled,user_switching_enabled,conferencing_enabled,admin_hangup_enabled,admin_hijack_enabled,admin_monitor_enabled,call_parking_enabled,updater_check_enabled,AFLogging_enabled,QUEUE_ACTION_enabled,CallerID_popup_enabled,voicemail_button_enabled,enable_fast_refresh,fast_refresh_rate,enable_persistant_mysql,auto_dial_next_number,VDstop_rec_after_each_call,DBX_server,DBX_database,DBX_user,DBX_pass,DBX_port,DBY_server,DBY_database,DBY_user,DBY_pass,DBY_port,outbound_cid,enable_sipsak_messages,email,template_id,conf_override,phone_context,phone_ring_timeout,conf_secret,is_webphone,use_external_server_ip,codecs_list,webphone_dialpad,phone_ring_timeout,on_hook_agent,webphone_auto_answer,webphone_dialbox,webphone_mute,webphone_volume,webphone_debug from phones where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01025',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $row=mysqli_fetch_row($rslt); - $extension=$row[0]; - $dialplan_number=$row[1]; - $voicemail_id=$row[2]; - $phone_ip=$row[3]; - $computer_ip=$row[4]; - $server_ip=$row[5]; - $login=$row[6]; - $pass=$row[7]; - $status=$row[8]; - $active=$row[9]; - $phone_type=$row[10]; - $fullname=$row[11]; - $company=$row[12]; - $picture=$row[13]; - $messages=$row[14]; - $old_messages=$row[15]; - $protocol=$row[16]; - $local_gmt=$row[17]; - $ASTmgrUSERNAME=$row[18]; - $ASTmgrSECRET=$row[19]; - $login_user=$row[20]; - $login_pass=$row[21]; - $login_campaign=$row[22]; - $park_on_extension=$row[23]; - $conf_on_extension=$row[24]; - $VICIDiaL_park_on_extension=$row[25]; - $VICIDiaL_park_on_filename=$row[26]; - $monitor_prefix=$row[27]; - $recording_exten=$row[28]; - $voicemail_exten=$row[29]; - $voicemail_dump_exten=$row[30]; - $ext_context=$row[31]; - $dtmf_send_extension=$row[32]; - $call_out_number_group=$row[33]; - $client_browser=$row[34]; - $install_directory=$row[35]; - $local_web_callerID_URL=$row[36]; - $VICIDiaL_web_URL=$row[37]; - $AGI_call_logging_enabled=$row[38]; - $user_switching_enabled=$row[39]; - $conferencing_enabled=$row[40]; - $admin_hangup_enabled=$row[41]; - $admin_hijack_enabled=$row[42]; - $admin_monitor_enabled=$row[43]; - $call_parking_enabled=$row[44]; - $updater_check_enabled=$row[45]; - $AFLogging_enabled=$row[46]; - $QUEUE_ACTION_enabled=$row[47]; - $CallerID_popup_enabled=$row[48]; - $voicemail_button_enabled=$row[49]; - $enable_fast_refresh=$row[50]; - $fast_refresh_rate=$row[51]; - $enable_persistant_mysql=$row[52]; - $auto_dial_next_number=$row[53]; - $VDstop_rec_after_each_call=$row[54]; - $DBX_server=$row[55]; - $DBX_database=$row[56]; - $DBX_user=$row[57]; - $DBX_pass=$row[58]; - $DBX_port=$row[59]; - $outbound_cid=$row[65]; - $enable_sipsak_messages=$row[66]; - $conf_secret=$row[72]; - $is_webphone=$row[73]; - $use_external_server_ip=$row[74]; - $codecs_list=$row[75]; - $webphone_dialpad=$row[76]; - $phone_ring_timeout=$row[77]; - $on_hook_agent=$row[78]; - $webphone_auto_answer=$row[79]; - $webphone_dialbox=$row[80]; - $webphone_mute=$row[81]; - $webphone_volume=$row[82]; - $webphone_debug=$row[83]; - - $login_context = $ext_context; - if (strlen($meetme_enter_login_filename) > 0) - {$login_context = 'meetme-enter-login';} - - $no_empty_session_warnings=0; - if ( ($phone_login == 'nophone') or ($on_hook_agent == 'Y') ) - { - $no_empty_session_warnings=1; - } - if ($PhonESComPIP == '1') - { - if (strlen($computer_ip) < 4) - { - $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01026',$VD_login,$server_ip,$session_name,$one_mysql_log);} - } - } - if ($PhonESComPIP == '2') - { - $stmt="UPDATE phones SET computer_ip='$ip' where login='$phone_login' and pass='$phone_pass' and active = 'Y';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01027',$VD_login,$server_ip,$session_name,$one_mysql_log);} - } - if ($clientDST) - { - $local_gmt = ($local_gmt + $isdst); - } - - $stmt="SELECT asterisk_version,web_socket_url from servers where server_ip='$server_ip';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01028',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $row=mysqli_fetch_row($rslt); - $asterisk_version=$row[0]; - $web_socket_url=$row[1]; - - if ($protocol == 'EXTERNAL') - { - $protocol = 'Local'; - $extension = "$dialplan_number$AT$ext_context"; - } - if (preg_match("/Zap/i",$protocol)) - { - if (preg_match("/^1\.0|^1\.2|^1\.4\.1|^1\.4\.20|^1\.4\.21/i",$asterisk_version)) - {$do_nothing=1;} - else - { - $protocol = 'DAHDI'; - } - } - - $SIP_user = "$protocol/$extension"; - $SIP_user_DiaL = "$protocol/$extension"; - $qm_extension = "$extension"; - if ( (preg_match('/8300/',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') ) - { - $SIP_user = "$protocol/$extension$VD_login"; - $qm_extension = "$extension$VD_login"; - } - - # If a park extension is not set, use the default one - if ( (strlen($park_ext)>0) && (strlen($park_file_name)>0) ) - { - $VICIDiaL_park_on_extension = "$park_ext"; - $VICIDiaL_park_on_filename = "$park_file_name"; - echo "\n"; - } - echo "\n"; - - # If a web form address is not set, use the default one - if (strlen($web_form_address)>0) - { - $VICIDiaL_web_form_address = "$web_form_address"; - echo "\n"; - } - else - { - $VICIDiaL_web_form_address = "$VICIDiaL_web_URL"; - print "\n"; - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - } - $VICIDiaL_web_form_address_enc = rawurlencode($VICIDiaL_web_form_address); - - # If a web form address two is not set, use the first one - if (strlen($web_form_address_two)>0) - { - $VICIDiaL_web_form_address_two = "$web_form_address_two"; - echo "\n"; - } - else - { - $VICIDiaL_web_form_address_two = "$VICIDiaL_web_form_address"; - echo "\n"; - $VICIDiaL_web_form_address_two_enc = rawurlencode($VICIDiaL_web_form_address_two); - } - $VICIDiaL_web_form_address_two_enc = rawurlencode($VICIDiaL_web_form_address_two); - - # If a web form address three is not set, use the first one - if (strlen($web_form_address_three)>0) - { - $VICIDiaL_web_form_address_three = "$web_form_address_three"; - echo "\n"; - } - else - { - $VICIDiaL_web_form_address_three = "$VICIDiaL_web_form_address"; - echo "\n"; - $VICIDiaL_web_form_address_three_enc = rawurlencode($VICIDiaL_web_form_address_three); - } - $VICIDiaL_web_form_address_three_enc = rawurlencode($VICIDiaL_web_form_address_three); - - # If closers are allowed on this campaign - if ($allow_closers=="Y") - { - $VICIDiaL_allow_closers = 1; - echo "\n"; - } - else - { - $VICIDiaL_allow_closers = 0; - echo "\n"; - } - - - $session_ext = preg_replace("/[^a-z0-9]/i", "", $extension); - if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);} - $session_rand = (rand(1,9999999) + 10000000); - $session_name = "$StarTtimE$US$session_ext$session_rand"; - - if ($webform_sessionname) - {$webform_sessionname = "&session_name=$session_name";} - else - {$webform_sessionname = '';} - - $stmt="DELETE from web_client_sessions where start_time < '$past_month_date' and extension='$extension' and server_ip = '$server_ip' and program = 'vicidial';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01029',$VD_login,$server_ip,$session_name,$one_mysql_log);} - - $stmt="INSERT INTO web_client_sessions values('$extension','$server_ip','vicidial','$NOW_TIME','$session_name');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01030',$VD_login,$server_ip,$session_name,$one_mysql_log);} - - if ( ( ($campaign_allow_inbound == 'Y') and ($dial_method != 'MANUAL') ) || ($campaign_leads_to_call > 0) || (preg_match('/Y/',$no_hopper_leads_logins)) ) - { - ##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly - $stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01032',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $prev_login_ct = mysqli_num_rows($rslt); - $i=0; - while ($i < $prev_login_ct) - { - $row=mysqli_fetch_row($rslt); - $session_id =$row[0]; - $i++; - } - if ($prev_login_ct > 0) - {echo "\n";} - else - { - ##### grab the next available vicidial_conference room and reserve it - $stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null));"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01033',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $row=mysqli_fetch_row($rslt); - if ($row[0] > 0) - { - $stmt="UPDATE vicidial_conferences set extension='$SIP_user', leave_3way='0' where server_ip='$server_ip' and ((extension='') or (extension is null)) limit 1;"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01034',$VD_login,$server_ip,$session_name,$one_mysql_log);} - - $stmt="SELECT conf_exten from vicidial_conferences where server_ip='$server_ip' and ( (extension='$SIP_user') or (extension='$VD_login') );"; - if ($format=='debug') {echo "\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01035',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $row=mysqli_fetch_row($rslt); - $session_id = $row[0]; - } - echo "\n"; - } - - ### mark leads that were not dispositioned during previous calls as ERI - $stmt="UPDATE vicidial_list set status='ERI', user='' where status IN('QUEUE','INCALL') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01036',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $vlERIaffected_rows = mysqli_affected_rows($link); - echo "\n"; - - $stmt="DELETE from vicidial_hopper where status IN('QUEUE','INCALL','DONE') and user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01037',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $vhICaffected_rows = mysqli_affected_rows($link); - echo "\n"; - - $stmt="DELETE from vicidial_live_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01038',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $vlaLIaffected_rows = mysqli_affected_rows($link); - echo "\n"; - - $stmt="DELETE from vicidial_live_inbound_agents where user ='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01039',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $vliaLIaffected_rows = mysqli_affected_rows($link); - echo "\n"; - - $stmt="UPDATE routing_initiated_recordings set processed='2' where user='$VD_login' and processed='0';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01086',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $RIRaffected_rows = mysqli_affected_rows($link); - echo "\n"; - - $VULhostname = php_uname('n'); - $VULservername = $_SERVER['SERVER_NAME']; - if (strlen($VULhostname)<1) {$VULhostname='X';} - if (strlen($VULservername)<1) {$VULservername='X';} - - $stmt="SELECT webserver_id FROM vicidial_webservers where webserver='$VULservername' and hostname='$VULhostname' LIMIT 1;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01080',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $webserver_id_ct = mysqli_num_rows($rslt); - if ($webserver_id_ct > 0) - { - $row=mysqli_fetch_row($rslt); - $webserver_id = $row[0]; - } - else - { - ##### insert webserver entry - $stmt="INSERT INTO vicidial_webservers (webserver,hostname) values('$VULservername','$VULhostname');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01081',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($link); - $webserver_id = mysqli_insert_id($link); - echo "\n"; - } - - $stmt="SELECT url_id FROM vicidial_urls where url='$agcPAGE' LIMIT 1;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01082',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $url_id_ct = mysqli_num_rows($rslt); - if ($url_id_ct > 0) - { - $row=mysqli_fetch_row($rslt); - $url_id = $row[0]; - } - else - { - ##### insert url entry - $stmt="INSERT INTO vicidial_urls (url) values('$agcPAGE');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01083',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($link); - $url_id = mysqli_insert_id($link); - echo "\n"; - } - - ### insert an entry into the user log for the login event - $vul_data = "$vlERIaffected_rows|$vhICaffected_rows|$vlaLIaffected_rows|$vliaLIaffected_rows"; - $stmt = "INSERT INTO vicidial_user_log (user,event,campaign_id,event_date,event_epoch,user_group,session_id,server_ip,extension,computer_ip,browser,data,phone_login,server_phone,phone_ip,webserver,login_url,browser_width,browser_height) values('$VD_login','LOGIN','$VD_campaign','$NOW_TIME','$StarTtimE','$VU_user_group','$session_id','$server_ip','$protocol/$extension','$ip','$browser','$vul_data','$original_phone_login','$phone_login','LOOKUP','$webserver_id','$url_id','$JS_browser_width','$JS_browser_height');"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01031',$VD_login,$server_ip,$session_name,$one_mysql_log);} - - # echo "You have logged in as user: $VD_login on phone: $SIP_user to campaign: $VD_campaign
    \n"; - $VICIDiaL_is_logged_in=1; - - ### set the callerID for manager middleware-app to connect the phone to the user - $SIqueryCID = "S$CIDdate$session_id"; - - ############################################# - ##### START SYSTEM_SETTINGS LOOKUP ##### - $stmt = "SELECT enable_queuemetrics_logging,queuemetrics_server_ip,queuemetrics_dbname,queuemetrics_login,queuemetrics_pass,queuemetrics_log_id,vicidial_agent_disable,allow_sipsak_messages,queuemetrics_loginout,queuemetrics_addmember_enabled,queuemetrics_pe_phone_append,queuemetrics_pause_type FROM system_settings;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01040',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $qm_conf_ct = mysqli_num_rows($rslt); - if ($qm_conf_ct > 0) - { - $row=mysqli_fetch_row($rslt); - $enable_queuemetrics_logging = $row[0]; - $queuemetrics_server_ip = $row[1]; - $queuemetrics_dbname = $row[2]; - $queuemetrics_login = $row[3]; - $queuemetrics_pass = $row[4]; - $queuemetrics_log_id = $row[5]; - $vicidial_agent_disable = $row[6]; - $allow_sipsak_messages = $row[7]; - $queuemetrics_loginout = $row[8]; - $queuemetrics_addmember_enabled = $row[9]; - $queuemetrics_pe_phone_append = $row[10]; - $queuemetrics_pause_type = $row[11]; - } - ##### END QUEUEMETRICS LOGGING LOOKUP ##### - ########################################### - - if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (preg_match("/SIP/i",$protocol)) ) - { - $extension = preg_replace("/\'|\"|\\\\|;/","",$extension); - $phone_ip = preg_replace("/\'|\"|\\\\|;/","",$phone_ip); - $SIPSAK_prefix = 'LIN-'; - echo "\n"; - passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_prefix$VD_campaign\" -r 5060 -s sip:$extension@$phone_ip > /dev/null"); - $SIqueryCID = "$SIPSAK_prefix$VD_campaign$DS$CIDdate"; - } - - $WebPhonEurl=''; - $webphone_content=''; - $TEMP_SIP_user_DiaL = $SIP_user_DiaL; - if ($on_hook_agent == 'Y') - {$TEMP_SIP_user_DiaL = 'Local/8300@default';} - ### insert a NEW record to the vicidial_manager table to be processed - $agent_login_data="||$NOW_TIME|NEW|N|$server_ip||Originate|$SIqueryCID|Channel: $SIP_user_DiaL|Context: $login_context|Exten: $session_id|Priority: 1|Callerid: \"$SIqueryCID\" <$campaign_cid>|||||"; - $agent_login_stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Originate','$SIqueryCID','Channel: $TEMP_SIP_user_DiaL','Context: $login_context','Exten: $session_id','Priority: 1','Callerid: \"$SIqueryCID\" <$campaign_cid>','','','','','');"; - if ( ($is_webphone != 'Y') and ($is_webphone != 'Y_API_LAUNCH') ) - { - if ($DB) {echo "$agent_login_stmt\n";} - $rslt=mysql_to_mysqli($agent_login_stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01041',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($link); - echo "\n"; - } - else - { - ### build Iframe variable content for webphone here - $codecs_list = preg_replace("/ /",'',$codecs_list); - $codecs_list = preg_replace("/-/",'',$codecs_list); - $codecs_list = preg_replace("/&/",'',$codecs_list); - $webphone_server_ip = $server_ip; - if ($use_external_server_ip=='Y') - { - ##### find external_server_ip if enabled for this phone account - $stmt="SELECT external_server_ip FROM servers where server_ip='$server_ip' LIMIT 1;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01065',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $exip_ct = mysqli_num_rows($rslt); - if ($exip_ct > 0) - { - $row=mysqli_fetch_row($rslt); - $webphone_server_ip =$row[0]; - } - } - if (strlen($webphone_url) < 6) - { - ##### find webphone_url in system_settings and generate IFRAME code for it ##### - $stmt="SELECT webphone_url FROM system_settings LIMIT 1;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01066',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $wu_ct = mysqli_num_rows($rslt); - if ($wu_ct > 0) - { - $row=mysqli_fetch_row($rslt); - $webphone_url =$row[0]; - } - } - if (strlen($system_key) < 1) - { - ##### find system_key in system_settings if populated ##### - $stmt="SELECT webphone_systemkey FROM system_settings LIMIT 1;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01068',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $wsk_ct = mysqli_num_rows($rslt); - if ($wsk_ct > 0) - { - $row=mysqli_fetch_row($rslt); - $system_key =$row[0]; - } - } - $webphone_options='INITIAL_LOAD'; - if ($webphone_dialpad == 'Y') {$webphone_options .= "--DIALPAD_Y";} - if ($webphone_dialpad == 'N') {$webphone_options .= "--DIALPAD_N";} - if ($webphone_dialpad == 'TOGGLE') {$webphone_options .= "--DIALPAD_TOGGLE";} - if ($webphone_dialpad == 'TOGGLE_OFF') {$webphone_options .= "--DIALPAD_OFF_TOGGLE";} - if ($webphone_auto_answer == 'Y') {$webphone_options .= "--AUTOANSWER_Y";} - if ($webphone_auto_answer == 'N') {$webphone_options .= "--AUTOANSWER_N";} - if ($webphone_dialbox == 'Y') {$webphone_options .= "--DIALBOX_Y";} - if ($webphone_dialbox == 'N') {$webphone_options .= "--DIALBOX_N";} - if ($webphone_mute == 'Y') {$webphone_options .= "--MUTE_Y";} - if ($webphone_mute == 'N') {$webphone_options .= "--MUTE_N";} - if ($webphone_volume == 'Y') {$webphone_options .= "--VOLUME_Y";} - if ($webphone_volume == 'N') {$webphone_options .= "--VOLUME_N";} - if ($webphone_debug == 'Y') {$webphone_options .= "--DEBUG";} - if (strlen($web_socket_url) > 5) {$webphone_options .= "--WEBSOCKETURL$web_socket_url";} - - ### base64 encode variables - $b64_phone_login = base64_encode($extension); - $b64_phone_pass = base64_encode($conf_secret); - $b64_session_name = base64_encode($session_name); - $b64_server_ip = base64_encode($webphone_server_ip); - $b64_callerid = base64_encode($outbound_cid); - $b64_protocol = base64_encode($protocol); - $b64_codecs = base64_encode($codecs_list); - $b64_options = base64_encode($webphone_options); - $b64_system_key = base64_encode($system_key); - - $WebPhonEurl = "$webphone_url?phone_login=$b64_phone_login&phone_login=$b64_phone_login&phone_pass=$b64_phone_pass&server_ip=$b64_server_ip&callerid=$b64_callerid&protocol=$b64_protocol&codecs=$b64_codecs&options=$b64_options&system_key=$b64_system_key"; - - if ($is_webphone == 'Y') - { - if ($webphone_location == 'bar') - { - $webphone_content = ""; - } - else - { - $webphone_content = ""; - } - } - } - - $stmt="DELETE from vicidial_session_data where user='$VD_login';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01078',$VD_login,$server_ip,$session_name,$one_mysql_log);} - - $stmt="INSERT INTO vicidial_session_data SET session_name='$session_name',user='$VD_login',campaign_id='$VD_campaign',server_ip='$server_ip',conf_exten='$session_id',extension='$extension',login_time='$NOW_TIME',webphone_url='$WebPhonEurl',agent_login_call='$agent_login_data';"; - if ($DB) {echo "|$stmt|\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01079',$VD_login,$server_ip,$session_name,$one_mysql_log);} - - ##### grab the campaign_weight and number of calls today on that campaign for the agent - $stmt="SELECT campaign_weight,calls_today,campaign_grade FROM vicidial_campaign_agents where user='$VD_login' and campaign_id = '$VD_campaign';"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01042',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $vca_ct = mysqli_num_rows($rslt); - if ($vca_ct > 0) - { - $row=mysqli_fetch_row($rslt); - $campaign_weight = $row[0]; - $calls_today = $row[1]; - $campaign_grade = $row[2]; - $i++; - } - else - { - $campaign_weight = '0'; - $calls_today = '0'; - $campaign_grade = '1'; - $stmt="INSERT INTO vicidial_campaign_agents (user,campaign_id,campaign_rank,campaign_weight,calls_today,campaign_grade) values('$VD_login','$VD_campaign','0','0','$calls_today','$campaign_grade');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01043',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($link); - echo "\n"; - } - - if ($auto_dial_level > 0) - { - echo "\n"; - - $closer_chooser_string=''; - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,closer_campaigns,user_level,campaign_weight,calls_today,last_state_change,outbound_autodial,manager_ingroup_set,on_hook_ring_time,on_hook_agent,last_inbound_call_time,last_inbound_call_finish,campaign_grade,pause_code) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$closer_chooser_string','$user_level','$campaign_weight','$calls_today','$NOW_TIME','Y','N','$phone_ring_timeout','$on_hook_agent','$NOW_TIME','$NOW_TIME','$campaign_grade','LOGIN');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01044',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($link); - echo "\n"; - - if ($enable_queuemetrics_logging > 0) - { - $QM_LOGIN = 'AGENTLOGIN'; - $QM_PHONE = "$VD_login@agents"; - if ( ($queuemetrics_loginout=='CALLBACK') or ($queuemetrics_loginout=='NONE') ) - { - $QM_LOGIN = 'AGENTCALLBACKLOGIN'; - $QM_PHONE = "$SIP_user_DiaL"; - } - $linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - if (!$linkB) {die(_QXZ("Could not connect: ")."$queuemetrics_server_ip|$queuemetrics_login" . mysqli_connect_error());} - mysqli_select_db($linkB, "$queuemetrics_dbname"); - - if ( ($queuemetrics_pe_phone_append > 0) and (strlen($qm_phone_environment)>0) ) - {$qm_phone_environment .= "-$qm_extension";} - - if ($queuemetrics_loginout!='NONE') - { - $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='$QM_LOGIN',data1='$QM_PHONE',serverid='$queuemetrics_log_id',data4='$qm_phone_environment';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $linkB); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01045',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($linkB); - echo "\n"; - } - - $pause_typeSQL=''; - if ($queuemetrics_pause_type > 0) - {$pause_typeSQL=",data5='AGENT'";} - $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id',data4='$qm_phone_environment' $pause_typeSQL;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $linkB); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01046',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($linkB); - echo "\n"; - - if ($queuemetrics_addmember_enabled > 0) - { - $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='ADDMEMBER2',data1='$QM_PHONE',serverid='$queuemetrics_log_id',data4='$qm_phone_environment';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $linkB); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01069',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($linkB); - echo "\n"; - } - - mysqli_close($linkB); - mysqli_select_db($link, "$VARDB_database"); - } - - - if ( ($campaign_allow_inbound == 'Y') and ($dial_method != 'MANUAL') ) - { - print "\n"; - } - } - else - { - print "\n"; - - $stmt="INSERT INTO vicidial_live_agents (user,server_ip,conf_exten,extension,status,lead_id,campaign_id,uniqueid,callerid,channel,random_id,last_call_time,last_update_time,last_call_finish,user_level,campaign_weight,calls_today,last_state_change,outbound_autodial,manager_ingroup_set,on_hook_ring_time,on_hook_agent,campaign_grade) values('$VD_login','$server_ip','$session_id','$SIP_user','PAUSED','','$VD_campaign','','','','$random','$NOW_TIME','$tsNOW_TIME','$NOW_TIME','$user_level', '$campaign_weight', '$calls_today','$NOW_TIME','N','N','$phone_ring_timeout','$on_hook_agent','$campaign_grade');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01047',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($link); - echo "\n"; - - if ($enable_queuemetrics_logging > 0) - { - $QM_LOGIN = 'AGENTLOGIN'; - $QM_PHONE = "$VD_login@agents"; - if ( ($queuemetrics_loginout=='CALLBACK') or ($queuemetrics_loginout=='NONE') ) - { - $QM_LOGIN = 'AGENTCALLBACKLOGIN'; - $QM_PHONE = "$SIP_user_DiaL"; - } - $linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - if (!$linkB) {die(_QXZ("Could not connect: ")."$queuemetrics_server_ip|$queuemetrics_login" . mysqli_connect_error());} - mysqli_select_db($linkB, "$queuemetrics_dbname"); - - if ($queuemetrics_loginout!='NONE') - { - $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='$QM_LOGIN',data1='$QM_PHONE',serverid='$queuemetrics_log_id',data4='$qm_phone_environment';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $linkB); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01048',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($linkB); - echo "\n"; - } - - $pause_typeSQL=''; - if ($queuemetrics_pause_type > 0) - {$pause_typeSQL=",data5='AGENT'";} - $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtimE',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEALL',serverid='$queuemetrics_log_id',data4='$qm_phone_environment' $pause_typeSQL;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $linkB); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01049',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($linkB); - echo "\n"; - - if ($queuemetrics_addmember_enabled > 0) - { - $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtimE',call_id='NONE',queue='$VD_campaign',agent='Agent/$VD_login',verb='ADDMEMBER2',data1='$QM_PHONE',serverid='$queuemetrics_log_id',data4='$qm_phone_environment';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $linkB); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01072',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($linkB); - echo "\n"; - } - - mysqli_close($linkB); - mysqli_select_db($link, "$VARDB_database"); - } - } - } - else - { - echo ""._QXZ("Agent web client: Campaign Login")."\n"; - echo "\n"; - echo "\n"; - if ($hide_timeclock_link < 1) - {echo " "._QXZ("Timeclock")."
    \n";} - echo "\n"; - echo "\n"; - echo "
    \n"; - echo ""._QXZ("Sorry, there are no leads in the hopper for this campaign")."\n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo _QXZ("Login:")." \n
    "; - echo _QXZ("Password:")."
    \n"; - echo _QXZ("Campaign:")." $camp_form_code
    \n"; - echo "   \n"; - echo "\n"; - echo "
    \n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - if (strlen($session_id) < 1) - { - echo ""._QXZ("Agent web client: Campaign Login")."\n"; - echo "\n"; - echo "\n"; - if ($hide_timeclock_link < 1) - {echo " "._QXZ("Timeclock")."
    \n";} - echo "\n"; - echo "\n"; - echo "
    \n"; - echo ""._QXZ("Sorry, there are no available sessions").": |$session_id|$server_ip|$extension|$SIP_user|\n"; - echo "
    \n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo _QXZ("Login:")." \n
    "; - echo _QXZ("Password:")."
    \n"; - echo _QXZ("Campaign:")." $camp_form_code
    \n"; - echo "   \n"; - echo "\n"; - echo "
    \n\n"; - echo "\n\n"; - echo "\n\n"; - exit; - } - - if (preg_match('/MSIE/',$browser)) - { - $useIE=1; - echo "\n"; - } - else - { - $useIE=0; - echo "\n"; - } - - $StarTtimE = date("U"); - $NOW_TIME = date("Y-m-d H:i:s"); - ##### Agent is going to log in so insert the vicidial_agent_log entry now - $stmt="INSERT INTO vicidial_agent_log (user,server_ip,event_time,campaign_id,pause_epoch,pause_sec,wait_epoch,user_group,sub_status,pause_type) values('$VD_login','$server_ip','$NOW_TIME','$VD_campaign','$StarTtimE','0','$StarTtimE','$VU_user_group','LOGIN','AGENT');"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01050',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($link); - $agent_log_id = mysqli_insert_id($link); - echo "\n"; - - ##### update vicidial_campaigns to show agent has logged in - $stmt="UPDATE vicidial_campaigns set campaign_logindate='$NOW_TIME' where campaign_id='$VD_campaign';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01064',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $VCaffected_rows = mysqli_affected_rows($link); - echo "\n"; - - if ($enable_queuemetrics_logging > 0) - { - $StarTtimEpause = ($StarTtimE + 1); - $linkB=mysqli_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass"); - if (!$linkB) {die(_QXZ("Could not connect: ")."$queuemetrics_server_ip|$queuemetrics_login" . mysqli_connect_error());} - mysqli_select_db($linkB, "$queuemetrics_dbname"); - - $pause_typeSQL=''; - if ($queuemetrics_pause_type > 0) - {$pause_typeSQL=",data5='AGENT'";} - - $stmt = "INSERT INTO queue_log SET `partition`='P01',time_id='$StarTtimEpause',call_id='NONE',queue='NONE',agent='Agent/$VD_login',verb='PAUSEREASON',data1='LOGIN',data3='$QM_PHONE',serverid='$queuemetrics_log_id'$pause_typeSQL;"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $linkB); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$linkB,$mel,$stmt,'01063',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $affected_rows = mysqli_affected_rows($linkB); - echo "\n"; - - mysqli_close($linkB); - mysqli_select_db($link, "$VARDB_database"); - } - - $stmt="UPDATE vicidial_live_agents SET agent_log_id='$agent_log_id' where user='$VD_login';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01061',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $VLAaffected_rows_update = mysqli_affected_rows($link); - - $stmt="UPDATE vicidial_users SET shift_override_flag='0' where user='$VD_login' and shift_override_flag='1';"; - if ($DB) {echo "$stmt\n";} - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01057',$VD_login,$server_ip,$session_name,$one_mysql_log);} - $VUaffected_rows = mysqli_affected_rows($link); - - $S='*'; - $D_s_ip = explode('.', $server_ip); - if (strlen($D_s_ip[0])<2) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[0])<3) {$D_s_ip[0] = "0$D_s_ip[0]";} - if (strlen($D_s_ip[1])<2) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[1])<3) {$D_s_ip[1] = "0$D_s_ip[1]";} - if (strlen($D_s_ip[2])<2) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[2])<3) {$D_s_ip[2] = "0$D_s_ip[2]";} - if (strlen($D_s_ip[3])<2) {$D_s_ip[3] = "0$D_s_ip[3]";} - if (strlen($D_s_ip[3])<3) {$D_s_ip[3] = "0$D_s_ip[3]";} - $server_ip_dialstring = "$D_s_ip[0]$S$D_s_ip[1]$S$D_s_ip[2]$S$D_s_ip[3]$S"; - - ##### grab the datails of all active scripts in the system - $stmt="SELECT script_id,script_name FROM vicidial_scripts WHERE active='Y' order by script_id limit 1000;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01051',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $MM_scripts = mysqli_num_rows($rslt); - $e=0; - while ($e < $MM_scripts) - { - $row=mysqli_fetch_row($rslt); - $MMscriptid[$e] =$row[0]; - $MMscriptname[$e] = urlencode($row[1]); - $MMscriptids = "$MMscriptids'$MMscriptid[$e]',"; - $MMscriptnames = "$MMscriptnames'$MMscriptname[$e]',"; - $e++; - } - $MMscriptids = substr("$MMscriptids", 0, -1); - $MMscriptnames = substr("$MMscriptnames", 0, -1); - - - ##### BEGIN vicidial_list FIELD LENGTH LOOKUP ##### - $MAXvendor_lead_code = '20'; - $MAXphone_code = '10'; - $MAXphone_number = '18'; - $MAXtitle = '4'; - $MAXfirst_name = '30'; - $MAXmiddle_initial = '1'; - $MAXlast_name = '30'; - $MAXaddress1 = '100'; - $MAXaddress2 = '100'; - $MAXaddress3 = '100'; - $MAXcity = '50'; - $MAXstate = '2'; - $MAXprovince = '50'; - $MAXpostal_code = '10'; - $MAXalt_phone = '12'; - $MAXemail = '70'; - $MAXsecurity_phrase = '100'; - - $stmt = "SHOW COLUMNS FROM vicidial_list;"; - $rslt=mysql_to_mysqli($stmt, $link); - if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01087',$VD_login,$server_ip,$session_name,$one_mysql_log);} - if ($DB) {echo "$stmt\n";} - $scvl_ct = mysqli_num_rows($rslt); - $s=0; - while ($scvl_ct > $s) - { - $row=mysqli_fetch_row($rslt); - $vl_field = $row[0]; - $vl_type = preg_replace("/[^0-9]/",'',$row[1]); - if (strlen($vl_type) > 0) - { - if ( ($vl_field == 'vendor_lead_code') and ($MAXvendor_lead_code != $vl_type) ) - {$MAXvendor_lead_code = $vl_type;} - if ( ($vl_field == 'phone_code') and ($MAXphone_code != $vl_type) ) - {$MAXphone_code = $vl_type;} - if ( ($vl_field == 'phone_number') and ($MAXphone_number != $vl_type) ) - {$MAXphone_number = $vl_type;} - if ( ($vl_field == 'title') and ($MAXtitle != $vl_type) ) - {$MAXtitle = $vl_type;} - if ( ($vl_field == 'first_name') and ($MAXfirst_name != $vl_type) ) - {$MAXfirst_name = $vl_type;} - if ( ($vl_field == 'middle_initial') and ($MAXmiddle_initial != $vl_type) ) - {$MAXmiddle_initial = $vl_type;} - if ( ($vl_field == 'last_name') and ($MAXlast_name != $vl_type) ) - {$MAXlast_name = $vl_type;} - if ( ($vl_field == 'address1') and ($MAXaddress1 != $vl_type) ) - {$MAXaddress1 = $vl_type;} - if ( ($vl_field == 'address2') and ($MAXaddress2 != $vl_type) ) - {$MAXaddress2 = $vl_type;} - if ( ($vl_field == 'address3') and ($MAXaddress3 != $vl_type) ) - {$MAXaddress3 = $vl_type;} - if ( ($vl_field == 'city') and ($MAXcity != $vl_type) ) - {$MAXcity = $vl_type;} - if ( ($vl_field == 'state') and ($MAXstate != $vl_type) ) - {$MAXstate = $vl_type;} - if ( ($vl_field == 'province') and ($MAXprovince != $vl_type) ) - {$MAXprovince = $vl_type;} - if ( ($vl_field == 'postal_code') and ($MAXpostal_code != $vl_type) ) - {$MAXpostal_code = $vl_type;} - if ( ($vl_field == 'alt_phone') and ($MAXalt_phone != $vl_type) ) - {$MAXalt_phone = $vl_type;} - if ( ($vl_field == 'email') and ($MAXemail != $vl_type) ) - {$MAXemail = $vl_type;} - if ( ($vl_field == 'security_phrase') and ($MAXsecurity_phrase != $vl_type) ) - {$MAXsecurity_phrase = $vl_type;} - } - $s++; - } - ##### END vicidial_list FIELD LENGTH LOOKUP ##### - } - } - - -### SCREEN WIDTH AND HEIGHT CALCULATIONS ### -### DO NOT EDIT! ### -if ($stretch_dimensions > 0) - { - if ($agent_status_view < 1) - { - if ($JS_browser_width >= 510) - {$BROWSER_WIDTH = ($JS_browser_width - 80);} - } - else - { - if ($JS_browser_width >= 730) - {$BROWSER_WIDTH = ($JS_browser_width - 300);} - } - if ($JS_browser_height >= 340) - {$BROWSER_HEIGHT = ($JS_browser_height - 40);} - } -if ($agent_fullscreen=='Y') - { - $BROWSER_WIDTH = ($JS_browser_width - 10); - $BROWSER_HEIGHT = $JS_browser_height; - } -$MASTERwidth=($BROWSER_WIDTH - 340); -$MASTERheight=($BROWSER_HEIGHT - 200); -if ($MASTERwidth < 430) {$MASTERwidth = '430';} -if ($MASTERheight < 300) {$MASTERheight = '300';} -if ($per_call_notes == 'ENABLED') - { - if ($MASTERheight < 340) {$MASTERheight = '340';} - } -if ($webphone_location == 'bar') {$MASTERwidth = ($MASTERwidth + $webphone_height);} - -$CAwidth = ($MASTERwidth + 340); # 770 - cover all (none-in-session, customer hunngup, etc...) -$SBwidth = ($MASTERwidth + 331); # 761 - SideBar starting point -$MNwidth = ($MASTERwidth + 330); # 760 - main frame -$XFwidth = ($MASTERwidth + 320); # 750 - transfer/conference -$HCwidth = ($MASTERwidth + 310); # 740 - hotkeys and callbacks -$CQwidth = ($MASTERwidth + 300); # 730 - calls in queue listings -$AMwidth = ($MASTERwidth + 270); # 700 - refresh links -$SCwidth = ($MASTERwidth + 230); # 670 - live call seconds counter, sidebar link -$PDwidth = ($MASTERwidth + 210); # 650 - preset-dial links -$MUwidth = ($MASTERwidth + 180); # 610 - agent mute -$SSwidth = ($MASTERwidth + 176); # 606 - scroll script -$SDwidth = ($MASTERwidth + 170); # 600 - scroll script, customer data and calls-in-session -$HKwidth = ($MASTERwidth + 20); # 450 - Hotkeys button -$HSwidth = ($MASTERwidth + 1); # 431 - Header spacer -$PBwidth = ($MASTERwidth + 0); # 430 - Presets list -$CLwidth = ($MASTERwidth - 120); # 310 - Calls in queue link - - -$GHheight = ($MASTERheight + 1260);# 1560 - Gender Hide span -$DBheight = ($MASTERheight + 260); # 560 - Debug span -$WRheight = ($MASTERheight + 210); # 510 - Warning boxes -$CQheight = ($MASTERheight + 140); # 440 - Calls in queue section -$SLheight = ($MASTERheight + 122); # 422 - SideBar link, Agents view link -$QLheight = ($MASTERheight + 112); # 412 - Calls in queue link -$HKheight = ($MASTERheight + 105); # 405 - HotKey active Button -$AMheight = ($MASTERheight + 100); # 400 - Agent mute buttons -$PBheight = ($MASTERheight + 90); # 390 - preset dial links -$MBheight = ($MASTERheight + 65); # 365 - Manual Dial Buttons -$CBheight = ($MASTERheight + 50); # 350 - Agent Callback, pause code, volume control Buttons and agent status -$SSheight = ($MASTERheight + 31); # 331 - script content -$HTheight = ($MASTERheight + 10); # 310 - transfer frame, callback comments and hotkey -$BPheight = ($MASTERheight - 250); # 50 - bottom buffer, Agent Xfer Span -$SCheight = 49; # 49 - seconds on call display -$SFheight = 65; # 65 - height of the script and form contents -$SRheight = 69; # 69 - height of the script and form refrech links -$CHheight = ($JS_browser_height - 50); -if ($webphone_location == 'bar') - { - $SCheight = ($SCheight + $webphone_height); -# $SFheight = ($SFheight + $webphone_height); - $SRheight = ($SRheight + $webphone_height); - } -$AVTheight = '0'; -if ($is_webphone) {$AVTheight = '20';} - - -################################################################ -### BEGIN - build the callback calendar (12 months) ### -################################################################ -define ('ADAY', (60*60*24)); -$CdayARY = getdate(); -$Cmon = $CdayARY['mon']; -$Cyear = $CdayARY['year']; -$CTODAY = date("Y-m"); -$CTODAYmday = date("j"); -$CINC=0; -$live_days=0; -$limit_days=999; -if ($callback_days_limit > 0) - {$limit_days=$callback_days_limit;} - -$Cmonths = Array('0','January','February','March','April','May','June', - 'July','August','September','October','November','December'); -$Cdays = Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'); - -$CCAL_OUT = ''; - -$CCAL_OUT .= ""; - -while ($CINC < 12) - { - if ( ($CINC == 0) || ($CINC == 4) ||($CINC == 8) ) - {$CCAL_OUT .= "";} - - $CCAL_OUT .= ""; - - if ( ($CINC == 3) || ($CINC == 7) ||($CINC == 11) ) - {$CCAL_OUT .= "";} - $CINC++; - } - -$CCAL_OUT .= "
    "; - - $CYyear = $Cyear; - $Cmonth= ($Cmon + $CINC); - if ($Cmonth > 12) - { - $Cmonth = ($Cmonth - 12); - $CYyear++; - } - $Cstart= mktime(11,0,0,$Cmonth,1,$CYyear); - $CfirstdayARY = getdate($Cstart); - #echo "|$Cmon|$Cmonth|$CINC|\n"; - $CPRNTDAY = date("Y-m", $Cstart); - - $CCAL_OUT .= ""; - $CCAL_OUT .= ""; - $CCAL_OUT .= ""; - $CCAL_OUT .= ""; - - foreach($Cdays as $Cday) - { - $CDCLR="#ffffff"; - $CCAL_OUT .= ""; - } - - for( $Ccount=0;$Ccount<(6*7);$Ccount++) - { - $Cdayarray = getdate($Cstart); - if((($Ccount) % 7) == 0) - { - if($Cdayarray['mon'] != $CfirstdayARY['mon']) - break; - $CCAL_OUT .= ""; - } - if($Ccount < $CfirstdayARY['wday'] || $Cdayarray['mon'] != $Cmonth) - { - $CCAL_OUT .= ""; - } - else - { - if( ($Cdayarray['mday'] == $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - if ($limit_days > $live_days) - { - $CB_date_onclick="onclick=\"CB_date_pick('$CPRNTDAY-$CPRNTmday');return false;\""; - $CBL = ""; - $CEL = ""; - } - else - {$CBL=''; $CEL=''; $CB_date_onclick='';} - $CCAL_OUT .= ""; - $Cstart += ADAY; - $live_days++; - } - else - { - $CDCLR="#ffffff"; - if ( ($Cdayarray['mday'] < $CTODAYmday) and ($CPRNTDAY == $CTODAY) ) - { - $CDCLR="$MAIN_COLOR"; - $CBL = ''; - $CEL = ''; - $CB_date_onclick=''; - } - else - { - $CPRNTmday = $Cdayarray['mday']; - if ($CPRNTmday < 10) {$CPRNTmday = "0$CPRNTmday";} - if ($limit_days > $live_days) - { - $CB_date_onclick="onclick=\"CB_date_pick('$CPRNTDAY-$CPRNTmday');return false;\""; - $CBL = ""; - $CEL = ""; - } - else - {$CBL=''; $CEL=''; $CB_date_onclick='';} - $live_days++; - } - - $CCAL_OUT .= ""; - $Cstart += ADAY; - } - } - } - $CCAL_OUT .= ""; - $CCAL_OUT .= "
    "; - $CCAL_OUT .= "
    "; - $CCAL_OUT .= $Cmonths[$CfirstdayARY['mon']]." $CfirstdayARY[year]"; - $CCAL_OUT .= "
    "; - $CCAL_OUT .= "
    "; - $CCAL_OUT .= "
    "; - $CCAL_OUT .= "$Cday"; - $CCAL_OUT .= "
    "; - $CCAL_OUT .= "
     "; - $CCAL_OUT .= "
    "; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
    "; - $CCAL_OUT .= "
    "; - $CCAL_OUT .= "
    "; - $CCAL_OUT .= "$CBL$Cdayarray[mday]$CEL"; - $CCAL_OUT .= "
    "; - $CCAL_OUT .= "
    "; - $CCAL_OUT .= "
    "; - -#echo "$CCAL_OUT\n"; -################################################################ -### END - build the callback calendar (12 months) ### -################################################################ - - -?> - - - - -\n"; - -$zi=2; - -?> - - -
    - - -
    -
    -
    -
    -
    -
    -
    -           " height="90px" width="545px" alt="Loading" /> -
    -
    -
    -
    - - - - - - -
    - - - - - "._QXZ("ring").")";} - echo "  "._QXZ("to campaign").": $VD_campaign  "; - ?>     - 0) {echo ""._QXZ("TERRITORIES")."     \n";} ?> - 0) {echo ""._QXZ("GROUPS")."     \n";} ?> - "._QXZ("LOGOUT")."\n"; ?> -
    -
    - - - - - - - 0) - {echo "\n";} - ?> - 0) - {echo "\n";} - ?> - 0) - { - # INTERNAL CHAT - echo "\n"; - - # CUSTOMER CHAT - echo "\n"; - } - ?> - - - -
    " alt="MAIN" width="115px" height="30px" border="0" />" alt="SCRIPT" width="67px" height="30px" border="0" />\"FORM\"\"EMAIL\"\"CHAT\"\"CHAT\"     
          
    " name="livecall" alt="Live Call" width="109px" height="30px" border="0" />
    -
    - - -

    -
    - - - - - - - - - - - - - -
    -
    \n"; - } - $alt_phone_selected=''; - if ( ($alt_number_dialing=='SELECTED') or ($alt_number_dialing=='SELECTED_TIMER_ALT') or ($alt_number_dialing=='SELECTED_TIMER_ADDR3') ) - {$alt_phone_selected='CHECKED';} - ?> - -
    -
    - " border="0" alt="Dial Next Number" />
    - - -
    - />
    -
    - - -
    -
    -
    -
    -
    - - " border="0" alt="Start Recording" />
    - " width="145px" height="16px" border="0" />
    - " border="0" alt="Web Form" />
    - 0) - {echo "\"Web
    \n";} - if ($enable_third_webform > 0) - {echo "\"Web
    \n";} - ?> -  
    - " border="0" alt="Park Call" />
    - \"IVR
    \n";} - else - {echo "\n";} - ?> - " border="0" alt="Transfer - Conference" />
    - - 0) - {echo "\"Quick
    \n";} - if ($custom_3way_button_transfer_enabled > 0) - {echo "\"Custom
    \n";} - ?> - - - - 0) - {echo "
    \n";} - ?> - - " width="145px" height="16px" border="0" />
    - " border="0" alt="Hangup Customer" />
    - " width="145px" height="16px" border="0" />
    -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
                             
            - "._QXZ("LEAD SEARCH")."";} - ?> -
    - - - - - -
    - ";} - else - {echo "$label_title: ";} - if ($label_first_name == '---HIDE---') - {echo "  ";} - else - {echo "  $label_first_name: ";} - if ($label_middle_initial == '---HIDE---') - {echo "  ";} - else - {echo "  $label_middle_initial: ";} - if ($label_last_name == '---HIDE---') - {echo "  ";} - else - {echo "  $label_last_name: ";} - - echo "
    "; - - if ($label_address1 == '---HIDE---') - {echo " ";} - else - {echo "$label_address1: ";} - - echo "
    "; - - if ($label_address2 == '---HIDE---') - {echo " ";} - else - {echo "$label_address2: ";} - - echo ""; - - if ($label_address3 == '---HIDE---') - {echo " ";} - else - {echo "$label_address3: ";} - - echo "
    "; - - if ($label_city == '---HIDE---') - {echo " ";} - else - {echo "$label_city: ";} - - echo ""; - - if ($label_state == '---HIDE---') - {echo " ";} - else - {echo "$label_state: ";} - - echo ""; - - if ($label_postal_code == '---HIDE---') - {echo " ";} - else - {echo "$label_postal_code: ";} - - echo "
    "; - - if ($label_province == '---HIDE---') - {echo " ";} - else - {echo "$label_province: ";} - - echo ""; - - if ($label_vendor_lead_code == '---HIDE---') - {echo " ";} - else - {echo "$label_vendor_lead_code: ";} - - echo ""; - - if ($label_gender == '---HIDE---') - { - echo ""; - } - else - { - echo "$label_gender: "; - } - - echo "
    "; - - if ($label_phone_number == '---HIDE---') - { - echo " "; - echo "   "; - } - else - { - echo "$label_phone_number: "; - - if ( (preg_match('/Y/',$disable_alter_custphone)) or (preg_match('/HIDE/',$disable_alter_custphone)) ) - { - echo "                     "; - echo ""; - } - else - { - echo ""; - } - } - - echo ""; - - if ($label_phone_code == '---HIDE---') - {echo " ";} - else - {echo "$label_phone_code: ";} - - echo ""; - - if ($label_alt_phone == '---HIDE---') - {echo " ";} - else - {echo "$label_alt_phone: ";} - - echo "
    "; - - if ($label_security_phrase == '---HIDE---') - {echo " ";} - else - {echo "$label_security_phrase: ";} - - echo ""; - - if ($label_email == '---HIDE---') - {echo " ";} - else - {echo "$label_email: ";} - - if (strlen($agent_display_fields) > 3) - { - echo "
    "; - - if (preg_match("/entry_date/",$agent_display_fields)) - { - echo _QXZ("Entry Date").":                       "; - } - if (preg_match("/source_id/",$agent_display_fields)) - { - echo _QXZ("Source ID").":                       "; - } - if (preg_match("/date_of_birth/",$agent_display_fields)) - { - echo _QXZ("Date of Birth").":               "; - } - if (preg_match("/rank/",$agent_display_fields)) - { - echo _QXZ("Rank").":         "; - } - if (preg_match("/owner/",$agent_display_fields)) - { - echo _QXZ("Owner").":               "; - } - } - - echo "
    "; - - if ($label_comments == '---HIDE---') - { - echo " "; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - echo "\n"; - } - else - { - echo "$label_comments:
    -
    "; - if ( ($multi_line_comments) ) - {echo "\n";} - else - {echo "\n";} - } - echo "
    \n"; - - if ($per_call_notes == 'ENABLED') - { - echo _QXZ("Call Notes: "); - if ($agent_call_log_view == '1') - {echo "
    "._QXZ("view notes")." ";} - echo "
    "; - echo "\n"; - } - else - { - echo " \n"; - } - - - ?> - -
    -
    - -
    -
    -  
    -  
    -
    - - - - - - -        -
    -
    - - -
    -
    - - -     - - - -
                       
    - - -

     
    -
    - 0) ) - {echo ""._QXZ("Alert is ON")."";} - else - {echo ""._QXZ("Alert is OFF")."";} - ?> -
    - - -
    -
    - - -     -
    - -" border="0" />
    " border="0" /> -
    - - -
    -
    - - - "._QXZ("D1 - DIAL")."\n"; - echo "   \n"; - echo ""._QXZ("D2 - DIAL")."\n"; - } - else {echo "
    \n";} - ?> -

     
    -
    - -
       
     
    - - - 0) - { - if ($view_calls_in_queue_launch > 0) - {echo ""._QXZ("Hide Calls In Queue")."\n";} - else - {echo ""._QXZ("Show Calls In Queue")."\n";} - } -?> - - - -
    -
    - - -
\n"; - echo "$label_comments:
-
"; - if ( ($multi_line_comments) ) - {echo "\n";} - else - {echo "\n";} - echo "
\n"; - } - else - { - echo "\n"; - } -?> - - -
  -  
 
- -$webphone_content\n"; - } -else - { - echo "
  - Web Phone:  
$webphone_content
\n"; - } -?> - - -
- - - -
 
- - - - - 0) - { - echo _QXZ("Dialable Leads:")."
 \n"; - } -?> -
- - - - -
\n";} - ?> -
-
- - - - - - -
\n";} - ?> -
-
- - -
\n";} - ?> -
-
- - -
\n";} - ?> -
-
- - -
\n";} - ?> -
-
- - - - - - - - - - - - - -


- - - - -
-
-
- - - - - - - -
-
- - - - - -
-
- - 0) && ($user_level>=$HKuser_level) && ($VU_hotkeys_active > 0) ) { ?> -" border="0" alt="HOT KEYS INACTIVE" /> - - - - - - - -
- - - " border="0" alt="Transfer - Conference" style="vertical-align:middle" />            
- - - - - - - - - - - - - - - - - - - - - - - -
- - - " border="0" alt="LOCAL CLOSER" style="vertical-align:middle" />     - - " border="0" alt="Hangup Xfer Line" style="vertical-align:middle" /> -
- " border="0" alt="seconds" style="vertical-align:middle" /> -   - " border="0" alt="channel" style="vertical-align:middle" /> - -   - - " border="0" alt="Hangup Both Lines" style="vertical-align:middle" /> -
- " border="0" alt="Number to call" style="vertical-align:middle" /> -   - -                     - -   - - - - - - - - - " border="0" alt="LEAVE 3-WAY CALL" style="vertical-align:middle" /> -
- " border="0" alt="Dial Blind Transfer" style="vertical-align:middle" /> -   - " border="0" alt="Dial With Customer" style="vertical-align:middle" /> -   - " border="0" alt="Park Customer Dial" style="vertical-align:middle" /> -   - - " border="0" alt="Presets Button" style="vertical-align:middle" /> - - " border="0" alt="Contacts Button" style="vertical-align:middle" /> - - - D1 - D2 - D3 - D4 - D5 - - -   - " border="0" alt="Blind Transfer VMail Message" style="vertical-align:middle" /> -
- -
-
-
-
- -
-
- - - - - - - - - -
-
-
-
-
- -
-
- - - - - -

-
- - -

- -

- -
-
- - -

- -

- -
-
- - -


- -

- -
-
- -
- - -
-


- -
-
- - -



-
-
- - -



-
-
- - -



-
- - -
-
- - -
 
-
- - -
-
- - -
           
-
\n";} - ?> - - - - - -
-
- | - -

- -

  -
-
- - -

-
\n";} - ?> - - -   -     - -   - -   - - - - -  
- "._QXZ("MY CALLBACK ONLY")."
";} - - if ($comments_callback_screen != 'REPLACE_CB_NOTES') - {echo _QXZ("CB Comments:")."

\n";} - else - {echo "
\n";} - - echo "
\n"; - ?> - -

- -

  -
-
- - - - px height='px' cellpadding=3 cellspacing=4> - - - - - - -
 
- -
-
- - - - - - - - - -
-
-
-
-
- -
-
- - -
To see information on one of the callbacks below, click on the INFO link. To call the customer back now, click on the DIAL link. If you click on a record below to dial it, it will be removed from the list.",0,'',$VD_login); ?> -
-
\n";} - ?> -
-
  - -                 - -
-
- - -


-
- \n"; - } - ?> -

- - - - - - \n"; - echo " \n"; - echo " - - - - - - - - - -
 
-   - - - - "; - echo "
"._QXZ("Dial Lead ID:")." \n"; - echo "   "._QXZ("(digits only)")."\n"; - } - else - { - echo "\n"; - } - - $LeadLookuPXtra=''; - if ($manual_dial_search_checkbox == 'SELECTED_LOCK') - {$LeadLookuPXtra = 'CHECKED DISABLED ';} - if ($manual_dial_search_checkbox == 'UNSELECTED_LOCK') - {$LeadLookuPXtra = 'DISABLED ';} - ?> -
/> 
-

-     -

-     -

- -
-


 
- -   - -   - - -
-
- -                 - -                 - -
-
- - -

-
\n";} - ?> - -
- 0) and ($disable_blended_checkbox < 1) and ($dial_method != 'INBOUND_MAN') and ($VU_agent_choose_blended > 0) ) - { - ?> -
- - | - -



  -
-
- - -

-
\n";} - ?> - -
- | - -



  -
-
- - - - - "._QXZ("MY CALLBACK ONLY")."
";} - if ( ($outbound_autodial_active < 1) or ($disable_blended_checkbox > 0) or ($dial_method == 'INBOUND_MAN') or ($VU_agent_choose_blended < 1) ) - {echo " "._QXZ("BLENDED CALLING")."
";} - ?> -
- - -
                  [X]
-
\n";} - ?> -
-

  -
-
- - -
                  close [X]
-
\n";} - ?> -

- Contact search requests are all logged in the system."); ?> -

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - -

           
-

  -
-
- - -
                  [X]
-
\n";} - ?> -
-

  -
-
- - -
                  [X]
-
\n";} - ?> -

-

-

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -
:
:
:
:
:
:

           
-

  -
-
- - -
                  [X]
-
\n";} - ?> -
-

  -
-
- - -
                  [X]
-
\n";} - ?> -
-

  - -
-
- - -
                  [X] -
-
\n";} - ?> - -

  - -
-
- - -

-
\n";} - ?> - - -

  -
-
- - -

-
\n";} - ?> - - -
-
- - -

-
\n";} - ?> - - -

  -
-
- - -

-
\n";} - ?> - - -

  -
-
- - -

-     -

-
-
- - -

--> -
-
- - -

-
-
- - - - - - - - -
- - - - - - -
- -
- - - - - -
-   -
- - - - - - -
  -

-" alt="alert" border="0"> -
  -

- - - -

-
- -
  - -
-
-
- -
- - - - - - - - +deprecated, use vicidial.php \ No newline at end of file diff --git a/agc_2-X/trunk/www/agc/vicidial.php b/agc_2-X/trunk/www/agc/vicidial.php index 6abcad48..a0f64239 100644 --- a/agc_2-X/trunk/www/agc/vicidial.php +++ b/agc_2-X/trunk/www/agc/vicidial.php @@ -755,10 +755,11 @@ # 251124-0936 - Added lead status display for callbacks list # 260106-1418 - Fixes for PHP8 # 260301-0850 - Added xfer_talk_minimum features for In-Group transfers +# 260302-0935 - Code updates for PHP8 compatibility # -$version = '2.14-721c'; -$build = '260301-0850'; +$version = '2.14-722c'; +$build = '260302-0935'; $php_script = 'vicidial.php'; $mel=1; # Mysql Error Log enabled = 1 $mysql_log_count=109; @@ -772,77 +773,106 @@ require_once("functions.php"); if (isset($_GET["DB"])) {$DB=$_GET["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} if (isset($_GET["JS_browser_width"])) {$JS_browser_width=$_GET["JS_browser_width"];} - elseif (isset($_POST["JS_browser_width"])) {$JS_browser_width=$_POST["JS_browser_width"];} + elseif (isset($_POST["JS_browser_width"])) {$JS_browser_width=$_POST["JS_browser_width"];} + else {$JS_browser_width=0;} if (isset($_GET["JS_browser_height"])) {$JS_browser_height=$_GET["JS_browser_height"];} - elseif (isset($_POST["JS_browser_height"])) {$JS_browser_height=$_POST["JS_browser_height"];} -if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} - elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} + elseif (isset($_POST["JS_browser_height"])) {$JS_browser_height=$_POST["JS_browser_height"];} + else {$JS_browser_height=0;} +if (isset($_GET["phone_login"])) {$phone_login=$_GET["phone_login"];} + elseif (isset($_POST["phone_login"])) {$phone_login=$_POST["phone_login"];} if (isset($_GET["phone_pass"])) {$phone_pass=$_GET["phone_pass"];} - elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} + elseif (isset($_POST["phone_pass"])) {$phone_pass=$_POST["phone_pass"];} if (isset($_GET["VD_login"])) {$VD_login=$_GET["VD_login"];} - elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} + elseif (isset($_POST["VD_login"])) {$VD_login=$_POST["VD_login"];} + else {$VD_login="";} if (isset($_GET["VD_pass"])) {$VD_pass=$_GET["VD_pass"];} - elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} -if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} - elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} -if (isset($_GET["VD_language"])) {$VD_language=$_GET["VD_language"];} - elseif (isset($_POST["VD_language"])) {$VD_language=$_POST["VD_language"];} + elseif (isset($_POST["VD_pass"])) {$VD_pass=$_POST["VD_pass"];} + else {$VD_pass="";} +if (isset($_GET["VD_campaign"])) {$VD_campaign=$_GET["VD_campaign"];} + elseif (isset($_POST["VD_campaign"])) {$VD_campaign=$_POST["VD_campaign"];} +if (isset($_GET["VD_language"])) {$VD_language=$_GET["VD_language"];} + elseif (isset($_POST["VD_language"])) {$VD_language=$_POST["VD_language"];} + else {$VD_language="";} if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];} - elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} + elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];} + else {$relogin="";} if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["MGR_override"];} - elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];} + elseif (isset($_POST["MGR_override"])) {$MGR_override=$_POST["MGR_override"];} + else {$MGR_override=0;} if (isset($_GET["admin_test"])) {$admin_test=$_GET["admin_test"];} - elseif (isset($_POST["admin_test"])) {$admin_test=$_POST["admin_test"];} + elseif (isset($_POST["admin_test"])) {$admin_test=$_POST["admin_test"];} + else {$admin_test="";} if (isset($_GET["LOGINvarONE"])) {$LOGINvarONE=$_GET["LOGINvarONE"];} - elseif (isset($_POST["LOGINvarONE"])) {$LOGINvarONE=$_POST["LOGINvarONE"];} + elseif (isset($_POST["LOGINvarONE"])) {$LOGINvarONE=$_POST["LOGINvarONE"];} + else {$LOGINvarONE="";} if (isset($_GET["LOGINvarTWO"])) {$LOGINvarTWO=$_GET["LOGINvarTWO"];} - elseif (isset($_POST["LOGINvarTWO"])) {$LOGINvarTWO=$_POST["LOGINvarTWO"];} + elseif (isset($_POST["LOGINvarTWO"])) {$LOGINvarTWO=$_POST["LOGINvarTWO"];} + else {$LOGINvarTWO="";} if (isset($_GET["LOGINvarTHREE"])) {$LOGINvarTHREE=$_GET["LOGINvarTHREE"];} - elseif (isset($_POST["LOGINvarTHREE"])) {$LOGINvarTHREE=$_POST["LOGINvarTHREE"];} + elseif (isset($_POST["LOGINvarTHREE"])) {$LOGINvarTHREE=$_POST["LOGINvarTHREE"];} + else {$LOGINvarTHREE="";} if (isset($_GET["LOGINvarFOUR"])) {$LOGINvarFOUR=$_GET["LOGINvarFOUR"];} - elseif (isset($_POST["LOGINvarFOUR"])) {$LOGINvarFOUR=$_POST["LOGINvarFOUR"];} + elseif (isset($_POST["LOGINvarFOUR"])) {$LOGINvarFOUR=$_POST["LOGINvarFOUR"];} + else {$LOGINvarFOUR="";} if (isset($_GET["LOGINvarFIVE"])) {$LOGINvarFIVE=$_GET["LOGINvarFIVE"];} - elseif (isset($_POST["LOGINvarFIVE"])) {$LOGINvarFIVE=$_POST["LOGINvarFIVE"];} + elseif (isset($_POST["LOGINvarFIVE"])) {$LOGINvarFIVE=$_POST["LOGINvarFIVE"];} + else {$LOGINvarFIVE="";} if (isset($_GET["hide_relogin_fields"])) {$hide_relogin_fields=$_GET["hide_relogin_fields"];} - elseif (isset($_POST["hide_relogin_fields"])) {$hide_relogin_fields=$_POST["hide_relogin_fields"];} + elseif (isset($_POST["hide_relogin_fields"])) {$hide_relogin_fields=$_POST["hide_relogin_fields"];} + else {$hide_relogin_fields="";} if (isset($_GET["set_pass"])) {$set_pass=$_GET["set_pass"];} - elseif (isset($_POST["set_pass"])) {$set_pass=$_POST["set_pass"];} + elseif (isset($_POST["set_pass"])) {$set_pass=$_POST["set_pass"];} + else {$set_pass=0;} if (isset($_GET["new_pass1"])) {$new_pass1=$_GET["new_pass1"];} - elseif (isset($_POST["new_pass1"])) {$new_pass1=$_POST["new_pass1"];} + elseif (isset($_POST["new_pass1"])) {$new_pass1=$_POST["new_pass1"];} + else {$new_pass1="";} if (isset($_GET["new_pass2"])) {$new_pass2=$_GET["new_pass2"];} - elseif (isset($_POST["new_pass2"])) {$new_pass2=$_POST["new_pass2"];} + elseif (isset($_POST["new_pass2"])) {$new_pass2=$_POST["new_pass2"];} + else {$new_pass2="";} if (isset($_GET["stage"])) {$stage=$_GET["stage"];} - elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} + elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];} + else {$stage="";} if (isset($_GET["rank"])) {$rank=$_GET["rank"];} - elseif (isset($_POST["rank"])) {$rank=$_POST["rank"];} + elseif (isset($_POST["rank"])) {$rank=$_POST["rank"];} + else {$rank="";} if (isset($_GET["auth_entry"])) {$auth_entry=$_GET["auth_entry"];} - elseif (isset($_POST["auth_entry"])) {$auth_entry=$_POST["auth_entry"];} + elseif (isset($_POST["auth_entry"])) {$auth_entry=$_POST["auth_entry"];} + else {$auth_entry=0;} +if (isset($_GET["force_logout"])) {$force_logout=$_GET["force_logout"];} + elseif (isset($_POST["force_logout"])) {$force_logout=$_POST["force_logout"];} + else {$force_logout=0;} if (!isset($phone_login)) { if (isset($_GET["pl"])) {$phone_login=$_GET["pl"];} elseif (isset($_POST["pl"])) {$phone_login=$_POST["pl"];} + else {$phone_login="";} } if (!isset($phone_pass)) { if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];} elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];} + else {$phone_pass="";} } if (isset($VD_campaign)) { $VD_campaign = mb_strtoupper($VD_campaign,'utf-8'); $VD_campaign = preg_replace("/\s/i",'',$VD_campaign); } +else + { + $VD_campaign=""; + } if (!isset($flag_channels)) { $flag_channels=0; $flag_string=''; } -$DB=preg_replace("/[^0-9a-z]/","",$DB); -$VD_login = preg_replace('/[^-_0-9\p{L}]/u','',$VD_login); -$stage = preg_replace('/[^-_0-9\p{L}]/u','',$stage); -$rank = preg_replace('/[^-_0-9\p{L}]/u','',$rank); +# $DB=preg_replace("/[^0-9a-z]/","",$DB); +# $VD_login = preg_replace('/[^-_0-9\p{L}]/u','',$VD_login); +# $stage = preg_replace('/[^-_0-9\p{L}]/u','',$stage); +# $rank = preg_replace('/[^-_0-9\p{L}]/u','',$rank); $auth_entry = preg_replace('/[^-_0-9\p{L}]/u','',$auth_entry); $forever_stop=0; @@ -952,6 +982,8 @@ else exit; } if ($SSallow_web_debug < 1) {$DB=0;} +$DB=preg_replace("/[^0-9]/","",$DB); +$VD_login=preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$VD_login); $stmt="SELECT user,selected_language,force_change_password from vicidial_users where user='$VD_login';"; if ($DB) {echo "|$stmt|\n";} @@ -968,16 +1000,15 @@ if ($sl_ct > 0) ##### END SETTINGS LOOKUP ##### ########################################### -$VD_login=preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$VD_login); $VD_pass=preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$VD_pass); $VD_language = preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$VD_language); -$set_pass=preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$set_pass); +$set_pass=preg_replace("/[^0-9]/","",$set_pass); $new_pass1=preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$new_pass1); $new_pass2=preg_replace("/\<|\>|\'|\"|\\\\|;| /","",$new_pass2); -$JS_browser_width=preg_replace("/[^0-9a-z]/","",$JS_browser_width); -$JS_browser_height=preg_replace("/[^0-9a-z]/","",$JS_browser_height); -$relogin=preg_replace("/[^0-9a-zA-Z]/","",$relogin); -$MGR_override=preg_replace("/[^0-9a-zA-Z]/","",$MGR_override); +$JS_browser_width=preg_replace("/[^0-9]/","",$JS_browser_width); +$JS_browser_height=preg_replace("/[^0-9]/","",$JS_browser_height); +# $relogin=preg_replace("/[^0-9a-zA-Z]/","",$relogin); +$MGR_override=preg_replace("/[^0-9]/","",$MGR_override); if ($non_latin < 1) { @@ -995,6 +1026,9 @@ if ($non_latin < 1) $LOGINvarFOUR=preg_replace("/[^-_0-9a-zA-Z]/","",$LOGINvarFOUR); $LOGINvarFIVE=preg_replace("/[^-_0-9a-zA-Z]/","",$LOGINvarFIVE); $hide_relogin_fields=preg_replace("/[^-_0-9a-zA-Z]/","",$hide_relogin_fields); + $stage = preg_replace('/[^-_0-9a-zA-Z]/','',$stage); + $rank = preg_replace('/[^-_0-9a-zA-Z]/','',$rank); + $relogin=preg_replace("/[^0-9a-zA-Z]/","",$relogin); } else { @@ -1012,6 +1046,9 @@ else $LOGINvarFOUR=preg_replace("/[^-_0-9\p{L}]/u","",$LOGINvarFOUR); $LOGINvarFIVE=preg_replace("/[^-_0-9\p{L}]/u","",$LOGINvarFIVE); $hide_relogin_fields=preg_replace("/[^-_0-9\p{L}]/u","",$hide_relogin_fields); + $stage = preg_replace('/[^-_0-9\p{L}]/u','',$stage); + $rank = preg_replace('/[^-_0-9\p{L}]/u','',$rank); + $relogin=preg_replace("/[^0-9\p{L}]/u","",$relogin); } if ($force_logout) @@ -1085,6 +1122,7 @@ $SIDEBAR_COLOR = '#F6F6F6'; $window_validation = 0; # set to 1 to disallow direct logins to vicidial.php $win_valid_name = 'subwindow_launch'; # only window name to allow if validation enabled +$INSERT_before_body_close = ''; # inserted right above the line $INSERT_head_script = ''; # inserted right above the