Updates to agc scripts for PHP8
git-svn-id: svn://192.168.202.10@3971 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# DQ_dispo.php
|
||||
#
|
||||
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# abandon_check_queue.php
|
||||
#
|
||||
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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';";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# active_list_refresh.php version 2.12
|
||||
#
|
||||
# Copyright (C) 2025 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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 "<TABLE WIDTH=120 BGCOLOR=$bgcolor cellpadding=0 cellspacing=0>\n";}
|
||||
if ($format=='menu') {echo "<SELECT SIZE=1 name=\"$field_name\">\n";}
|
||||
@@ -376,6 +385,7 @@ if ($ADD==2)
|
||||
######################
|
||||
if ($ADD==3)
|
||||
{
|
||||
if (!isset($pt)) {$pt='pt';}
|
||||
if (!$field_name) {$field_name = 'trunk';}
|
||||
if ($format=='table') {echo "<TABLE WIDTH=120 BGCOLOR=$bgcolor cellpadding=0 cellspacing=0>\n";}
|
||||
if ($format=='menu') {echo "<SELECT SIZE=1 name=\"$field_name\">\n";}
|
||||
@@ -433,6 +443,7 @@ if ($ADD==3)
|
||||
######################
|
||||
if ($ADD==4)
|
||||
{
|
||||
if (!isset($pt)) {$pt='pt';}
|
||||
if (!$field_name) {$field_name = 'local';}
|
||||
if ($format=='table') {echo "<TABLE WIDTH=120 BGCOLOR=$bgcolor cellpadding=0 cellspacing=0>\n";}
|
||||
if ($format=='menu') {echo "<SELECT SIZE=1 name=\"$field_name\">\n";}
|
||||
@@ -548,7 +559,7 @@ $RUNtime = ($ENDtime - $StarTtime);
|
||||
if ($format=='table') {echo "\n<!-- script runtime: $RUNtime seconds -->";}
|
||||
if ($format=='table') {echo "\n</body>\n</html>\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;
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# agc_agent_manager_chat_interface.php
|
||||
#
|
||||
# Copyright (C) 2022 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This page is for agents to chat with managers via the agent interface.
|
||||
#
|
||||
@@ -20,10 +20,11 @@
|
||||
# 220220-0855 - Added allow_web_debug system setting
|
||||
# 220518-2210 - Small fix for encrypted auth
|
||||
# 220922-1027 - Added BLANK action for first agent screen page load
|
||||
# 260303-0714 - Code updates for PHP8 compatibility
|
||||
#
|
||||
|
||||
$admin_version = '2.14-13';
|
||||
$build = '220922-1027';
|
||||
$admin_version = '2.14-14';
|
||||
$build = '260303-0714';
|
||||
$php_script = 'agc_agent_manager_chat_interface.php';
|
||||
|
||||
$sh="managerchats";
|
||||
@@ -35,19 +36,20 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["action"])) {$action=$_GET["action"];}
|
||||
elseif (isset($_POST["action"])) {$action=$_POST["action"];}
|
||||
else {$action="";}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
else {$SUBMIT="";}
|
||||
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["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"];}
|
||||
if (!$user) {echo "Page should only be viewed through the agent interface."; die;}
|
||||
|
||||
$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
|
||||
$user=preg_replace("/\'|\"|\\\\|;| /","",$user);
|
||||
$pass=preg_replace("/\'|\"|\\\\|;| /","",$pass);
|
||||
else {$pass="";}
|
||||
# if (!$user) {echo "Page should only be viewed through the agent interface."; die;}
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
@@ -68,10 +70,13 @@ 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 #####
|
||||
###########################################
|
||||
|
||||
$user=preg_replace("/\'|\"|\\\\|;| /","",$user);
|
||||
$pass=preg_replace("/\'|\"|\\\\|;| /","",$pass);
|
||||
$action = preg_replace('/[^-\_0-9a-zA-Z]/','',$action);
|
||||
$SUBMIT = preg_replace('/[^-\_0-9a-zA-Z]/','',$SUBMIT);
|
||||
|
||||
@@ -88,6 +93,8 @@ else
|
||||
$manager_chat_id = preg_replace("/[^- \_\.0-9\p{L}]/u","",$user);
|
||||
}
|
||||
|
||||
$manager_chat_refresh_seconds=1;
|
||||
|
||||
# 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'))
|
||||
@@ -153,6 +160,7 @@ $chat_start_date_array=array();
|
||||
$agents_managers_array=array(); // for override
|
||||
$priority_chat="";
|
||||
$priority_chat_subid="";
|
||||
$agent_manager_override="0";
|
||||
while ($row=mysqli_fetch_row($rslt)) {
|
||||
if ($row[0]!="") {
|
||||
if (!$priority_chat) {$priority_chat=$row[0];} # The priority_chat is the most recent chat that has not been viewed.
|
||||
@@ -750,8 +758,8 @@ function MgrAgentAutoRefresh() {
|
||||
echo "<form name='agent_manager_chat_form' id='agent_manager_chat_form'>";
|
||||
echo "<table width='620' border='0' cellpadding='5' cellspacing='0'>";
|
||||
echo "<TR BGCOLOR='#E6E6E6'>\n";
|
||||
echo "<td align='left' width='190' valign='top'><font class='arial'>"._QXZ("Chatting with").": </font><BR><span class='arial_bold' id='ActiveChatManager'>".$chat_managers_array[$priority_chat]."</span></td>";
|
||||
echo "<td align='right' width='190' valign='top'><font class='arial'>"._QXZ("Chat started").": </font><BR><span class='arial_bold' id='ActiveChatStartDate'>".$chat_start_date_array[$priority_chat]."</span></td>";
|
||||
echo "<td align='left' width='190' valign='top'><font class='arial'>"._QXZ("Chatting with").": </font><BR><span class='arial_bold' id='ActiveChatManager'>".(isset($chat_managers_array[$priority_chat]) ? $chat_managers_array[$priority_chat] : "")."</span></td>";
|
||||
echo "<td align='right' width='190' valign='top'><font class='arial'>"._QXZ("Chat started").": </font><BR><span class='arial_bold' id='ActiveChatStartDate'>".(isset($chat_start_date_array[$priority_chat]) ? $chat_start_date_array[$priority_chat] : "")."</span></td>";
|
||||
echo "<td align='left' width='*' valign='bottom'><font class='arial'>"._QXZ("Your active chats").":</font></td>";
|
||||
echo "</TR>";
|
||||
|
||||
@@ -765,6 +773,7 @@ echo "</TD>\n";
|
||||
echo "<TD align='left' rowspan='2' valign='top' width='210'>\n";
|
||||
echo "<div class='scrolling_chat_display' id='AllActiveChats'>\n";
|
||||
echo "<ul class='chatview'>";
|
||||
$sid=0;
|
||||
if (empty($chat_managers_array)) {
|
||||
echo "\t<li class='arial_bold'>"._QXZ("NO OPEN CHATS")."</li>\n";
|
||||
} else {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# alt_display.php
|
||||
#
|
||||
# Copyright (C) 2024 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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)
|
||||
|
||||
+104
-14
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# api.php
|
||||
#
|
||||
# Copyright (C) 2025 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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."<BR>\n";}
|
||||
if ($DB) {echo $confetti_stmt."<BR>\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';}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# astguiclient.php - the web-based version of the astGUIclient client application
|
||||
#
|
||||
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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,20 +88,31 @@ 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))
|
||||
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($phone_pass))
|
||||
{
|
||||
if (isset($_GET["pp"])) {$phone_pass=$_GET["pp"];}
|
||||
elseif (isset($_POST["pp"])) {$phone_pass=$_POST["pp"];}
|
||||
@@ -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';";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# call_log_display.php version 2.14
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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</body>\n</html>\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;
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# chat_db_query.php
|
||||
#
|
||||
# Copyright (C) 2022 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Joe Johnson, Matt Florell <vicidial@gmail.com> 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<BR>\n";}
|
||||
if ($DB) {echo "$stmt<BR>\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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# conf_exten_check.php version 2.14
|
||||
#
|
||||
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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,6 +812,7 @@ 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);
|
||||
@@ -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];
|
||||
if (isset($click_data[1]))
|
||||
{
|
||||
$click_function_data = explode('---',$click_data[1]);
|
||||
$click_function = $click_function_data[0];
|
||||
$click_options = $click_function_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);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# deactivate_lead.php
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# dispo_add_FPG.php
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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";}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# dispo_change_status.php
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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='';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# dispo_list_quota.php
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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";}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# dispo_move_list.php
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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';";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# dispo_move_list_SC.php
|
||||
#
|
||||
# Copyright (C) 2025 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# dispo_reset_lead.php
|
||||
#
|
||||
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# dispo_send_email.php
|
||||
#
|
||||
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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,8 +649,6 @@ if ($match_found > 0)
|
||||
}
|
||||
}
|
||||
|
||||
if ( (preg_match('/--A--did_/i',$email_subject)) or (preg_match('/--A--did_/i',$email_body)) )
|
||||
{
|
||||
$DID_id='';
|
||||
$DID_extension='';
|
||||
$DID_pattern='';
|
||||
@@ -558,7 +659,8 @@ if ($match_found > 0)
|
||||
$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)) )
|
||||
{
|
||||
$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)
|
||||
}
|
||||
}
|
||||
|
||||
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='';
|
||||
|
||||
$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)) )
|
||||
{
|
||||
$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';";
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
# functions for agent scripts
|
||||
#
|
||||
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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='';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# inbound_popup.php version 2.14
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# launch.php - launches vicidial.php in restricted window
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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';
|
||||
@@ -25,31 +26,34 @@ 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"];}
|
||||
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"];}
|
||||
else {$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"];}
|
||||
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"];}
|
||||
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"];}
|
||||
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";}
|
||||
?>
|
||||
|
||||
<html>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# live_exten_check.php version 2.14
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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</body>\n</html>\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;
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# manager_send.php version 2.14
|
||||
#
|
||||
# Copyright (C) 2025 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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<!-- $stmt -->";}
|
||||
@@ -3298,6 +3369,9 @@ if ($ACTION=="VolumeControl")
|
||||
if (preg_match('/MUTING/i',$stage)) {$vol_prefix='1';}
|
||||
$local_DEF = 'Local/';
|
||||
$local_AMP = '@';
|
||||
|
||||
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');";
|
||||
@@ -3306,6 +3380,11 @@ if ($ACTION=="VolumeControl")
|
||||
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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# park_calls_display.php version 2.14
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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</body>\n</html>\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;
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# phone_only.php - the web-based web-phone-only client application
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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"];}
|
||||
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;
|
||||
|
||||
@@ -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();
|
||||
?>
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# timeclock.php - VICIDIAL system user timeclock
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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')
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# update_cf_ivr.php
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# vdc_chat_display.php
|
||||
#
|
||||
# Copyright (C) 2023 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Joe Johnson, Matt Florell <vicidial@gmail.com> 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) {
|
||||
}
|
||||
?>
|
||||
<body onLoad="<?php echo $autojoin_js_fx; ?>" onUnload="javascript:clearInterval(rInt); LeaveChat();">
|
||||
<?php echo "<!-- $user_stmt\n vdc_chat_display.php?user=$user&pass=$pass&lead_id=$lead_id&list_id=$list_id&email=$email&chat_id=$chat_id -->\n"; ?>
|
||||
<?php
|
||||
echo "<!-- ";
|
||||
if ($DB)
|
||||
{
|
||||
echo "$user_stmt\n";
|
||||
echo "$chat_stmt\n";
|
||||
echo "$stmt\n";
|
||||
}
|
||||
echo "vdc_chat_display.php?user=$user&pass=$pass&lead_id=$lead_id&email=$email&chat_id=$chat_id -->\n";
|
||||
?>
|
||||
<form name='chat_form' action='<?php echo $PHP_SELF; ?>'>
|
||||
<table width='100%' border='0'>
|
||||
<tr>
|
||||
@@ -976,7 +1011,7 @@ echo ($customer_chat_refresh_seconds!=1 ? "<center><font class='chat_timestamp b
|
||||
}
|
||||
echo "</select>\n";
|
||||
}
|
||||
if ($chat_creator && $chat_creator==$user) {
|
||||
if (isset($chat_creator) && $chat_creator==$user) {
|
||||
if (!$email_invite_lead_id) { # Flag from sending an invite - this page reloads as a result and this below INVITE button must be prevented from being loaded
|
||||
echo "<BR/><BR/><input class='blue_btn' type='button' style=\"width:150px\" value=\""._QXZ("INVITE")."\" onClick=\"javascript:document.getElementById('email_window').style.display='block'\">";
|
||||
}
|
||||
@@ -1005,7 +1040,7 @@ echo ($customer_chat_refresh_seconds!=1 ? "<center><font class='chat_timestamp b
|
||||
<input type='hidden' id='user' name='user' value='<?php echo $user; ?>'>
|
||||
<input type='hidden' id='chat_id' name='chat_id' value='<?php echo $chat_id; ?>'>
|
||||
<input type='hidden' id='chat_group_id' name='chat_group_id' value='<?php echo $chat_group_id; ?>'>
|
||||
<input type='hidden' id='chat_creator' name='chat_creator' value='<?php echo $chat_creator; ?>'>
|
||||
<input type='hidden' id='chat_creator' name='chat_creator' value='<?php echo (isset($chat_creator) ? $chat_creator : ""); ?>'>
|
||||
<input type='hidden' id='live_message_count_field' name='live_message_count_field' value='0'>
|
||||
<input type='hidden' id='pass' name='pass' value='<?php echo $pass; ?>'>
|
||||
<input type='hidden' id='lead_id' name='lead_id' value='<?php echo $lead_id; ?>'>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# vdc_email_display.php - VICIDIAL agent email display script
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell, Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell, Joe Johnson <vicidial@gmail.com> 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"];
|
||||
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'];
|
||||
$attachment2=$_FILES["attachment2"];
|
||||
}
|
||||
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'];
|
||||
$attachment3=$_FILES["attachment3"];
|
||||
}
|
||||
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'];
|
||||
$attachment4=$_FILES["attachment4"];
|
||||
}
|
||||
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'];
|
||||
$attachment5=$_FILES["attachment5"];
|
||||
}
|
||||
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="<center><TABLE cellspacing=2 cellpadding=2 bgcolor='#CCCCCC' width='500'>\n";
|
||||
$EMAIL_form.="<center><TABLE cellspacing=2 cellpadding=2 bgcolor='#CCCCCC' width='500'>\n";
|
||||
$EMAIL_form.="<tr bgcolor=white><td align='right' valign='top' width='150'>"._QXZ("Date received:")."</td><td align='left' valign='top' width='*'>$row[email_date]</td></tr>\n";
|
||||
$EMAIL_form.="<tr bgcolor=white><td align='right' valign='top' width='150'>"._QXZ("From:")."</td><td align='left' valign='top' width='*'>$row[email_from]</td></tr>\n";
|
||||
$EMAIL_form.="<tr bgcolor=white><td align='right' valign='top' width='150'>"._QXZ("Subject:")."</td><td align='left' valign='top' width='*'>$row[subject]</td></tr>\n";
|
||||
@@ -397,6 +442,7 @@ if ( ($lead_id) or (strlen($email_row_id)>0) )
|
||||
function CopyMessage()
|
||||
{
|
||||
<?php
|
||||
if (!isset($row["message"])) {$row["message"]="";}
|
||||
$row["message"]=preg_replace('/\r|\n/', ' ', $row["message"]);
|
||||
echo "var message=\"".preg_replace('/\"/', '\\\"', $row["message"])."\";\n";
|
||||
?>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# vdc_form_display.php
|
||||
#
|
||||
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# vdc_script_display.php
|
||||
#
|
||||
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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);
|
||||
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 "<!-- IFRAME$IFRAME -->\n";
|
||||
echo "<!-- $script_id -->\n";
|
||||
# echo "<!-- $script_id -->\n"; # Never used
|
||||
if ( ( ($IFRAME < 1) and ($ScrollDIV > 0) ) or (preg_match("/IGNORENOSCROLL/i",$script_text)) )
|
||||
{
|
||||
echo "<TABLE WIDTH=$script_width border=0><TR><TD>";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# vdc_script_dispo_example.php
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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 "<BR>$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<BR>";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# vdc_script_notes.php
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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)
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# vdc_soundboard_display.php
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> 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;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
@@ -773,76 +774,105 @@ 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"];}
|
||||
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["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"];}
|
||||
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"];}
|
||||
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"];}
|
||||
else {$relogin="";}
|
||||
if (isset($_GET["MGR_override"])) {$MGR_override=$_GET["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"];}
|
||||
else {$admin_test="";}
|
||||
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["hide_relogin_fields"])) {$hide_relogin_fields=$_GET["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"];}
|
||||
else {$set_pass=0;}
|
||||
if (isset($_GET["new_pass1"])) {$new_pass1=$_GET["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"];}
|
||||
else {$new_pass2="";}
|
||||
if (isset($_GET["stage"])) {$stage=$_GET["stage"];}
|
||||
elseif (isset($_POST["stage"])) {$stage=$_POST["stage"];}
|
||||
else {$stage="";}
|
||||
if (isset($_GET["rank"])) {$rank=$_GET["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"];}
|
||||
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 </body> line
|
||||
$INSERT_head_script = ''; # inserted right above the <script language="Javascript"> line after logging in
|
||||
$INSERT_head_js = ''; # inserted after first javascript function
|
||||
$INSERT_first_onload = ''; # inserted at the beginning of the first section of the onload function
|
||||
@@ -1109,6 +1147,7 @@ $SSstd_row5_background='FFFFFF';
|
||||
$SSalt_row1_background='BDFFBD';
|
||||
$SSalt_row2_background='99FF99';
|
||||
$SSalt_row3_background='CCFFCC';
|
||||
$SSweb_logo='default_new';
|
||||
|
||||
$browser_alert_sounds_list = 'bark_dog,beep_double,beep_five,beep_up,bell_double,bell_school,bird,blaster1,blaster2,buzz1,buzz2,cash_register,chat_alert,click_single,click_double,click_quiet,close_encounter,confirmation,ding,droplet,droplet_double,elephant,email_alert,hold_tone,horn_bike,horn_car,horn_car_triple,horn_clown,horn_double,horn_train,meow_cat,scream_wilhelm,silence_quick,siren,slide_down,slide_up,swish,teleport1,teleport2,ticking_two,ticking_four,ticking_six,whip,whistle_up,whistle_two,whistle_three,whoosh,xylophone1,xylophone2,xylophone3,xylophone4,20Hz_tone';
|
||||
|
||||
@@ -2662,9 +2701,18 @@ else
|
||||
$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;
|
||||
$agent_status_view_time=0;
|
||||
$agent_call_log_view = 0;
|
||||
$agent_xfer_park_3way = 0;
|
||||
$agent_xfer_consultative = 0;
|
||||
$agent_xfer_dial_override = 0;
|
||||
$agent_xfer_vm_transfer = 0;
|
||||
$agent_xfer_blind_transfer = 0;
|
||||
$agent_xfer_dial_with_customer = 0;
|
||||
$agent_xfer_park_customer_dial = 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')
|
||||
@@ -3027,6 +3075,10 @@ else
|
||||
$cVARMAXstatuses='';
|
||||
$cVARCBstatusesLIST='';
|
||||
$cVARSALEstatusesLIST='';
|
||||
$HKhotkeys='';
|
||||
$HKstatuses='';
|
||||
$HKstatusnames='';
|
||||
|
||||
##### grab the statuses that can be used for dispositioning by an agent for all calls
|
||||
$stmt="SELECT status,status_name,scheduled_callback,selectable,min_sec,max_sec,sale FROM vicidial_statuses WHERE status != 'NEW' order by status limit 500;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
@@ -3049,7 +3101,7 @@ else
|
||||
$VARstatusnames = "$VARstatusnames'$status_names[$i]',";
|
||||
$VARSELstatuses = "$VARSELstatuses'$SELstatuses[$i]',";
|
||||
$VARCBstatuses = "$VARCBstatuses'$CBstatuses[$i]',";
|
||||
$VARSALEstatuses = "$VARSALEtatuses'$SALEstatuses[$i]',";
|
||||
$VARSALEstatuses = "$VARSALEstatuses'$SALEstatuses[$i]',";
|
||||
$VARMINstatuses = "$VARMINstatuses'$MINsec[$i]',";
|
||||
$VARMAXstatuses = "$VARMAXstatuses'$MAXsec[$i]',";
|
||||
if ($CBstatuses[$i] == 'Y')
|
||||
@@ -3392,6 +3444,34 @@ else
|
||||
$stereo_recording_agent = $row[199];
|
||||
$recording_dtmf_muting = $row[200];
|
||||
|
||||
## misc variables that may or may not be assigned below, must be declared here to prevent undefined warnings
|
||||
$VARcaller_id_numbers='';
|
||||
$VD_group_aliases_ct=0;
|
||||
$VARpause_codes='';
|
||||
$VARpause_code_names='';
|
||||
$VARpause_code_mgrapr='';
|
||||
$VD_pause_codes_ct=0;
|
||||
$VARdialingroups='';
|
||||
$dialINgrpCT=0;
|
||||
$territoryCT=0;
|
||||
$default_xfer_group_name='';
|
||||
$allow_recording_mute='';
|
||||
$QM_LOGIN = '';
|
||||
$QM_PHONE = '';
|
||||
$PMEcontainer_entry = '';
|
||||
$leave_vm_message_group_exists=0;
|
||||
$mgrapr_ct=0;
|
||||
$queuemetrics_pe_phone_append='';
|
||||
$VARphonegroupsURL='';
|
||||
$VARchatgroupsURL='';
|
||||
$VARxfergroupsnames='';
|
||||
$VARxfergroupstalkminsec='';
|
||||
$scheduled_callbacks=0;
|
||||
$api_check_all_pause=0;
|
||||
$VARgroup_alias_ids='';
|
||||
$VARgroup_alias_names='';
|
||||
$stereo_rec_filename='';
|
||||
|
||||
if ( (!preg_match("/DISABLED/",$VU_manual_dial_lead_id)) and (strlen($VU_manual_dial_lead_id) > 0) )
|
||||
{
|
||||
echo "<!-- manual_dial_lead_id user override: |$manual_dial_lead_id($VU_manual_dial_lead_id)| -->\n";
|
||||
@@ -3827,6 +3907,7 @@ else
|
||||
$VARpreset_numbers='';
|
||||
$VARpreset_dtmfs='';
|
||||
$VARpreset_hide_numbers='';
|
||||
$VD_preset_names_ct=0;
|
||||
if ($enable_xfer_presets == 'ENABLED')
|
||||
{
|
||||
##### grab the presets for this campaign
|
||||
@@ -3978,6 +4059,14 @@ else
|
||||
$VARphonegroups="''";
|
||||
$VARemailgroups="''";
|
||||
$VARchatgroups="''";
|
||||
$VARdialingroups='';
|
||||
$INgrpCT=0;
|
||||
$EMAILgrpCT=0;
|
||||
$CHATgrpCT=0;
|
||||
$PHONEgrpCT=0;
|
||||
$dialINgrpCT=0;
|
||||
$territoryCT=0;
|
||||
|
||||
if ( ($campaign_allow_inbound == 'Y') and ($dial_method != 'MANUAL') )
|
||||
{
|
||||
### validate that the agent has not exceeded their max inbound calls for today
|
||||
@@ -4039,10 +4128,7 @@ else
|
||||
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;
|
||||
$VARphonegroupsURL='';
|
||||
while ($INgrpCT < $closer_ct)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
@@ -4086,13 +4172,11 @@ else
|
||||
|
||||
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) and group_id NOT IN($VD_hit_limit_ingroups) 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);
|
||||
@@ -4104,13 +4188,11 @@ else
|
||||
}
|
||||
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---','$VU_user_group') and group_id NOT IN($VD_hit_limit_ingroups) 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);
|
||||
@@ -4132,7 +4214,6 @@ else
|
||||
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);
|
||||
@@ -4277,7 +4358,7 @@ else
|
||||
echo "<input type=\"hidden\" name=\"LOGINvarFOUR\" id=\"LOGINvarFOUR\" value=\"$LOGINvarFOUR\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"LOGINvarFIVE\" id=\"LOGINvarFIVE\" value=\"$LOGINvarFIVE\" />\n";
|
||||
echo "<input type=\"hidden\" name=\"hide_relogin_fields\" id=\"hide_relogin_fields\" value=\"$hide_relogin_fields\" />\n";
|
||||
echo "<center><br /><b>$VDdisplayMESSAGE</b><br /><br />";
|
||||
echo "<center><br /><b>".(isset($VDdisplayMESSAGE) ? $VDdisplayMESSAGE : "")."</b><br /><br />";
|
||||
echo "<table width=\"460px\" cellpadding=\"3\" cellspacing=\"0\" bgcolor=\"#$SSframe_background\"><tr bgcolor=\"white\">";
|
||||
echo "<td align=\"left\" valign=\"bottom\" bgcolor=\"#$SSmenu_background\" width=\"170\"><img src=\"$selected_logo\" border=\"0\" height=\"45\" width=\"170\" alt=\"Agent Screen\" /></td>";
|
||||
echo "<td align=\"center\" valign=\"middle\" bgcolor=\"#$SSmenu_background\"> <font class=\"sh_text_white\">"._QXZ("Campaign Login")."</font> </td>";
|
||||
@@ -4852,12 +4933,12 @@ else
|
||||
if ($row[0] > 0)
|
||||
{
|
||||
$stmt="UPDATE $conf_table 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<!-- $stmt -->";}
|
||||
if (isset($format) && $format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$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 $conf_table where server_ip='$server_ip' and ( (extension='$SIP_user') or (extension='$VD_login') );";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
if (isset($format) && $format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$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);
|
||||
@@ -5227,9 +5308,9 @@ else
|
||||
echo "<!-- new vicidial_live_agents record inserted: |$affected_rows| -->\n";
|
||||
|
||||
$stmt="INSERT IGNORE INTO vicidial_live_agents_details set latency='0',web_ip='$ip',update_date=NOW(),user='$VD_login';";
|
||||
if ($format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
if (isset($format) && $format=='debug') {echo "\n<!-- $stmt -->";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03103',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
if ($mel > 0) {$errno = mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03103',$VD_login,$server_ip,$session_name,$one_mysql_log);}
|
||||
|
||||
if ($enable_queuemetrics_logging > 0)
|
||||
{
|
||||
@@ -5532,6 +5613,9 @@ else
|
||||
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);
|
||||
$MMscriptids='';
|
||||
$MMscriptnames='';
|
||||
$MMscriptcolors='';
|
||||
$e=0;
|
||||
while ($e < $MM_scripts)
|
||||
{
|
||||
@@ -9587,7 +9671,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
if (xmlhttpXF)
|
||||
{
|
||||
var redirectvalue = MDchannel;
|
||||
redirectserverip = lastcustserverip;
|
||||
var redirectserverip = lastcustserverip;
|
||||
if (redirectvalue.length < 2)
|
||||
{redirectvalue = lastcustchannel}
|
||||
if ( (taskvar == 'XfeRBLIND') || (taskvar == 'XfeRVMAIL') )
|
||||
@@ -10008,7 +10092,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
|
||||
if (xmlhttpXF)
|
||||
{
|
||||
var redirectvalue = MDchannel;
|
||||
redirectserverip = lastcustserverip;
|
||||
var redirectserverip = lastcustserverip;
|
||||
var queryCID='';
|
||||
var exten='';
|
||||
var ext_context='';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# vicidial_redirect.php - forwards agents to another URL for vicidial.php login
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGELOG
|
||||
# 71202-1546 - First Build
|
||||
@@ -10,6 +10,7 @@
|
||||
# 141216-2131 - Added language settings lookups and user/pass variable standardization
|
||||
# 210823-1004 - Fix for security issue
|
||||
# 220220-0924 - Added allow_web_debug system setting
|
||||
# 260302-1406 - Code updates for PHP8 compatibility
|
||||
#
|
||||
|
||||
require_once("functions.php");
|
||||
@@ -23,33 +24,30 @@ 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["relogin"])) {$relogin=$_GET["relogin"];}
|
||||
elseif (isset($_POST["relogin"])) {$relogin=$_POST["relogin"];}
|
||||
else {$relogin="";}
|
||||
|
||||
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="";}
|
||||
}
|
||||
|
||||
$DB = preg_replace('/[^-\._0-9\p{L}]/u',"",$DB);
|
||||
$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);
|
||||
$relogin = preg_replace('/[^-\._0-9\p{L}]/u',"",$relogin);
|
||||
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS AND USER LANGUAGE LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,admin_home_url,admin_web_directory,enable_languages,language_method,allow_web_debug FROM system_settings;";
|
||||
@@ -67,7 +65,27 @@ 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);
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$phone_login = preg_replace('/[^-\._0-9a-zA-Z]/',"",$phone_login);
|
||||
$phone_pass = preg_replace('/[^-\._0-9a-zA-Z]/',"",$phone_pass);
|
||||
$VD_login = preg_replace('/[^-\._0-9a-zA-Z]/',"",$VD_login);
|
||||
$VD_pass = preg_replace('/[^-\._0-9a-zA-Z]/',"",$VD_pass);
|
||||
$VD_campaign = preg_replace('/[^-\._0-9a-zA-Z]/',"",$VD_campaign);
|
||||
$relogin = preg_replace('/[^-\._0-9a-zA-Z]/',"",$relogin);
|
||||
}
|
||||
else
|
||||
{
|
||||
$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);
|
||||
$relogin = preg_replace('/[^-\._0-9\p{L}]/u',"",$relogin);
|
||||
}
|
||||
|
||||
$VUselected_language = '';
|
||||
$stmt="SELECT selected_language from vicidial_users where user='$VD_login';";
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
# voicemail_check.php version 2.14
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# This script is designed purely to check whether the voicemail box on the server defined has new and old messages
|
||||
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
|
||||
@@ -34,10 +34,11 @@
|
||||
# 210616-2109 - Added optional CORS support, see options.php for details
|
||||
# 210825-0910 - Fix for XSS security issue
|
||||
# 220220-0855 - Added allow_web_debug system setting
|
||||
# 260302-1150 - Code updates for PHP8 compatibility
|
||||
#
|
||||
|
||||
$version = '2.14-17';
|
||||
$build = '220220-0855';
|
||||
$version = '2.14-18';
|
||||
$build = '260302-1150';
|
||||
$php_script = 'voicemail_check.php';
|
||||
$SSagent_debug_logging=0;
|
||||
$startMS = microtime();
|
||||
@@ -48,16 +49,21 @@ 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["vmail_box"])) {$vmail_box=$_GET["vmail_box"];}
|
||||
elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];}
|
||||
else {$vmail_box="";}
|
||||
|
||||
$user=preg_replace("/\'|\"|\\\\|;| /","",$user);
|
||||
$pass=preg_replace("/\'|\"|\\\\|;| /","",$pass);
|
||||
@@ -68,7 +74,8 @@ if (!isset($format)) {$format="text";}
|
||||
$StarTtime = date("U");
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
# 3/28/25 - Removed, never used
|
||||
# if (!isset($query_date)) {$query_date = $NOW_DATE;}
|
||||
|
||||
# if options file exists, use the override values for the above variables
|
||||
# see the options-example.php file for more information
|
||||
@@ -105,24 +112,33 @@ 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;}
|
||||
$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);
|
||||
$vmail_box = preg_replace('/[^-_0-9\p{L}]/u',"",$vmail_box);
|
||||
$format = preg_replace('/[^-_0-9a-zA-Z]/','',$format);
|
||||
# $session_name = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$session_name);
|
||||
# $server_ip = preg_replace('/[^-\.\:\_0-9a-zA-Z]/','',$server_ip);
|
||||
# $vmail_box = preg_replace('/[^-_0-9\p{L}]/u',"",$vmail_box);
|
||||
# $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);
|
||||
$vmail_box = preg_replace('/[^-_0-9a-zA-Z]/',"",$vmail_box);
|
||||
$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);
|
||||
$vmail_box = preg_replace('/[^-_0-9\p{L}]/u',"",$vmail_box);
|
||||
$format = preg_replace('/[^-_0-9\p{L}]/u','',$format);
|
||||
}
|
||||
|
||||
$auth=0;
|
||||
@@ -212,7 +228,7 @@ if ($format=='debug')
|
||||
echo "\n</body>\n</html>\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;
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# version: 20260128083701
|
||||
# version: 20260304093901
|
||||
users-user User ID <QXZ>This field is where you put the users ID number, can be up to 20 digits in length, Must be at least 2 characters in length. We strongly recommend not reusing user accounts for different users, for reporting accuracy. To disable a user account, set the Active option to -N-.</QXZ>
|
||||
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length, unless the User Password Minimum Length system setting is enabled, which will require a longer password. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ>
|
||||
users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N.</QXZ>
|
||||
@@ -699,7 +699,7 @@ inbound_groups-waiting_call_url_on Waiting Call URL On <QXZ>This feature allows
|
||||
inbound_groups-add_lead_url Add Lead URL <QXZ>This web URL address is not seen by the agent, but it is called every time a lead is added to the system through the inbound process. Default is blank. You must begin this URL with VAR if you want to use variables, and of course --A-- and --B-- around the actual variable in the URL where you want to use it. Here is the list of variables that are available for this function. lead_id, vendor_lead_code, list_id, phone_number, phone_code, did_id, did_extension, did_pattern, did_description, uniqueid</QXZ>
|
||||
inbound_groups-add_lead_timezone Add Lead Timezone <QXZ>This is the method that the system will use to determine the current timezone when a lead is created when a call is being routed through this in-group. SERVER will use the current timezone of the server. PHONE_CODE_AREACODE will look up the timezone based on the phone code set in the lead and the areacode of the phone number. Default is SERVER.</QXZ>
|
||||
inbound_groups-default_group_alias Default Group Alias <QXZ>If you have allowed Group Aliases for the campaign that the agent is logged into then this is the group alias that is selected first by default on a call coming in from this inbound group when the agent chooses to use a Group Alias for an outbound manual call. Default is NONE or empty.</QXZ>
|
||||
inbound_groups-xfer_talk_minimum Transfer Talk Minimum <QXZ>If this option is enabled, and the Transfer Talk Minimum Second field below is greater than 0, then agents using the agent screen will only be able to transfer calls to this In-Group if they have been talking to the customer for at least that number of seconds. Default is DISABLED. You can change the default message that the agent receives when this happens using the Transfer Talk Minimum Container system setting.</QXZ>
|
||||
inbound_groups-xfer_talk_minimum Transfer Talk Minimum <QXZ>If this option is enabled, and the Transfer Talk Minimum Seconds field below is greater than 0, then agents using the agent screen will only be able to transfer calls to this In-Group if they have been talking to the customer for at least that number of seconds. Default is DISABLED. You can change the default message that the agent receives when this happens using the Transfer Talk Minimum Container system setting.</QXZ>
|
||||
inbound_groups-xfer_talk_minimum_sec Transfer Talk Minimum Seconds <QXZ>If this option is greater than 0, and the Transfer Talk Minimum field above is enabled, then agents using the agent screen will only be able to transfer calls to this In-Group if they have been talking to the customer for at least this number of seconds. Default is 0. You can change the default message that the agent receives when this happens using the Transfer Talk Minimum Container system setting.</QXZ>
|
||||
inbound_groups-dial_ingroup_cid Dial In-Group CID <QXZ>If the agent campaign allows for Manual In-Group Dialing, this caller ID number will be sent as the outgoing CID of the phone call if it is populated, overriding the campaign settings and list CID override setting. Default is empty.</QXZ>
|
||||
inbound_groups-extension_appended_cidname Extension Append CID <QXZ>If enabled, the calls coming in from this in-group will have a space and the phone extension of the agent appended to the end of the CallerID name for the call before it is sent to the agent. Default is N for disabled. If USER is part of the option, then the user ID will be used instead of the phone extension. If WITH_CAMPAIGN is used, then another space and the campaign ID will be included as well.</QXZ>
|
||||
|
||||
Reference in New Issue
Block a user