diff --git a/UPGRADE b/UPGRADE
index 543abd36..af5dd726 100644
--- a/UPGRADE
+++ b/UPGRADE
@@ -170,6 +170,11 @@ OTHER CHANGES:
35. Added System Settings option to disable Add/Copy admin functions for level
8 users.
+36. Added ability to use .agi scripts in Call Menu prompt. Also added
+ cm_date.agi script to say date with options
+
+37. Converted ereg to preg in the agc agent interface PHP scripts
+
diff --git a/bin/ADMIN_keepalive_ALL.pl b/bin/ADMIN_keepalive_ALL.pl
index 99cc8038..6a2fec77 100644
--- a/bin/ADMIN_keepalive_ALL.pl
+++ b/bin/ADMIN_keepalive_ALL.pl
@@ -80,6 +80,7 @@
# 130103-0808 - Added CLI options for delay to be used with auto-dial and FILL processes
# 130108-1657 - Changes for Asterisk 1.8 compatibility
# 130227-1605 - Added --fill-staggered option for the AST_VDauto_dialFILL script
+# 130326-1754 - Added ability to use .agi scripts as part of Call Menu Prompt
#
$DB=0; # Debug flag
@@ -2494,12 +2495,31 @@ if ( ($active_asterisk_server =~ /Y/) && ($generate_vicidial_conf =~ /Y/) && ($r
foreach(@menu_prompts_array)
{
if (length($menu_prompts_array[$w])>0)
- {$menu_prompt_ext .= "exten => s,n,Background($menu_prompts_array[$w])\n";}
+ {
+ if ($menu_prompts_array[$w] =~ /\.agi/)
+ {
+ $menu_prompt_ext .= "exten => s,n,AGI($menu_prompts_array[$w])\n";
+ }
+ else
+ {
+ $menu_prompt_ext .= "exten => s,n,Background($menu_prompts_array[$w])\n";
+ }
+ }
$w++;
}
}
else
- {$menu_prompt_ext .= "exten => s,n,Background($menu_prompt[$i])\n";}
+ {
+ if ($menu_prompt[$i] =~ /\.agi/)
+ {
+ $menu_prompt_ext .= "exten => s,n,AGI($menu_prompt[$i])\n";
+ }
+ else
+ {
+ $menu_prompt_ext .= "exten => s,n,Background($menu_prompt[$i])\n";
+ }
+ }
+
if ($time_check_route =~ /AGI/)
{
diff --git a/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt b/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt
index 5cd1593c..b3a2f543 100644
--- a/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt
+++ b/translations/raw_translation_files/TO_BE_TRANSLATED_2.6.txt
@@ -183,6 +183,7 @@ If CPD AMD Action is set to CALLMENU, then this is the Call Menu that the call w
Level 8 Disable Add||
This setting if enabled will prevent any level 8 user from adding or copying any record in the system, no matter what their user settings are. Excluded from these restrictions are the ability to add DNC and Filter Phone Groups numbers and the Add a New Lead page. Default is 0 for disabled||
You do not have permission to add records on this system||
+These options allows you to limit the viewable callbacks in the agent callback alert section on the agent screen, to only LIVE callbacks. LIVE callbacks are user-only scheduled callbacks that have hit their trigger date and time. ACTIVE call backs are user-only callbacks that are active in the system but have not yet triggered. You can view both ACTIVE and LIVE callbacks by selecting ALL_ACTIVE. Default is ALL_ACTIVE||
############################################################ CLIENT
diff --git a/www/agc/SCRIPT_busy_button.php b/www/agc/SCRIPT_busy_button.php
index d9eba430..82614649 100644
--- a/www/agc/SCRIPT_busy_button.php
+++ b/www/agc/SCRIPT_busy_button.php
@@ -5,7 +5,7 @@
#
#
#
-# Copyright (C) 2009 Matt Florell LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
########## DB SCHEMA
# CREATE TABLE qr_busy_button_log (
@@ -25,6 +25,7 @@
# CHANGES:
# 90408-0618 - First Build
# 90508-0727 - Changed to PHP long tags
+# 130328-0026 - Converted ereg to preg functions
#
if (isset($_GET["button_id"])) {$button_id=$_GET["button_id"];}
@@ -47,19 +48,19 @@ if (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];}
elseif (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];}
### security strip all non-alphanumeric characters out of the variables ###
-$button_id=ereg_replace("[^0-9]","",$button_id);
-$lead_id=ereg_replace("[^0-9]","",$lead_id);
-$list_id=ereg_replace("[^0-9]","",$list_id);
-$phone_number=ereg_replace("[^0-9]","",$phone_number);
-$vendor_id = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$vendor_id);
-$user=ereg_replace("[^0-9a-zA-Z]","",$user);
-$campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$campaign);
-$stage = ereg_replace("[^-\_0-9a-zA-Z]","",$stage);
-$epoch = ereg_replace("[^0-9]","",$epoch);
+$button_id=preg_replace("/[^0-9]/","",$button_id);
+$lead_id=preg_replace("/[^0-9]/","",$lead_id);
+$list_id=preg_replace("/[^0-9]/","",$list_id);
+$phone_number=preg_replace("/[^0-9]/","",$phone_number);
+$vendor_id = preg_replace("/[^- \:\/\_0-9a-zA-Z]/","",$vendor_id);
+$user=preg_replace("/[^0-9a-zA-Z]/","",$user);
+$campaign = preg_replace("/[^-\_0-9a-zA-Z]/","",$campaign);
+$stage = preg_replace("/[^-\_0-9a-zA-Z]/","",$stage);
+$epoch = preg_replace("/[^0-9]/","",$epoch);
require("dbconnect.php");
-if (eregi("CLICK",$stage))
+if (preg_match("/CLICK/i",$stage))
{
$epochNOW = date("U");
$click_seconds = ($epochNOW - $epoch);
@@ -81,7 +82,7 @@ else
$script_name = getenv("SCRIPT_NAME");
$server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT");
- if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';}
+ if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';}
if (($server_port == '80') or ($server_port == '443') ) {$server_port='';}
else {$server_port = "$CL$server_port";}
diff --git a/www/agc/SCRIPT_multirecording_AJAX.php b/www/agc/SCRIPT_multirecording_AJAX.php
index 0d3ca670..cad42b88 100644
--- a/www/agc/SCRIPT_multirecording_AJAX.php
+++ b/www/agc/SCRIPT_multirecording_AJAX.php
@@ -1,13 +1,14 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Joe Johnson, Matt Florell LICENSE: AGPLv2
#
# Other scripts that this application depends on:
# - SCRIPT_multirecording.php: Gives agents ability to stop and start recordings over a forced-recording (ALLFORCE) call
#
# CHANGELOG
# 120224-2240 - First Build
+# 130328-0009 - Converted ereg to preg functions
#
require("dbconnect.php");
@@ -44,15 +45,15 @@ $stmt="select campaign_rec_filename from vicidial_campaigns where campaign_id='$
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_array($rslt);
$filename=$row["campaign_rec_filename"];
-$filename=eregi_replace("CAMPAIGN", $campaign, $filename);
-$filename=eregi_replace("INGROUP", $campaign, $filename);
-$filename=eregi_replace("CUSTPHONE", $phone_number, $filename);
-$filename=eregi_replace("FULLDATE", date("Ymd-His"), $filename);
-$filename=eregi_replace("TINYDATE", (date("Y")-2000).date("mdHis"), $filename);
-$filename=eregi_replace("AGENT", $user, $filename);
-$filename=eregi_replace("EPOCH", $StarTtime, $filename);
-$filename=eregi_replace("VENDORLEADCODE", $vendor_lead_code, $filename);
-$filename=eregi_replace("LEADID", $lead_id, $filename);
+$filename=preg_replace("/CAMPAIGN/i", $campaign, $filename);
+$filename=preg_replace("/INGROUP/i", $campaign, $filename);
+$filename=preg_replace("/CUSTPHONE/i", $phone_number, $filename);
+$filename=preg_replace("/FULLDATE/i", date("Ymd-His"), $filename);
+$filename=preg_replace("/TINYDATE/i", (date("Y")-2000).date("mdHis"), $filename);
+$filename=preg_replace("/AGENT/i", $user, $filename);
+$filename=preg_replace("/EPOCH/i", $StarTtime, $filename);
+$filename=preg_replace("/VENDORLEADCODE/i", $vendor_lead_code, $filename);
+$filename=preg_replace("/LEADID/i", $lead_id, $filename);
$channel="Local/5".$session_id."@".$ext_context;
$ext_priority=1;
diff --git a/www/agc/SCRIPT_virido_crm_call.php b/www/agc/SCRIPT_virido_crm_call.php
index 17a8a903..e7bed661 100644
--- a/www/agc/SCRIPT_virido_crm_call.php
+++ b/www/agc/SCRIPT_virido_crm_call.php
@@ -5,11 +5,12 @@
#
#
#
-# Copyright (C) 2012 Matt Florell LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
#
# CHANGES:
# 120223-1156 - First Build
+# 130328-0014 - Converted ereg to preg functions
#
if (isset($_GET["button_id"])) {$button_id=$_GET["button_id"];}
@@ -34,19 +35,19 @@ if (isset($_GET["epoch"])) {$epoch=$_GET["epoch"];}
elseif (isset($_POST["epoch"])) {$epoch=$_POST["epoch"];}
### security strip all non-alphanumeric characters out of the variables ###
-$button_id=ereg_replace("[^0-9]","",$button_id);
-$lead_id=ereg_replace("[^0-9]","",$lead_id);
-$list_id=ereg_replace("[^0-9]","",$list_id);
-$phone_number=ereg_replace("[^0-9]","",$phone_number);
-$vendor_id = ereg_replace("[^- \:\/\_0-9a-zA-Z]","",$vendor_id);
-$user=ereg_replace("[^0-9a-zA-Z]","",$user);
-$campaign = ereg_replace("[^-\_0-9a-zA-Z]","",$campaign);
-$stage = ereg_replace("[^-\_0-9a-zA-Z]","",$stage);
-$epoch = ereg_replace("[^0-9]","",$epoch);
+$button_id=preg_replace("/[^0-9]/","",$button_id);
+$lead_id=preg_replace("/[^0-9]/","",$lead_id);
+$list_id=preg_replace("/[^0-9]/","",$list_id);
+$phone_number=preg_replace("/[^0-9]/","",$phone_number);
+$vendor_id = preg_replace("/[^- \:\/\_0-9a-zA-Z]/","",$vendor_id);
+$user=preg_replace("/[^0-9a-zA-Z]/","",$user);
+$campaign = preg_replace("/[^-\_0-9a-zA-Z]/","",$campaign);
+$stage = preg_replace("/[^-\_0-9a-zA-Z]/","",$stage);
+$epoch = preg_replace("/[^0-9]/","",$epoch);
require("dbconnect.php");
-if (eregi("CLICK",$stage))
+if (preg_match("/CLICK/i",$stage))
{
$epochNOW = date("U");
$click_seconds = ($epochNOW - $epoch);
@@ -68,7 +69,7 @@ else
$script_name = getenv("SCRIPT_NAME");
$server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT");
- if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';}
+ if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';}
if (($server_port == '80') or ($server_port == '443') ) {$server_port='';}
else {$server_port = "$CL$server_port";}
diff --git a/www/agc/active_list_refresh.php b/www/agc/active_list_refresh.php
index 0dfc029c..c5f514dc 100644
--- a/www/agc/active_list_refresh.php
+++ b/www/agc/active_list_refresh.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# This script is designed purely to serve updates of the live data to the display scripts
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -39,6 +39,7 @@
# 60421-1155 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60619-1118 - Added variable filters to close security holes for login form
# 90508-0727 - Changed to PHP long tags
+# 130328-0029 - Converted ereg to preg functions
#
require("dbconnect.php");
@@ -82,22 +83,22 @@ if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];}
elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];}
### security strip all non-alphanumeric characters out of the variables ###
- $user=ereg_replace("[^0-9a-zA-Z]","",$user);
- $pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
- $ADD=ereg_replace("[^0-9]","",$ADD);
- $order=ereg_replace("[^0-9a-zA-Z]","",$order);
- $format=ereg_replace("[^0-9a-zA-Z]","",$format);
- $bgcolor=ereg_replace("[^\#0-9a-zA-Z]","",$bgcolor);
- $txtcolor=ereg_replace("[^\#0-9a-zA-Z]","",$txtcolor);
- $txtsize=ereg_replace("[^0-9a-zA-Z]","",$txtsize);
- $selectsize=ereg_replace("[^0-9a-zA-Z]","",$selectsize);
- $selectfontsize=ereg_replace("[^0-9a-zA-Z]","",$selectfontsize);
- $selectedext=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedext);
- $selectedtrunk=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedtrunk);
- $selectedlocal=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$selectedlocal);
- $textareaheight=ereg_replace("[^0-9a-zA-Z]","",$textareaheight);
- $textareawidth=ereg_replace("[^0-9a-zA-Z]","",$textareawidth);
- $field_name=ereg_replace("[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]","",$field_name);
+ $user=preg_replace("/[^0-9a-zA-Z]/","",$user);
+ $pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
+ $ADD=preg_replace("/[^0-9]/","",$ADD);
+ $order=preg_replace("/[^0-9a-zA-Z]/","",$order);
+ $format=preg_replace("/[^0-9a-zA-Z]/","",$format);
+ $bgcolor=preg_replace("/[^\#0-9a-zA-Z]/","",$bgcolor);
+ $txtcolor=preg_replace("/[^\#0-9a-zA-Z]/","",$txtcolor);
+ $txtsize=preg_replace("/[^0-9a-zA-Z]/","",$txtsize);
+ $selectsize=preg_replace("/[^0-9a-zA-Z]/","",$selectsize);
+ $selectfontsize=preg_replace("/[^0-9a-zA-Z]/","",$selectfontsize);
+ $selectedext=preg_replace("/[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]/","",$selectedext);
+ $selectedtrunk=preg_replace("/[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]/","",$selectedtrunk);
+ $selectedlocal=preg_replace("/[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]/","",$selectedlocal);
+ $textareaheight=preg_replace("/[^0-9a-zA-Z]/","",$textareaheight);
+ $textareawidth=preg_replace("/[^0-9a-zA-Z]/","",$textareawidth);
+ $field_name=preg_replace("/[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]/","",$field_name);
# default optional vars if not set
if (!isset($ADD)) {$ADD="1";}
@@ -111,8 +112,8 @@ if (!isset($selectfontsize)) {$selectfontsize='10';}
if (!isset($textareaheight)) {$textareaheight='10';}
if (!isset($textareawidth)) {$textareawidth='20';}
-$version = '0.0.8';
-$build = '60619-1118';
+$version = '0.0.10';
+$build = '130328-0029';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
@@ -124,14 +125,13 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
$row=mysql_fetch_row($rslt);
$auth=$row[0];
- if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
+if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
{
echo "Invalid Username/Password: |$user|$pass|\n";
exit;
}
- else
+else
{
-
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
{
echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n";
@@ -144,12 +144,12 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$SNauth=$row[0];
- if($SNauth==0)
+ if($SNauth==0)
{
echo "Invalid session_name: |$session_name|$server_ip|\n";
exit;
}
- else
+ else
{
# do nothing for now
}
@@ -157,21 +157,21 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
}
if ($format=='table')
-{
-echo "\n";
-echo "\n";
-echo "\n";
-echo "List Display: ";
-if ($ADD==1) {echo "Live Extensions";}
-if ($ADD==2) {echo "Busy Extensions";}
-if ($ADD==3) {echo "Outside Lines";}
-if ($ADD==4) {echo "Local Extensions";}
-if ($ADD==5) {echo "Conferences";}
-if ($ADD==99999) {echo "HELP";}
-echo "\n";
-echo "\n";
-echo "\n";
-}
+ {
+ echo "\n";
+ echo "\n";
+ echo "\n";
+ echo "List Display: ";
+ if ($ADD==1) {echo "Live Extensions";}
+ if ($ADD==2) {echo "Busy Extensions";}
+ if ($ADD==3) {echo "Outside Lines";}
+ if ($ADD==4) {echo "Local Extensions";}
+ if ($ADD==5) {echo "Conferences";}
+ if ($ADD==99999) {echo "HELP";}
+ echo "\n";
+ echo "\n";
+ echo "\n";
+ }
@@ -181,7 +181,7 @@ echo "
# ADD=1 display all live extensions on a server
######################
if ($ADD==1)
-{
+ {
$pt='pt';
if (!$field_name) {$field_name = 'extension';}
if ($format=='table') {echo "
\n";}
@@ -200,7 +200,8 @@ if ($ADD==1)
$rslt=mysql_query($stmt, $link);
if ($rslt) {$phones_to_print = mysql_num_rows($rslt);}
$o=0;
- while ($phones_to_print > $o) {
+ while ($phones_to_print > $o)
+ {
$row=mysql_fetch_row($rslt);
if ($format=='table')
{
@@ -221,13 +222,13 @@ if ($ADD==1)
echo "\n";
}
$o++;
- }
+ }
if ($format=='table') {echo "
\n";}
if ($format=='menu') {echo "\n";}
if ($format=='selectlist') {echo "\n";}
if ($format=='textarea') {echo "\n";}
-}
+ }
@@ -239,7 +240,7 @@ if ($ADD==1)
# ADD=2 display all busy extensions on a server
######################
if ($ADD==2)
-{
+ {
if (!$field_name) {$field_name = 'busyext';}
if ($format=='table') {echo "
\n";}
if ($format=='menu') {echo "
\n";}
if ($format=='menu') {echo "\n";}
if ($format=='selectlist') {echo "\n";}
if ($format=='textarea') {echo "\n";}
-}
+ }
@@ -295,7 +297,7 @@ if ($ADD==2)
# ADD=3 display all busy outside lines(trunks) on a server
######################
if ($ADD==3)
-{
+ {
if (!$field_name) {$field_name = 'trunk';}
if ($format=='table') {echo "
\n";}
if ($format=='menu') {echo "
\n";}
if ($format=='menu') {echo "\n";}
if ($format=='selectlist') {echo "\n";}
if ($format=='textarea') {echo "\n";}
-}
+ }
@@ -351,7 +354,7 @@ if ($ADD==3)
# ADD=4 display all busy Local lines on a server
######################
if ($ADD==4)
-{
+ {
if (!$field_name) {$field_name = 'local';}
if ($format=='table') {echo "
\n";}
if ($format=='menu') {echo "
\n";}
if ($format=='menu') {echo "\n";}
if ($format=='selectlist') {echo "\n";}
if ($format=='textarea') {echo "\n";}
-}
+ }
@@ -407,7 +411,7 @@ if ($ADD==4)
# ADD=5 display all agc-usable conferences on a server
######################
if ($ADD==5)
-{
+ {
$pt='pt';
if (!$field_name) {$field_name = 'conferences';}
if ($format=='table') {echo "
\n";}
@@ -426,7 +430,8 @@ if ($ADD==5)
$rslt=mysql_query($stmt, $link);
if ($rslt) {$phones_to_print = mysql_num_rows($rslt);}
$o=0;
- while ($phones_to_print > $o) {
+ while ($phones_to_print > $o)
+ {
$row=mysql_fetch_row($rslt);
if ($format=='table')
{
@@ -447,21 +452,13 @@ if ($ADD==5)
echo "\n";
}
$o++;
- }
+ }
if ($format=='table') {echo "
\n";}
if ($format=='menu') {echo "\n";}
if ($format=='selectlist') {echo "\n";}
if ($format=='textarea') {echo "\n";}
-}
-
-
-
-
-
-
-
-
+ }
@@ -477,7 +474,3 @@ exit;
?>
-
-
-
-
diff --git a/www/agc/api.php b/www/agc/api.php
index d87c404d..811ffa05 100644
--- a/www/agc/api.php
+++ b/www/agc/api.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# This script is designed as an API(Application Programming Interface) to allow
# other programs to interact with the VICIDIAL Agent screen
@@ -64,10 +64,11 @@
# 120913-2039 - Added group_alias to transfer_conference function
# 121120-0855 - Added QM socket-send functionality
# 121124-2354 - Added Other Campaign DNC option
+# 130328-0010 - Converted ereg to preg functions
#
-$version = '2.6-30';
-$build = '121124-2354';
+$version = '2.6-31';
+$build = '130328-0010';
$startMS = microtime();
@@ -212,74 +213,74 @@ if ($qm_conf_ct > 0)
##### END SETTINGS LOOKUP #####
###########################################
-$ingroup_choices = ereg_replace("\+"," ",$ingroup_choices);
-$query_string = ereg_replace("'|\"|\\\\|;","",$query_string);
+$ingroup_choices = preg_replace("/\+/"," ",$ingroup_choices);
+$query_string = preg_replace("/'|\"|\\\\|;/","",$query_string);
if ($non_latin < 1)
{
- $user=ereg_replace("[^0-9a-zA-Z]","",$user);
- $pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
- $agent_user=ereg_replace("[^0-9a-zA-Z]","",$agent_user);
- $function = ereg_replace("[^-\_0-9a-zA-Z]","",$function);
- $value = ereg_replace("[^-\_0-9a-zA-Z]","",$value);
- $vendor_id = ereg_replace("[^-\.\_0-9a-zA-Z]","",$vendor_id);
- $focus = ereg_replace("[^-\_0-9a-zA-Z]","",$focus);
- $preview = ereg_replace("[^-\_0-9a-zA-Z]","",$preview);
- $notes = ereg_replace("\+"," ",$notes);
- $notes = ereg_replace("[^- \.\_0-9a-zA-Z]","",$notes);
- $phone_code = ereg_replace("[^0-9X]","",$phone_code);
- $search = ereg_replace("[^-\_0-9a-zA-Z]","",$search);
- $group_alias = ereg_replace("[^0-9a-zA-Z]","",$group_alias);
- $dial_prefix = ereg_replace("[^0-9a-zA-Z]","",$dial_prefix);
- $source = ereg_replace("[^0-9a-zA-Z]","",$source);
- $format = ereg_replace("[^0-9a-zA-Z]","",$format);
- $vtiger_callback = ereg_replace("[^A-Z]","",$vtiger_callback);
- $alt_dial = ereg_replace("[^0-9A-Z]","",$alt_dial);
- $blended = ereg_replace("[^A-Z]","",$blended);
- $ingroup_choices = ereg_replace("[^- \_0-9a-zA-Z]","",$ingroup_choices);
- $set_as_default = ereg_replace("[^A-Z]","",$set_as_default);
- $phone_number = ereg_replace("[^0-9]","",$phone_number);
- $address1 = ereg_replace("[^- \_0-9a-zA-Z]","",$address1);
- $address2 = ereg_replace("[^- \_0-9a-zA-Z]","",$address2);
- $address3 = ereg_replace("[^- \_0-9a-zA-Z]","",$address3);
- $alt_phone = ereg_replace("[^- \_0-9a-zA-Z]","",$alt_phone);
- $city = ereg_replace("[^- \_0-9a-zA-Z]","",$city);
- $comments = ereg_replace("[^- \_0-9a-zA-Z]","",$comments);
- $country_code = ereg_replace("[^A-Z]","",$country_code);
- $date_of_birth = ereg_replace("[^- \_0-9]","",$date_of_birth);
- $email = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$email);
- $first_name = ereg_replace("[^- \_0-9a-zA-Z]","",$first_name);
- $gender = ereg_replace("[^A-Z]","",$gender);
- $gmt_offset_now = ereg_replace("[^- \.\_0-9]","",$gmt_offset_now);
- $last_name = ereg_replace("[^- \_0-9a-zA-Z]","",$last_name);
- $lead_id = ereg_replace("[^0-9]","",$lead_id);
- $middle_initial = ereg_replace("[^- \_0-9a-zA-Z]","",$middle_initial);
- $province = ereg_replace("[^- \.\_0-9a-zA-Z]","",$province);
- $security_phrase = ereg_replace("[^- \.\_0-9a-zA-Z]","",$security_phrase);
- $source_id = ereg_replace("[^- \.\_0-9a-zA-Z]","",$source_id);
- $state = ereg_replace("[^- \_0-9a-zA-Z]","",$state);
- $title = ereg_replace("[^- \_0-9a-zA-Z]","",$title);
- $vendor_lead_code = ereg_replace("[^- \.\_0-9a-zA-Z]","",$vendor_lead_code);
- $rank = ereg_replace("[^-0-9]","",$rank);
- $owner = ereg_replace("[^-\.\:\/\@\_0-9a-zA-Z]","",$owner);
- $dial_override = ereg_replace("[^A-Z]","",$dial_override);
- $consultative = ereg_replace("[^A-Z]","",$consultative);
- $callback_datetime = ereg_replace("\+"," ",$callback_datetime);
- $callback_datetime = ereg_replace("[^- \:\.\_0-9a-zA-Z]","",$callback_datetime);
- $callback_type = ereg_replace("[^A-Z]","",$callback_type);
- $callback_comments = ereg_replace("\+"," ",$callback_comments);
- $callback_comments = ereg_replace("[^- \.\_0-9a-zA-Z]","",$callback_comments);
- $qm_dispo_code = ereg_replace("[^-\.\_0-9a-zA-Z]","",$qm_dispo_code);
- $alt_user = ereg_replace("[^0-9a-zA-Z]","",$alt_user);
- $postal_code = ereg_replace("[^- \.\_0-9a-zA-Z]","",$postal_code);
+ $user=preg_replace("/[^0-9a-zA-Z]/","",$user);
+ $pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
+ $agent_user=preg_replace("/[^0-9a-zA-Z]/","",$agent_user);
+ $function = preg_replace("/[^-\_0-9a-zA-Z]/","",$function);
+ $value = preg_replace("/[^-\_0-9a-zA-Z]/","",$value);
+ $vendor_id = preg_replace("/[^-\.\_0-9a-zA-Z]/","",$vendor_id);
+ $focus = preg_replace("/[^-\_0-9a-zA-Z]/","",$focus);
+ $preview = preg_replace("/[^-\_0-9a-zA-Z]/","",$preview);
+ $notes = preg_replace("/\+/"," ",$notes);
+ $notes = preg_replace("/[^- \.\_0-9a-zA-Z]/","",$notes);
+ $phone_code = preg_replace("/[^0-9X]/","",$phone_code);
+ $search = preg_replace("/[^-\_0-9a-zA-Z]/","",$search);
+ $group_alias = preg_replace("/[^0-9a-zA-Z]/","",$group_alias);
+ $dial_prefix = preg_replace("/[^0-9a-zA-Z]/","",$dial_prefix);
+ $source = preg_replace("/[^0-9a-zA-Z]/","",$source);
+ $format = preg_replace("/[^0-9a-zA-Z]/","",$format);
+ $vtiger_callback = preg_replace("/[^A-Z]/","",$vtiger_callback);
+ $alt_dial = preg_replace("/[^0-9A-Z]/","",$alt_dial);
+ $blended = preg_replace("/[^A-Z]/","",$blended);
+ $ingroup_choices = preg_replace("/[^- \_0-9a-zA-Z]/","",$ingroup_choices);
+ $set_as_default = preg_replace("/[^A-Z]/","",$set_as_default);
+ $phone_number = preg_replace("/[^0-9]/","",$phone_number);
+ $address1 = preg_replace("/[^- \_0-9a-zA-Z]/","",$address1);
+ $address2 = preg_replace("/[^- \_0-9a-zA-Z]/","",$address2);
+ $address3 = preg_replace("/[^- \_0-9a-zA-Z]/","",$address3);
+ $alt_phone = preg_replace("/[^- \_0-9a-zA-Z]/","",$alt_phone);
+ $city = preg_replace("/[^- \_0-9a-zA-Z]/","",$city);
+ $comments = preg_replace("/[^- \_0-9a-zA-Z]/","",$comments);
+ $country_code = preg_replace("/[^A-Z]/","",$country_code);
+ $date_of_birth = preg_replace("/[^- \_0-9]/","",$date_of_birth);
+ $email = preg_replace("/[^-\.\:\/\@\_0-9a-zA-Z]/","",$email);
+ $first_name = preg_replace("/[^- \_0-9a-zA-Z]/","",$first_name);
+ $gender = preg_replace("/[^A-Z]/","",$gender);
+ $gmt_offset_now = preg_replace("/[^- \.\_0-9]/","",$gmt_offset_now);
+ $last_name = preg_replace("/[^- \_0-9a-zA-Z]/","",$last_name);
+ $lead_id = preg_replace("/[^0-9]/","",$lead_id);
+ $middle_initial = preg_replace("/[^- \_0-9a-zA-Z]/","",$middle_initial);
+ $province = preg_replace("/[^- \.\_0-9a-zA-Z]/","",$province);
+ $security_phrase = preg_replace("/[^- \.\_0-9a-zA-Z]/","",$security_phrase);
+ $source_id = preg_replace("/[^- \.\_0-9a-zA-Z]/","",$source_id);
+ $state = preg_replace("/[^- \_0-9a-zA-Z]/","",$state);
+ $title = preg_replace("/[^- \_0-9a-zA-Z]/","",$title);
+ $vendor_lead_code = preg_replace("/[^- \.\_0-9a-zA-Z]/","",$vendor_lead_code);
+ $rank = preg_replace("/[^-0-9]/","",$rank);
+ $owner = preg_replace("/[^-\.\:\/\@\_0-9a-zA-Z]/","",$owner);
+ $dial_override = preg_replace("/[^A-Z]/","",$dial_override);
+ $consultative = preg_replace("/[^A-Z]/","",$consultative);
+ $callback_datetime = preg_replace("/\+/"," ",$callback_datetime);
+ $callback_datetime = preg_replace("/[^- \:\.\_0-9a-zA-Z]/","",$callback_datetime);
+ $callback_type = preg_replace("/[^A-Z]/","",$callback_type);
+ $callback_comments = preg_replace("/\+/"," ",$callback_comments);
+ $callback_comments = preg_replace("/[^- \.\_0-9a-zA-Z]/","",$callback_comments);
+ $qm_dispo_code = preg_replace("/[^-\.\_0-9a-zA-Z]/","",$qm_dispo_code);
+ $alt_user = preg_replace("/[^0-9a-zA-Z]/","",$alt_user);
+ $postal_code = preg_replace("/[^- \.\_0-9a-zA-Z]/","",$postal_code);
}
else
{
- $user = ereg_replace("'|\"|\\\\|;","",$user);
- $pass = ereg_replace("'|\"|\\\\|;","",$pass);
- $source = ereg_replace("'|\"|\\\\|;","",$source);
- $agent_user = ereg_replace("'|\"|\\\\|;","",$agent_user);
- $alt_user = ereg_replace("'|\"|\\\\|;","",$alt_user);
+ $user = preg_replace("/'|\"|\\\\|;/","",$user);
+ $pass = preg_replace("/'|\"|\\\\|;/","",$pass);
+ $source = preg_replace("/'|\"|\\\\|;/","",$source);
+ $agent_user = preg_replace("/'|\"|\\\\|;/","",$agent_user);
+ $alt_user = preg_replace("/'|\"|\\\\|;/","",$alt_user);
}
### date and fixed variables
@@ -622,7 +623,7 @@ if ($function == 'external_status')
################################################################################
if ($function == 'external_pause')
{
- if ( (strlen($value)<1) or ( (strlen($agent_user)<1) and (strlen($alt_user)<1) ) or (!ereg("PAUSE|RESUME",$value)) )
+ if ( (strlen($value)<1) or ( (strlen($agent_user)<1) and (strlen($alt_user)<1) ) or (!preg_match("/PAUSE|RESUME/",$value)) )
{
$result = 'ERROR';
$result_reason = "external_pause not valid";
@@ -659,7 +660,7 @@ if ($function == 'external_pause')
$row=mysql_fetch_row($rslt);
if ($row[0] > 0)
{
- if (ereg("RESUME",$value))
+ if (preg_match("/RESUME/",$value))
{
$stmt = "select count(*) from vicidial_live_agents where user='$agent_user' and status IN('READY','QUEUE','INCALL','CLOSER');";
if ($DB) {echo "$stmt\n";}
@@ -705,7 +706,7 @@ if ($function == 'external_pause')
################################################################################
if ($function == 'logout')
{
- if ( (strlen($value)<1) or ( (strlen($agent_user)<1) and (strlen($alt_user)<1) ) or (!ereg("LOGOUT",$value)) )
+ if ( (strlen($value)<1) or ( (strlen($agent_user)<1) and (strlen($alt_user)<1) ) or (!preg_match("/LOGOUT/",$value)) )
{
$result = 'ERROR';
$result_reason = "logout not valid";
@@ -1096,7 +1097,7 @@ if ($function == 'call_agent')
################################################################################
if ($function == 'external_dial')
{
- $value = ereg_replace("[^0-9]","",$value);
+ $value = preg_replace("/[^0-9]/","",$value);
if ( ( (strlen($value)<2) and (strlen($lead_id)<1) ) or ( (strlen($agent_user)<2) and (strlen($alt_user)<2) ) or (strlen($search)<2) or (strlen($preview)<2) or (strlen($focus)<2) )
{
@@ -1206,7 +1207,7 @@ if ($function == 'external_dial')
####### Begin Vtiger CallBack Launching #######
$vtiger_callback_id='';
- if ( (eregi("YES",$vtiger_callback)) and (preg_match("/^99/",$value)) )
+ if ( (preg_match("/YES/i",$vtiger_callback)) and (preg_match("/^99/",$value)) )
{
$value = preg_replace("/^99/",'',$value);
$value = ($value + 0);
@@ -1319,7 +1320,7 @@ if ($function == 'external_dial')
$row=mysql_fetch_row($rslt);
$value = $row[0];
$phone_code = $row[1];
- $value = ereg_replace("[^0-9]","",$value);
+ $value = preg_replace("/[^0-9]/","",$value);
if (strlen($value)<2)
{
$result = 'ERROR';
@@ -1580,7 +1581,7 @@ if ($function == 'external_add_lead')
################################################################################
if ($function == 'change_ingroups')
{
- $value = ereg_replace("[^A-Z]","",$value);
+ $value = preg_replace("/[^A-Z]/","",$value);
if ( (strlen($blended)<2) or (strlen($agent_user)<2) or (strlen($value)<3) )
{
@@ -1811,7 +1812,7 @@ if ($function == 'change_ingroups')
### LOG INSERTION Admin Log Table ###
$ip = getenv("REMOTE_ADDR");
$SQL_log = "$stmt|$stmtA|$stmtBlog";
- $SQL_log = ereg_replace(';','',$SQL_log);
+ $SQL_log = preg_replace('/;/','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='USERS', event_type='MODIFY', record_id='$agent_user', event_code='API MODIFY USER', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";}
@@ -1894,175 +1895,175 @@ if ($function == 'update_fields')
$fieldsSQL='';
$fieldsLISTS='';
$field_set=0;
- if (ereg('phone_code',$query_string))
+ if (preg_match('/phone_code/',$query_string))
{
if ($DB) {echo "phone_code set to $phone_code\n";}
$fieldsSQL .= "phone_code='$phone_code',";
$fieldsLIST .= "phone_code,";
$field_set++;
}
- if (ereg('address1',$query_string))
+ if (preg_match('/address1/',$query_string))
{
if ($DB) {echo "address1 set to $address1\n";}
$fieldsSQL .= "address1='$address1',";
$fieldsLIST .= "address1,";
$field_set++;
}
- if (ereg('address2',$query_string))
+ if (preg_match('/address2/',$query_string))
{
if ($DB) {echo "address2 set to $address2\n";}
$fieldsSQL .= "address2='$address2',";
$fieldsLIST .= "address2,";
$field_set++;
}
- if (ereg('address3',$query_string))
+ if (preg_match('/address3/',$query_string))
{
if ($DB) {echo "address3 set to $address3\n";}
$fieldsSQL .= "address3='$address3',";
$fieldsLIST .= "address3,";
$field_set++;
}
- if (ereg('alt_phone',$query_string))
+ if (preg_match('/alt_phone/',$query_string))
{
if ($DB) {echo "alt_phone set to $alt_phone\n";}
$fieldsSQL .= "alt_phone='$alt_phone',";
$fieldsLIST .= "alt_phone,";
$field_set++;
}
- if (ereg('city',$query_string))
+ if (preg_match('/city/',$query_string))
{
if ($DB) {echo "city set to $city\n";}
$fieldsSQL .= "city='$city',";
$fieldsLIST .= "city,";
$field_set++;
}
- if (ereg('comments',$query_string))
+ if (preg_match('/comments/',$query_string))
{
if ($DB) {echo "comments set to $comments\n";}
$fieldsSQL .= "comments='$comments',";
$fieldsLIST .= "comments,";
$field_set++;
}
- if (ereg('country_code',$query_string))
+ if (preg_match('/country_code/',$query_string))
{
if ($DB) {echo "country_code set to $country_code\n";}
$fieldsSQL .= "country_code='$country_code',";
$fieldsLIST .= "country_code,";
$field_set++;
}
- if (ereg('date_of_birth',$query_string))
+ if (preg_match('/date_of_birth/',$query_string))
{
if ($DB) {echo "date_of_birth set to $date_of_birth\n";}
$fieldsSQL .= "date_of_birth='$date_of_birth',";
$fieldsLIST .= "date_of_birth,";
$field_set++;
}
- if (ereg('email',$query_string))
+ if (preg_match('/email/',$query_string))
{
if ($DB) {echo "email set to $email\n";}
$fieldsSQL .= "email='$email',";
$fieldsLIST .= "email,";
$field_set++;
}
- if (ereg('first_name',$query_string))
+ if (preg_match('/first_name/',$query_string))
{
if ($DB) {echo "first_name set to $first_name\n";}
$fieldsSQL .= "first_name='$first_name',";
$fieldsLIST .= "first_name,";
$field_set++;
}
- if (ereg('gender',$query_string))
+ if (preg_match('/gender/',$query_string))
{
if ($DB) {echo "gender set to $gender\n";}
$fieldsSQL .= "gender='$gender',";
$fieldsLIST .= "gender,";
$field_set++;
}
- if (ereg('gmt_offset_now',$query_string))
+ if (preg_match('/gmt_offset_now/',$query_string))
{
if ($DB) {echo "gmt_offset_now set to $gmt_offset_now\n";}
$fieldsSQL .= "gmt_offset_now='$gmt_offset_now',";
$fieldsLIST .= "gmt_offset_now,";
$field_set++;
}
- if (ereg('last_name',$query_string))
+ if (preg_match('/last_name/',$query_string))
{
if ($DB) {echo "last_name set to $last_name\n";}
$fieldsSQL .= "last_name='$last_name',";
$fieldsLIST .= "last_name,";
$field_set++;
}
- if (ereg('middle_initial',$query_string))
+ if (preg_match('/middle_initial/',$query_string))
{
if ($DB) {echo "middle_initial set to $middle_initial\n";}
$fieldsSQL .= "middle_initial='$middle_initial',";
$fieldsLIST .= "middle_initial,";
$field_set++;
}
- if (ereg('phone_number',$query_string))
+ if (preg_match('/phone_number/',$query_string))
{
if ($DB) {echo "phone_number set to $phone_number\n";}
$fieldsSQL .= "phone_number='$phone_number',";
$fieldsLIST .= "phone_number,";
$field_set++;
}
- if (ereg('postal_code',$query_string))
+ if (preg_match('/postal_code/i',$query_string))
{
if ($DB) {echo "postal_code set to $postal_code\n";}
$fieldsSQL .= "postal_code='$postal_code',";
$fieldsLIST .= "postal_code,";
$field_set++;
}
- if (ereg('province',$query_string))
+ if (preg_match('/province/i',$query_string))
{
if ($DB) {echo "province set to $province\n";}
$fieldsSQL .= "province='$province',";
$fieldsLIST .= "province,";
$field_set++;
}
- if (ereg('security_phrase',$query_string))
+ if (preg_match('/security_phrase/i',$query_string))
{
if ($DB) {echo "security_phrase set to $security_phrase\n";}
$fieldsSQL .= "security_phrase='$security_phrase',";
$fieldsLIST .= "security_phrase,";
$field_set++;
}
- if (ereg('source_id',$query_string))
+ if (preg_match('/source_id/i',$query_string))
{
if ($DB) {echo "source_id set to $source_id\n";}
$fieldsSQL .= "source_id='$source_id',";
$fieldsLIST .= "source_id,";
$field_set++;
}
- if (ereg('state',$query_string))
+ if (preg_match('/state/i',$query_string))
{
if ($DB) {echo "state set to $state\n";}
$fieldsSQL .= "state='$state',";
$fieldsLIST .= "state,";
$field_set++;
}
- if (ereg('title',$query_string))
+ if (preg_match('/title/i',$query_string))
{
if ($DB) {echo "title set to $title\n";}
$fieldsSQL .= "title='$title',";
$fieldsLIST .= "title,";
$field_set++;
}
- if (ereg('vendor_lead_code',$query_string))
+ if (preg_match('/vendor_lead_code/i',$query_string))
{
if ($DB) {echo "vendor_lead_code set to $vendor_lead_code\n";}
$fieldsSQL .= "vendor_lead_code='$vendor_lead_code',";
$fieldsLIST .= "vendor_lead_code,";
$field_set++;
}
- if (ereg('rank',$query_string))
+ if (preg_match('/rank/i',$query_string))
{
if ($DB) {echo "rank set to $rank\n";}
$fieldsSQL .= "rank='$rank',";
$fieldsLIST .= "rank,";
$field_set++;
}
- if (ereg('owner',$query_string))
+ if (preg_match('/owner/i',$query_string))
{
if ($DB) {echo "owner set to $owner\n";}
$fieldsSQL .= "owner='$owner',";
diff --git a/www/agc/astguiclient.php b/www/agc/astguiclient.php
index 432c7c0d..44a2a518 100644
--- a/www/agc/astguiclient.php
+++ b/www/agc/astguiclient.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# make sure you have added a user to the vicidial_users MySQL table with at least
# user_level 1 or greater to access this page. Also you need to have the login
@@ -59,6 +59,7 @@
# 90508-0727 - Changed to PHP long tags
# 91129-2211 - Replaced SELECT STAR in SQL query
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
+# 130328-0017 - Converted ereg to preg functions
#
require("dbconnect.php");
@@ -88,17 +89,17 @@ if (isset($_GET["relogin"])) {$relogin=$_GET["relogin"];}
$forever_stop=0;
$user_abb = "$user$user$user$user";
while ( (strlen($user_abb) > 4) and ($forever_stop < 200) )
- {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;}
+ {$user_abb = preg_replace("/^./","",$user_abb); $forever_stop++;}
-$version = '2.2.4-1';
-$build = '120223-2124';
+$version = '2.2.6-1';
+$build = '130328-0017';
### security strip all non-alphanumeric characters out of the variables ###
- $DB=ereg_replace("[^0-9a-z]","",$DB);
- $phone_login=ereg_replace("[^0-9a-zA-Z]","",$phone_login);
- $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass);
- $user=ereg_replace("[^0-9a-zA-Z]","",$user);
- $pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
+ $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);
+ $user=preg_replace("/[^0-9a-zA-Z]/","",$user);
+ $pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
if ($force_logout)
@@ -134,13 +135,13 @@ $browser = getenv("HTTP_USER_AGENT");
$script_name = getenv("SCRIPT_NAME");
$server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT");
-if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';}
+if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';}
if (($server_port == '80') or ($server_port == '443') ) {$server_port='';}
else {$server_port = "$CL$server_port";}
$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name";
$agcDIR = $agcPAGE;
-$agcDIR = eregi_replace('astguiclient.php','',$agcDIR);
+$agcDIR = preg_replace('/astguiclient\.php/i','',$agcDIR);
if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') )
{
@@ -346,7 +347,7 @@ else
$local_web_callerID_URL_enc = rawurlencode($local_web_callerID_URL);
- $session_ext = eregi_replace("[^a-z0-9]", "", $extension);
+ $session_ext = preg_replace("/[^a-z0-9]/i", "", $extension);
if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);}
$session_rand = (rand(1,9999999) + 10000000);
$session_name = "$StarTtime$US$session_ext$session_rand";
@@ -372,7 +373,7 @@ else
$row=mysql_fetch_row($rslt);
$favorites_list=$row[0];
$h=0;
- $favorites_listX = eregi_replace("'",'',$favorites_list);
+ $favorites_listX = preg_replace("/\'/i",'',$favorites_list);
$favorites = explode(',',$favorites_listX);
$favorites_count = count($favorites);
$favorites_listX='';
diff --git a/www/agc/call_log_display.php b/www/agc/call_log_display.php
index f49db9eb..39965cf7 100644
--- a/www/agc/call_log_display.php
+++ b/www/agc/call_log_display.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# This script is designed purely to send the inbound and outbound calls for a specific phone
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -29,6 +29,7 @@
# 60421-1401 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60619-1202 - Added variable filters to close security holes for login form
# 90508-0727 - Changed to PHP long tags
+# 130328-0028 - Converted ereg to preg functions
#
require("dbconnect.php");
@@ -49,8 +50,8 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];}
if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];}
elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];}
-$user=ereg_replace("[^0-9a-zA-Z]","",$user);
-$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
+$user=preg_replace("/[^0-9a-zA-Z]/","",$user);
+$pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
# default optional vars if not set
if (!isset($format)) {$format="text";}
@@ -59,8 +60,8 @@ if (!isset($out_limit)) {$out_limit="100";}
$number_dialed = 'number_dialed';
#$number_dialed = 'extension';
-$version = '0.0.8';
-$build = '60619-1202';
+$version = '0.0.10';
+$build = '130328-0028';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
@@ -72,14 +73,13 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
$row=mysql_fetch_row($rslt);
$auth=$row[0];
- if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
+if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
{
echo "Invalid Username/Password: |$user|$pass|\n";
exit;
}
- else
+else
{
-
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
{
echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n";
@@ -92,12 +92,12 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$SNauth=$row[0];
- if($SNauth==0)
+ if($SNauth==0)
{
echo "Invalid session_name: |$session_name|$server_ip|\n";
exit;
}
- else
+ else
{
# do nothing for now
}
@@ -105,26 +105,26 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
}
if ($format=='debug')
-{
-echo "\n";
-echo "\n";
-echo "\n";
-echo "Call Log Display";
-echo "\n";
-echo "\n";
-echo "\n";
-}
+ {
+ echo "\n";
+ echo "\n";
+ echo "\n";
+ echo "Call Log Display";
+ echo "\n";
+ echo "\n";
+ echo "\n";
+ }
$row=''; $rowx='';
$channel_live=1;
- if ( (strlen($exten)<1) or (strlen($protocol)<3) )
+if ( (strlen($exten)<1) or (strlen($protocol)<3) )
{
$channel_live=0;
echo "Exten $exten is not valid or protocol $protocol is not valid\n";
exit;
}
- else
+else
{
##### print outbound calls from the call_log table
$stmt="SELECT uniqueid,start_time,$number_dialed,length_in_sec FROM call_log where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\" order by start_time desc limit $out_limit;";
@@ -133,7 +133,7 @@ echo "
if ($rslt) {$out_calls_count = mysql_num_rows($rslt);}
echo "$out_calls_count|";
$loop_count=0;
- while ($out_calls_count>$loop_count)
+ while ($out_calls_count>$loop_count)
{
$loop_count++;
$row=mysql_fetch_row($rslt);
@@ -159,7 +159,7 @@ echo "
if ($rslt) {$in_calls_count = mysql_num_rows($rslt);}
echo "$in_calls_count|";
$loop_count=0;
- while ($in_calls_count>$loop_count)
+ while ($in_calls_count>$loop_count)
{
$loop_count++;
$row=mysql_fetch_row($rslt);
@@ -179,7 +179,6 @@ echo "
echo "$row[0] ~$row[1] ~$row[2] ~$callerIDnum ~$callerIDname ~$call_time_MS|";
}
echo "\n";
-
}
diff --git a/www/agc/conf_exten_check.php b/www/agc/conf_exten_check.php
index ca22a754..dfe2c303 100644
--- a/www/agc/conf_exten_check.php
+++ b/www/agc/conf_exten_check.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# This script is designed purely to send whether the meetme conference has live channels connected and which they are
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -57,10 +57,11 @@
# 110610-0059 - Small fix for manual dial calls lasting more than 100 minutes in real-time report
# 120809-2353 - Added external_recording function
# 121028-2305 - Added extra check on session_name to validate agent screen requests
+# 130328-0011 - Converted ereg to preg functions
#
-$version = '2.6-32';
-$build = '121028-2305';
+$version = '2.6-33';
+$build = '130328-0011';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=39;
$one_mysql_log=0;
@@ -116,13 +117,13 @@ if ($qm_conf_ct > 0)
if ($non_latin < 1)
{
- $user=ereg_replace("[^-_0-9a-zA-Z]","",$user);
- $pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass);
+ $user=preg_replace("/[^\-_0-9a-zA-Z]/i","",$user);
+ $pass=preg_replace("/[^\-_0-9a-zA-Z]/i","",$pass);
}
else
{
- $user = ereg_replace("'|\"|\\\\|;","",$user);
- $pass = ereg_replace("'|\"|\\\\|;","",$pass);
+ $user = preg_replace("/\'|\"|\\\\|;/","",$user);
+ $pass = preg_replace("/\'|\"|\\\\|;/","",$pass);
}
# default optional vars if not set
@@ -276,11 +277,11 @@ if ($ACTION == 'refresh')
$Alogin=$row[0];
$Acampaign=$row[1];
$AccampSQL=$row[2];
- $AccampSQL = ereg_replace(' -','', $AccampSQL);
- $AccampSQL = ereg_replace(' ',"','", $AccampSQL);
- if (eregi('AGENTDIRECT', $AccampSQL))
+ $AccampSQL = preg_replace('/\s\-/','', $AccampSQL);
+ $AccampSQL = preg_replace('/\s/',"','", $AccampSQL);
+ if (preg_match('/AGENTDIRECT/i', $AccampSQL))
{
- $AccampSQL = ereg_replace('AGENTDIRECT','', $AccampSQL);
+ $AccampSQL = preg_replace('/AGENTDIRECT/i','', $AccampSQL);
$ADsql = "or ( (campaign_id LIKE \"%AGENTDIRECT%\") and (agent_only='$user') )";
}
@@ -336,7 +337,7 @@ if ($ACTION == 'refresh')
$row=mysql_fetch_row($rslt);
$AcalleridCOUNT=$row[0];
- if ( ($AcalleridCOUNT > 0) and (eregi("INCALL",$Astatus)) and (preg_match("/^M/",$Acallerid)) )
+ if ( ($AcalleridCOUNT > 0) and (preg_match("/INCALL/i",$Astatus)) and (preg_match("/^M/",$Acallerid)) )
{
$updateNOW_TIME = date("Y-m-d H:i:s");
$stmt="UPDATE vicidial_auto_calls set last_update_time='$updateNOW_TIME' where callerid='$Acallerid';";
@@ -345,7 +346,7 @@ if ($ACTION == 'refresh')
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03038',$user,$server_ip,$session_name,$one_mysql_log);}
}
- if ( ($AcalleridCOUNT < 1) and (eregi("INCALL",$Astatus)) and (strlen($Aagent_log_id) > 0) )
+ if ( ($AcalleridCOUNT < 1) and (preg_match("/INCALL/i",$Astatus)) and (strlen($Aagent_log_id) > 0) )
{
$DEADcustomer++;
### find whether the agent log record has already logged DEAD
@@ -398,7 +399,7 @@ if ($ACTION == 'refresh')
$row=mysql_fetch_row($rslt);
$AcalleridCOUNT=$row[0];
- if ( ($AcalleridCOUNT > 0) and (eregi("INCALL",$Astatus)) )
+ if ( ($AcalleridCOUNT > 0) and (preg_match("/INCALL/i",$Astatus)) )
{
$updateNOW_TIME = date("Y-m-d H:i:s");
$stmt="UPDATE vicidial_auto_calls set last_update_time='$updateNOW_TIME' where callerid='$Acallerid';";
@@ -407,7 +408,7 @@ if ($ACTION == 'refresh')
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03037',$user,$server_ip,$session_name,$one_mysql_log);}
}
- if ( ($AcalleridCOUNT < 1) and (eregi("INCALL",$Astatus)) and (strlen($Aagent_log_id) > 0) )
+ if ( ($AcalleridCOUNT < 1) and (preg_match("/INCALL/i",$Astatus)) and (strlen($Aagent_log_id) > 0) )
{
$DEADcustomer++;
### find whether the agent log record has already logged DEAD
@@ -597,13 +598,13 @@ if ($ACTION == 'refresh')
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03016',$VD_login,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$shift_enforcement = $row[0];
- $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[1]);
- $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL);
+ $LOGgroup_shiftsSQL = preg_replace('/\s\s/','',$row[1]);
+ $LOGgroup_shiftsSQL = preg_replace('/\s/',"','",$LOGgroup_shiftsSQL);
$LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')";
### CHECK TO SEE IF AGENT IS WITHIN THEIR SHIFT IF RESTRICTED, IF NOT, OUTPUT ERROR
$Ashift_logout=0;
- if ( ( (ereg("ALL",$shift_enforcement)) and (!ereg("OFF|START",$VU_agent_shift_enforcement_override)) ) or (ereg("ALL",$VU_agent_shift_enforcement_override)) )
+ if ( ( (preg_match("/ALL/",$shift_enforcement)) and (!preg_match("/OFF|START/",$VU_agent_shift_enforcement_override)) ) or (preg_match("/ALL/",$VU_agent_shift_enforcement_override)) )
{
$shift_ok=0;
if (strlen($LOGgroup_shiftsSQL) < 3)
@@ -627,7 +628,7 @@ if ($ACTION == 'refresh')
$shift_length = $rowx[2];
$shift_weekdays = $rowx[3];
- if (eregi("$wday",$shift_weekdays))
+ if (preg_match("/$wday/i",$shift_weekdays))
{
$HHshift_length = substr($shift_length,0,2);
$MMshift_length = substr($shift_length,3,2);
@@ -662,7 +663,7 @@ if ($ACTION == 'refresh')
}
- if ( ( ($time_diff > 8) or ($time_diff < -8) or ($web_diff > 8) or ($web_diff < -8) ) and (eregi("0$",$StarTtime)) )
+ if ( ( ($time_diff > 8) or ($time_diff < -8) or ($web_diff > 8) or ($web_diff < -8) ) and (preg_match("/0\$/i",$StarTtime)) )
{$Alogin='TIME_SYNC';}
if ( ($Acount < 1) or ($Scount < 1) )
{$Alogin='DEAD_VLA';}
diff --git a/www/agc/dbconnect.php b/www/agc/dbconnect.php
index e02ca392..eb8b602c 100644
--- a/www/agc/dbconnect.php
+++ b/www/agc/dbconnect.php
@@ -1,32 +1,36 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
+# CHANGES:
+# 130328-0022 - Converted ereg to preg functions
+#
+
if ( file_exists("/etc/astguiclient.conf") )
{
$DBCagc = file("/etc/astguiclient.conf");
foreach ($DBCagc as $DBCline)
{
$DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline);
- if (ereg("^PATHlogs", $DBCline))
+ if (preg_match("/^PATHlogs/", $DBCline))
{$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);}
- if (ereg("^PATHweb", $DBCline))
+ if (preg_match("/^PATHweb/", $DBCline))
{$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);}
- if (ereg("^VARserver_ip", $DBCline))
+ if (preg_match("/^VARserver_ip/", $DBCline))
{$WEBserver_ip = $DBCline; $WEBserver_ip = preg_replace("/.*=/","",$WEBserver_ip);}
- if (ereg("^VARDB_server", $DBCline))
+ if (preg_match("/^VARDB_server/", $DBCline))
{$VARDB_server = $DBCline; $VARDB_server = preg_replace("/.*=/","",$VARDB_server);}
- if (ereg("^VARDB_database", $DBCline))
+ if (preg_match("/^VARDB_database/", $DBCline))
{$VARDB_database = $DBCline; $VARDB_database = preg_replace("/.*=/","",$VARDB_database);}
- if (ereg("^VARDB_user", $DBCline))
+ if (preg_match("/^VARDB_user/", $DBCline))
{$VARDB_user = $DBCline; $VARDB_user = preg_replace("/.*=/","",$VARDB_user);}
- if (ereg("^VARDB_pass", $DBCline))
+ if (preg_match("/^VARDB_pass/", $DBCline))
{$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);}
- if (ereg("^VARDB_port", $DBCline))
+ if (preg_match("/^VARDB_port/", $DBCline))
{$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);}
}
}
diff --git a/www/agc/deactivate_lead.php b/www/agc/deactivate_lead.php
index 3116a25c..bf2e5460 100644
--- a/www/agc/deactivate_lead.php
+++ b/www/agc/deactivate_lead.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# This script is designed to be used in the "Dispo URL" field of a campaign
# or in-group. It should take in the campaign_id to check for the same source_id
@@ -24,6 +24,7 @@
# CHANGES
# 100304-0354 - First Build
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
+# 130328-0016 - Converted ereg to preg functions
#
$api_script = 'deactivate';
@@ -90,13 +91,13 @@ if (preg_match("/$TD$dispo$TD/",$sale_status))
if ($non_latin < 1)
{
- $user=ereg_replace("[^-_0-9a-zA-Z]","",$user);
- $pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass);
+ $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
+ $pass=preg_replace("/[^-_0-9a-zA-Z]/","",$pass);
}
else
{
- $user = ereg_replace("'|\"|\\\\|;","",$user);
- $pass = ereg_replace("'|\"|\\\\|;","",$pass);
+ $user = preg_replace("/\'|\"|\\\\|;/","",$user);
+ $pass = preg_replace("/\'|\"|\\\\|;/","",$pass);
}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
@@ -137,7 +138,7 @@ if (preg_match("/$TD$dispo$TD/",$sale_status))
$duplicate_lists .= "'$row[0]',";
$L++;
}
- $duplicate_lists = eregi_replace(",$",'',$duplicate_lists);
+ $duplicate_lists = preg_replace('/,$/','',$duplicate_lists);
if (strlen($duplicate_lists) < 2) {$duplicate_lists = "''";}
}
@@ -162,7 +163,7 @@ if (preg_match("/$TD$dispo$TD/",$sale_status))
$affected_rows = mysql_affected_rows($link);
$SQL_log = "$stmt|";
- $SQL_log = ereg_replace(';','',$SQL_log);
+ $SQL_log = preg_replace('/;/','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_api_log set user='$user',agent_user='$user',function='deactivate_lead',value='$lead_id',result='$affected_rows',result_reason='$search_field',source='vdc',data='$SQL_log',api_date='$NOW_TIME',api_script='$api_script';";
$rslt=mysql_query($stmt, $link);
diff --git a/www/agc/dispo_move_list.php b/www/agc/dispo_move_list.php
index 7f465b11..eff149c4 100644
--- a/www/agc/dispo_move_list.php
+++ b/www/agc/dispo_move_list.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# This script is designed to be used in the "Dispo URL" field of a campaign
# or in-group. It should take in the lead_id to check for the same lead_id
@@ -31,6 +31,7 @@
# 110702-2020 - Added multiple sets of options
# 111005-1102 - Added check and update for scheduled callback entry
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
+# 130328-0015 - Converted ereg to preg functions
#
$api_script = 'deactivate';
@@ -131,13 +132,13 @@ if ($match_found > 0)
if ($non_latin < 1)
{
- $user=ereg_replace("[^-_0-9a-zA-Z]","",$user);
- $pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass);
+ $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
+ $pass=preg_replace("/[^-_0-9a-zA-Z]/","",$pass);
}
else
{
- $user = ereg_replace("'|\"|\\\\|;","",$user);
- $pass = ereg_replace("'|\"|\\\\|;","",$pass);
+ $user = preg_replace("/\'|\"|\\\\|;/","",$user);
+ $pass = preg_replace("/\'|\"|\\\\|;/","",$pass);
}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
@@ -198,7 +199,7 @@ if ($match_found > 0)
$CBaffected_rows = mysql_affected_rows($link);
$SQL_log = "$stmt|$stmtB|$CBaffected_rows|";
- $SQL_log = ereg_replace(';','',$SQL_log);
+ $SQL_log = preg_replace('/;/','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_api_log set user='$user',agent_user='$user',function='deactivate_lead',value='$lead_id',result='$affected_rows',result_reason='$lead_id',source='vdc',data='$SQL_log',api_date='$NOW_TIME',api_script='$api_script';";
$rslt=mysql_query($stmt, $link);
diff --git a/www/agc/functions.php b/www/agc/functions.php
index cc866913..e9ccc6a8 100644
--- a/www/agc/functions.php
+++ b/www/agc/functions.php
@@ -1,10 +1,10 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
#
# CHANGES:
@@ -14,6 +14,7 @@
# 110719-0858 - Added HIDEBLOB field type
# 110730-2336 - Added call_id variable
# 120213-1709 - Commented out default of READONLY fields since they cannot change
+# 130328-0018 - Converted ereg to preg functions
#
@@ -356,7 +357,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user)
##### BEGIN parsing for vicidial variables #####
if (preg_match("/--A--/",$CFoutput))
{
- if ( (eregi('--A--user_custom_',$CFoutput)) or (eregi('--A--fullname',$CFoutput)) )
+ if ( (preg_match('/--A--user_custom_/i',$CFoutput)) or (preg_match('/--A--fullname/i',$CFoutput)) )
{
$stmt = "select custom_one,custom_two,custom_three,custom_four,custom_five,full_name from vicidial_users where user='$user';";
if ($DB) {echo "$stmt\n";}
@@ -375,7 +376,7 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user)
}
}
- if (eregi('--A--dialed_',$CFoutput))
+ if (preg_match('/--A--dialed_/i',$CFoutput))
{
$dialed_number = $phone_number;
$dialed_label = 'NONE';
@@ -435,69 +436,69 @@ function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user)
$owner = trim($row[33]);
}
- $CFoutput = eregi_replace('--A--lead_id--B--',"$lead_id",$CFoutput);
- $CFoutput = eregi_replace('--A--vendor_id--B--',"$vendor_id",$CFoutput);
- $CFoutput = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$CFoutput);
- $CFoutput = eregi_replace('--A--list_id--B--',"$list_id",$CFoutput);
- $CFoutput = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$CFoutput);
- $CFoutput = eregi_replace('--A--phone_code--B--',"$phone_code",$CFoutput);
- $CFoutput = eregi_replace('--A--phone_number--B--',"$phone_number",$CFoutput);
- $CFoutput = eregi_replace('--A--title--B--',"$title",$CFoutput);
- $CFoutput = eregi_replace('--A--first_name--B--',"$first_name",$CFoutput);
- $CFoutput = eregi_replace('--A--middle_initial--B--',"$middle_initial",$CFoutput);
- $CFoutput = eregi_replace('--A--last_name--B--',"$last_name",$CFoutput);
- $CFoutput = eregi_replace('--A--address1--B--',"$address1",$CFoutput);
- $CFoutput = eregi_replace('--A--address2--B--',"$address2",$CFoutput);
- $CFoutput = eregi_replace('--A--address3--B--',"$address3",$CFoutput);
- $CFoutput = eregi_replace('--A--city--B--',"$city",$CFoutput);
- $CFoutput = eregi_replace('--A--state--B--',"$state",$CFoutput);
- $CFoutput = eregi_replace('--A--province--B--',"$province",$CFoutput);
- $CFoutput = eregi_replace('--A--postal_code--B--',"$postal_code",$CFoutput);
- $CFoutput = eregi_replace('--A--country_code--B--',"$country_code",$CFoutput);
- $CFoutput = eregi_replace('--A--gender--B--',"$gender",$CFoutput);
- $CFoutput = eregi_replace('--A--date_of_birth--B--',"$date_of_birth",$CFoutput);
- $CFoutput = eregi_replace('--A--alt_phone--B--',"$alt_phone",$CFoutput);
- $CFoutput = eregi_replace('--A--email--B--',"$email",$CFoutput);
- $CFoutput = eregi_replace('--A--security_phrase--B--',"$security_phrase",$CFoutput);
- $CFoutput = eregi_replace('--A--comments--B--',"$comments",$CFoutput);
- $CFoutput = eregi_replace('--A--user--B--',"$user",$CFoutput);
- $CFoutput = eregi_replace('--A--pass--B--',"$pass",$CFoutput);
- $CFoutput = eregi_replace('--A--campaign--B--',"$campaign",$CFoutput);
- $CFoutput = eregi_replace('--A--server_ip--B--',"$server_ip",$CFoutput);
- $CFoutput = eregi_replace('--A--session_id--B--',"$session_id",$CFoutput);
- $CFoutput = eregi_replace('--A--dialed_number--B--',"$dialed_number",$CFoutput);
- $CFoutput = eregi_replace('--A--dialed_label--B--',"$dialed_label",$CFoutput);
- $CFoutput = eregi_replace('--A--source_id--B--',"$source_id",$CFoutput);
- $CFoutput = eregi_replace('--A--rank--B--',"$rank",$CFoutput);
- $CFoutput = eregi_replace('--A--owner--B--',"$owner",$CFoutput);
- $CFoutput = eregi_replace('--A--fullname--B--',"$fullname",$CFoutput);
- $CFoutput = eregi_replace('--A--uniqueid--B--',"$uniqueid",$CFoutput);
- $CFoutput = eregi_replace('--A--user_custom_one--B--',"$user_custom_one",$CFoutput);
- $CFoutput = eregi_replace('--A--user_custom_two--B--',"$user_custom_two",$CFoutput);
- $CFoutput = eregi_replace('--A--user_custom_three--B--',"$user_custom_three",$CFoutput);
- $CFoutput = eregi_replace('--A--user_custom_four--B--',"$user_custom_four",$CFoutput);
- $CFoutput = eregi_replace('--A--user_custom_five--B--',"$user_custom_five",$CFoutput);
- $CFoutput = eregi_replace('--A--preset_number_a--B--',"$preset_number_a",$CFoutput);
- $CFoutput = eregi_replace('--A--preset_number_b--B--',"$preset_number_b",$CFoutput);
- $CFoutput = eregi_replace('--A--preset_number_c--B--',"$preset_number_c",$CFoutput);
- $CFoutput = eregi_replace('--A--preset_number_d--B--',"$preset_number_d",$CFoutput);
- $CFoutput = eregi_replace('--A--preset_number_e--B--',"$preset_number_e",$CFoutput);
- $CFoutput = eregi_replace('--A--preset_dtmf_a--B--',"$preset_dtmf_a",$CFoutput);
- $CFoutput = eregi_replace('--A--preset_dtmf_b--B--',"$preset_dtmf_b",$CFoutput);
- $CFoutput = eregi_replace('--A--did_id--B--',"$did_id",$CFoutput);
- $CFoutput = eregi_replace('--A--did_extension--B--',"$did_extension",$CFoutput);
- $CFoutput = eregi_replace('--A--did_pattern--B--',"$did_pattern",$CFoutput);
- $CFoutput = eregi_replace('--A--did_description--B--',"$did_description",$CFoutput);
- $CFoutput = eregi_replace('--A--closecallid--B--',"$closecallid",$CFoutput);
- $CFoutput = eregi_replace('--A--xfercallid--B--',"$xfercallid",$CFoutput);
- $CFoutput = eregi_replace('--A--agent_log_id--B--',"$agent_log_id",$CFoutput);
- $CFoutput = eregi_replace('--A--call_id--B--',"$call_id",$CFoutput);
+ $CFoutput = preg_replace('/--A--lead_id--B--/i',"$lead_id",$CFoutput);
+ $CFoutput = preg_replace('/--A--vendor_id--B--/i',"$vendor_id",$CFoutput);
+ $CFoutput = preg_replace('/--A--vendor_lead_code--B--/i',"$vendor_lead_code",$CFoutput);
+ $CFoutput = preg_replace('/--A--list_id--B--/i',"$list_id",$CFoutput);
+ $CFoutput = preg_replace('/--A--gmt_offset_now--B--/i',"$gmt_offset_now",$CFoutput);
+ $CFoutput = preg_replace('/--A--phone_code--B--/i',"$phone_code",$CFoutput);
+ $CFoutput = preg_replace('/--A--phone_number--B--/i',"$phone_number",$CFoutput);
+ $CFoutput = preg_replace('/--A--title--B--/i',"$title",$CFoutput);
+ $CFoutput = preg_replace('/--A--first_name--B--/i',"$first_name",$CFoutput);
+ $CFoutput = preg_replace('/--A--middle_initial--B--/i',"$middle_initial",$CFoutput);
+ $CFoutput = preg_replace('/--A--last_name--B--/i',"$last_name",$CFoutput);
+ $CFoutput = preg_replace('/--A--address1--B--/i',"$address1",$CFoutput);
+ $CFoutput = preg_replace('/--A--address2--B--/i',"$address2",$CFoutput);
+ $CFoutput = preg_replace('/--A--address3--B--/i',"$address3",$CFoutput);
+ $CFoutput = preg_replace('/--A--city--B--/i',"$city",$CFoutput);
+ $CFoutput = preg_replace('/--A--state--B--/i',"$state",$CFoutput);
+ $CFoutput = preg_replace('/--A--province--B--/i',"$province",$CFoutput);
+ $CFoutput = preg_replace('/--A--postal_code--B--/i',"$postal_code",$CFoutput);
+ $CFoutput = preg_replace('/--A--country_code--B--/i',"$country_code",$CFoutput);
+ $CFoutput = preg_replace('/--A--gender--B--/i',"$gender",$CFoutput);
+ $CFoutput = preg_replace('/--A--date_of_birth--B--/i',"$date_of_birth",$CFoutput);
+ $CFoutput = preg_replace('/--A--alt_phone--B--/i',"$alt_phone",$CFoutput);
+ $CFoutput = preg_replace('/--A--email--B--/i',"$email",$CFoutput);
+ $CFoutput = preg_replace('/--A--security_phrase--B--/i',"$security_phrase",$CFoutput);
+ $CFoutput = preg_replace('/--A--comments--B--/i',"$comments",$CFoutput);
+ $CFoutput = preg_replace('/--A--user--B--/i',"$user",$CFoutput);
+ $CFoutput = preg_replace('/--A--pass--B--/i',"$pass",$CFoutput);
+ $CFoutput = preg_replace('/--A--campaign--B--/i',"$campaign",$CFoutput);
+ $CFoutput = preg_replace('/--A--server_ip--B--/i',"$server_ip",$CFoutput);
+ $CFoutput = preg_replace('/--A--session_id--B--/i',"$session_id",$CFoutput);
+ $CFoutput = preg_replace('/--A--dialed_number--B--/i',"$dialed_number",$CFoutput);
+ $CFoutput = preg_replace('/--A--dialed_label--B--/i',"$dialed_label",$CFoutput);
+ $CFoutput = preg_replace('/--A--source_id--B--/i',"$source_id",$CFoutput);
+ $CFoutput = preg_replace('/--A--rank--B--/i',"$rank",$CFoutput);
+ $CFoutput = preg_replace('/--A--owner--B--/i',"$owner",$CFoutput);
+ $CFoutput = preg_replace('/--A--fullname--B--/i',"$fullname",$CFoutput);
+ $CFoutput = preg_replace('/--A--uniqueid--B--/i',"$uniqueid",$CFoutput);
+ $CFoutput = preg_replace('/--A--user_custom_one--B--/i',"$user_custom_one",$CFoutput);
+ $CFoutput = preg_replace('/--A--user_custom_two--B--/i',"$user_custom_two",$CFoutput);
+ $CFoutput = preg_replace('/--A--user_custom_three--B--/i',"$user_custom_three",$CFoutput);
+ $CFoutput = preg_replace('/--A--user_custom_four--B--/i',"$user_custom_four",$CFoutput);
+ $CFoutput = preg_replace('/--A--user_custom_five--B--/i',"$user_custom_five",$CFoutput);
+ $CFoutput = preg_replace('/--A--preset_number_a--B--/i',"$preset_number_a",$CFoutput);
+ $CFoutput = preg_replace('/--A--preset_number_b--B--/i',"$preset_number_b",$CFoutput);
+ $CFoutput = preg_replace('/--A--preset_number_c--B--/i',"$preset_number_c",$CFoutput);
+ $CFoutput = preg_replace('/--A--preset_number_d--B--/i',"$preset_number_d",$CFoutput);
+ $CFoutput = preg_replace('/--A--preset_number_e--B--/i',"$preset_number_e",$CFoutput);
+ $CFoutput = preg_replace('/--A--preset_dtmf_a--B--/i',"$preset_dtmf_a",$CFoutput);
+ $CFoutput = preg_replace('/--A--preset_dtmf_b--B--/i',"$preset_dtmf_b",$CFoutput);
+ $CFoutput = preg_replace('/--A--did_id--B--/i',"$did_id",$CFoutput);
+ $CFoutput = preg_replace('/--A--did_extension--B--/i',"$did_extension",$CFoutput);
+ $CFoutput = preg_replace('/--A--did_pattern--B--/i',"$did_pattern",$CFoutput);
+ $CFoutput = preg_replace('/--A--did_description--B--/i',"$did_description",$CFoutput);
+ $CFoutput = preg_replace('/--A--closecallid--B--/i',"$closecallid",$CFoutput);
+ $CFoutput = preg_replace('/--A--xfercallid--B--/i',"$xfercallid",$CFoutput);
+ $CFoutput = preg_replace('/--A--agent_log_id--B--/i',"$agent_log_id",$CFoutput);
+ $CFoutput = preg_replace('/--A--call_id--B--/i',"$call_id",$CFoutput);
# custom fields replacement
$o=0;
while ($fields_to_print > $o)
{
- $CFoutput = eregi_replace("--A--$A_field_label[$o]--B--","$A_field_value[$o]",$CFoutput);
+ $CFoutput = preg_replace("/--A--$A_field_label[$o]--B--/i","$A_field_value[$o]",$CFoutput);
$o++;
}
@@ -520,7 +521,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
require("dbconnect.php");
$postalgmt_found=0;
- if ( (eregi("POSTAL",$postalgmt)) && (strlen($postal_code)>4) )
+ if ( (preg_match("/POSTAL/i",$postalgmt)) && (strlen($postal_code)>4) )
{
if (preg_match('/^1$/', $phone_code))
{
@@ -530,7 +531,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0)
{
$row=mysql_fetch_row($rslt);
- $gmt_offset = $row[2]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
+ $gmt_offset = $row[2]; $gmt_offset = preg_replace("/\+/i","",$gmt_offset);
$dst = $row[3];
$dst_range = $row[4];
$PC_processed++;
@@ -551,7 +552,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0)
{
$row=mysql_fetch_row($rslt);
- $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
+ $gmt_offset = $row[4]; $gmt_offset = preg_replace("/\+/i","",$gmt_offset);
$dst = $row[5];
$dst_range = $row[6];
$PC_processed++;
@@ -566,7 +567,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0)
{
$row=mysql_fetch_row($rslt);
- $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
+ $gmt_offset = $row[4]; $gmt_offset = preg_replace("/\+/i","",$gmt_offset);
$dst = $row[5];
$dst_range = $row[6];
$PC_processed++;
@@ -581,7 +582,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0)
{
$row=mysql_fetch_row($rslt);
- $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
+ $gmt_offset = $row[4]; $gmt_offset = preg_replace("/\+/i","",$gmt_offset);
$dst = $row[5];
$dst_range = $row[6];
$PC_processed++;
@@ -597,7 +598,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0)
{
$row=mysql_fetch_row($rslt);
- $gmt_offset = $row[4]; $gmt_offset = eregi_replace("\+","",$gmt_offset);
+ $gmt_offset = $row[4]; $gmt_offset = preg_replace("/\+/i","",$gmt_offset);
$dst = $row[5];
$dst_range = $row[6];
$PC_processed++;
diff --git a/www/agc/inbound_popup.php b/www/agc/inbound_popup.php
index 3ebb6c58..a85c47a2 100644
--- a/www/agc/inbound_popup.php
+++ b/www/agc/inbound_popup.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# This script is designed to open up when a live_inbound call comes in giving the user
# options of what to do with the call or options to lookup the callerID on various web sites
@@ -31,6 +31,7 @@
# 60421-1043 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60619-1205 - Added variable filters to close security holes for login form
# 90508-0727 - Changed to PHP long tags
+# 130328-0025 - Converted ereg to preg functions
#
require("dbconnect.php");
@@ -63,20 +64,20 @@ if (isset($_GET["local_web_callerID_URL_enc"])) {$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 = '';}
-$user=ereg_replace("[^0-9a-zA-Z]","",$user);
-$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
+$user=preg_replace("/[^0-9a-zA-Z]/","",$user);
+$pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
# default optional vars if not set
if (!isset($format)) {$format="text";}
-$version = '0.0.6';
-$build = '60619-1205';
+$version = '0.0.7';
+$build = '130328-0025';
$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;}
$DO = '-1';
-if ( (eregi("^Zap",$channel)) and (!eregi("-",$channel)) ) {$channel = "$channel$DO";}
+if ( (preg_match("/^Zap/i",$channel)) and (!preg_match("/-/i",$channel)) ) {$channel = "$channel$DO";}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
if ($DB) {echo "|$stmt|\n";}
@@ -121,7 +122,7 @@ if ($format=='debug')
$forever_stop=0;
$user_abb = "$user$user$user$user";
while ( (strlen($user_abb) > 4) and ($forever_stop < 200) )
- {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;}
+ {$user_abb = preg_replace("/^./i","",$user_abb); $forever_stop++;}
echo "\n";
echo "\n";
@@ -286,8 +287,8 @@ else
echo "
CallerID:
$row[3]
\n";
echo "
\n";
- $phone = eregi_replace(".*\<","",$row[3]);
- $phone = eregi_replace("\>.*","",$phone);
+ $phone = preg_replace("/.*\.*/i","",$phone);
$NPA = substr($phone, 0, 3);
$NXX = substr($phone, 3, 3);
$XXXX = substr($phone, 6, 4);
diff --git a/www/agc/live_exten_check.php b/www/agc/live_exten_check.php
index a4e9036d..4803719c 100644
--- a/www/agc/live_exten_check.php
+++ b/www/agc/live_exten_check.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# This script is designed purely to send whether the client channel is live and to what channel it is connected
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -30,6 +30,7 @@
# 60619-1203 - Added variable filters to close security holes for login form
# 60825-1029 - Fixed translation variable issue ChannelA
# 90508-0727 - Changed to PHP long tags
+# 130328-0027 - Converted ereg to preg functions
#
require("dbconnect.php");
@@ -54,14 +55,14 @@ if (isset($_GET["favorites_count"])) {$favorites_count=$_GET["favorites_count
if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];}
elseif (isset($_POST["favorites_list"])) {$favorites_list=$_POST["favorites_list"];}
-$user=ereg_replace("[^0-9a-zA-Z]","",$user);
-$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
+$user=preg_replace("/[^0-9a-zA-Z]/","",$user);
+$pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
# default optional vars if not set
if (!isset($format)) {$format="text";}
-$version = '2.0.1';
-$build = '60825-1029';
+$version = '2.6-13';
+$build = '130328-0027';
$StarTtime = date("U");
$NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
@@ -73,14 +74,13 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
$row=mysql_fetch_row($rslt);
$auth=$row[0];
- if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
+if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
{
echo "Invalid Username/Password: |$user|$pass|\n";
exit;
}
- else
+else
{
-
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
{
echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n";
@@ -93,12 +93,12 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
$rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
$SNauth=$row[0];
- if($SNauth==0)
+ if($SNauth==0)
{
echo "Invalid session_name: |$session_name|$server_ip|\n";
exit;
}
- else
+ else
{
# do nothing for now
}
@@ -106,15 +106,15 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
}
if ($format=='debug')
-{
-echo "\n";
-echo "\n";
-echo "\n";
-echo "Live Extension Check";
-echo "\n";
-echo "\n";
-echo "\n";
-}
+ {
+ echo "\n";
+ echo "\n";
+ echo "\n";
+ echo "Live Extension Check";
+ echo "\n";
+ echo "\n";
+ echo "\n";
+ }
echo "DateTime: $NOW_TIME|";
@@ -126,16 +126,16 @@ $rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt);
echo "$row[0]|";
- $MT[0]='';
- $row=''; $rowx='';
- $channel_live=1;
- if ( (strlen($exten)<1) or (strlen($protocol)<3) )
+$MT[0]='';
+$row=''; $rowx='';
+$channel_live=1;
+if ( (strlen($exten)<1) or (strlen($protocol)<3) )
{
$channel_live=0;
echo "Exten $exten is not valid or protocol $protocol is not valid\n";
exit;
}
- else
+else
{
$stmt="SELECT channel,extension FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$protocol/$exten%\";";
if ($format=='debug') {echo "\n";}
@@ -143,7 +143,7 @@ echo "$row[0]|";
if ($rslt) {$channels_list = mysql_num_rows($rslt);}
echo "$channels_list|";
$loop_count=0;
- while ($channels_list>$loop_count)
+ while ($channels_list>$loop_count)
{
$loop_count++;
$row=mysql_fetch_row($rslt);
@@ -153,15 +153,15 @@ echo "$row[0]|";
}
}
- $counter=0;
- while($loop_count > $counter)
+$counter=0;
+while($loop_count > $counter)
{
$counter++;
$stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';";
if ($format=='debug') {echo "\n";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$trunk_count = mysql_num_rows($rslt);}
- if ($trunk_count>0)
+ if ($trunk_count>0)
{
$row=mysql_fetch_row($rslt);
echo "Conversation: $counter ~";
@@ -169,13 +169,13 @@ echo "$row[0]|";
echo "ChannelB: $ChanneLB[$counter] ~";
echo "ChannelBtrunk: $row[0]|";
}
- else
+ else
{
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel_data = '$ChanneLA[$counter]';";
if ($format=='debug') {echo "\n";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$trunk_count = mysql_num_rows($rslt);}
- if ($trunk_count>0)
+ if ($trunk_count>0)
{
$row=mysql_fetch_row($rslt);
echo "Conversation: $counter ~";
@@ -183,13 +183,13 @@ echo "$row[0]|";
echo "ChannelB: $ChanneLB[$counter] ~";
echo "ChannelBtrunk: $row[0]|";
}
- else
+ else
{
$stmt="SELECT channel FROM live_sip_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";";
if ($format=='debug') {echo "\n";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$trunk_count = mysql_num_rows($rslt);}
- if ($trunk_count>0)
+ if ($trunk_count>0)
{
$row=mysql_fetch_row($rslt);
echo "Conversation: $counter ~";
@@ -197,13 +197,13 @@ echo "$row[0]|";
echo "ChannelB: $ChanneLB[$counter] ~";
echo "ChannelBtrunk: $row[0]|";
}
- else
+ else
{
$stmt="SELECT channel FROM live_channels where server_ip = '$server_ip' and channel LIKE \"$ChanneLB[$counter]%\";";
if ($format=='debug') {echo "\n";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$trunk_count = mysql_num_rows($rslt);}
- if ($trunk_count>0)
+ if ($trunk_count>0)
{
$row=mysql_fetch_row($rslt);
echo "Conversation: $counter ~";
@@ -211,7 +211,7 @@ echo "$row[0]|";
echo "ChannelB: $ChanneLB[$counter] ~";
echo "ChannelBtrunk: $row[0]|";
}
- else
+ else
{
echo "Conversation: $counter ~";
echo "ChannelA: $ChanneLA[$counter] ~";
@@ -230,7 +230,7 @@ $stmt="select * from live_inbound where server_ip = '$server_ip' and phone_ext =
if ($format=='debug') {echo "\n";}
$rslt=mysql_query($stmt, $link);
if ($rslt) {$channels_list = mysql_num_rows($rslt);}
- if ($channels_list>0)
+if ($channels_list>0)
{
$row=mysql_fetch_row($rslt);
$LIuniqueid = "$row[0]";
diff --git a/www/agc/manager_send.php b/www/agc/manager_send.php
index 97f77e61..ac937500 100644
--- a/www/agc/manager_send.php
+++ b/www/agc/manager_send.php
@@ -113,10 +113,11 @@
# 120831-1458 - Added vicidial_dial_log outbound call logging
# 121120-0848 - Added QM socket-send functionality
# 130108-1641 - Change for Asterisk 1.8 compatibility
+# 130328-0008 - Converted ereg to preg functions
#
-$version = '2.6-60';
-$build = '130108-1641';
+$version = '2.6-61';
+$build = '130328-0008';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=119;
$one_mysql_log=0;
@@ -237,14 +238,14 @@ if ($qm_conf_ct > 0)
if ($non_latin < 1)
{
- $user=ereg_replace("[^-_0-9a-zA-Z]","",$user);
- $pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass);
- $secondS = ereg_replace("[^0-9]","",$secondS);
+ $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
+ $pass=preg_replace("/[^-_0-9a-zA-Z]/","",$pass);
+ $secondS = preg_replace("/[^0-9]/","",$secondS);
}
else
{
- $user = ereg_replace("'|\"|\\\\|;","",$user);
- $pass = ereg_replace("'|\"|\\\\|;","",$pass);
+ $user = preg_replace("/\'|\"|\\\\|;/","",$user);
+ $pass = preg_replace("/\'|\"|\\\\|;/","",$pass);
}
@@ -419,7 +420,7 @@ if ($ACTION=="OriginateNameVmail")
if ($ACTION=="OriginateVDRelogin")
{
- if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (eregi("SIP",$protocol)) )
+ if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (preg_match("/SIP/i",$protocol)) )
{
$CIDdate = date("ymdHis");
$DS='-';
@@ -440,7 +441,7 @@ if ($ACTION=="Originate")
}
else
{
- if ( (eregi('MANUAL',$agent_dialed_type)) and ( (preg_match("/^\d860\d\d\d\d$/i",$exten)) or (preg_match("/^860\d\d\d\d$/i",$exten)) ) )
+ if ( (preg_match('/MANUAL/i',$agent_dialed_type)) and ( (preg_match("/^\d860\d\d\d\d$/i",$exten)) or (preg_match("/^860\d\d\d\d$/i",$exten)) ) )
{
echo "ERROR You are not allowed to dial into other agent sessions $exten\n";
exit;
@@ -540,7 +541,7 @@ if ($ACTION=="HangupConfDial")
$rowx=mysql_fetch_row($rslt);
$channel=$rowx[0];
$ACTION="Hangup";
- $queryCID = eregi_replace("^.","G",$queryCID); # GTvdcW...
+ $queryCID = preg_replace("/^./i","G",$queryCID); # GTvdcW...
}
}
}
@@ -1331,7 +1332,7 @@ if ($ACTION=="RedirectXtraCXNeW")
$row=''; $rowx='';
$channel_liveX=1;
$channel_liveY=1;
- if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) )
+ if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!preg_match("/NEXTAVAILABLE/",$exten)) ) )
{
$channel_liveX=0;
$channel_liveY=0;
@@ -1343,7 +1344,7 @@ if ($ACTION=="RedirectXtraCXNeW")
echo "ext_context $ext_context must be set\n";
echo "ext_priority $ext_priority must be set\n";
echo "\nRedirect Action not sent\n";
- if (ereg("SECOND|FIRST|DEBUG",$filename))
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename))
{
if ($WeBRooTWritablE > 0)
{
@@ -1355,7 +1356,7 @@ if ($ACTION=="RedirectXtraCXNeW")
}
else
{
- if (ereg("NEXTAVAILABLE",$exten))
+ if (preg_match("/NEXTAVAILABLE/",$exten))
{
$stmtA="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';";
if ($format=='debug') {echo "\n";}
@@ -1376,7 +1377,7 @@ if ($ACTION=="RedirectXtraCXNeW")
$row=mysql_fetch_row($rslt);
$exten = $row[0];
- if ( (ereg("^8300",$extension)) and ($protocol == 'Local') )
+ if ( (preg_match("/^8300/i",$extension)) and ($protocol == 'Local') )
{
$extension = "$extension$user";
}
@@ -1423,7 +1424,7 @@ if ($ACTION=="RedirectXtraCXNeW")
{
$channel_liveX=0;
echo "Cannot find empty vicidial_conference on $server_ip, Redirect command not inserted\n|$stmt|";
- if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Cannot find empty conference on $server_ip";}
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename)) {$DBout .= "Cannot find empty conference on $server_ip";}
}
}
@@ -1445,7 +1446,7 @@ if ($ACTION=="RedirectXtraCXNeW")
{
$channel_liveX=0;
echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n";
- if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $call_server_ip";}
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename)) {$DBout .= "$channel is not live on $call_server_ip";}
}
}
$stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';";
@@ -1464,7 +1465,7 @@ if ($ACTION=="RedirectXtraCXNeW")
{
$channel_liveY=0;
echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n";
- if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $server_ip";}
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename)) {$DBout .= "$channel is not live on $server_ip";}
}
}
if ( ($channel_liveX==1) and ($channel_liveY==1) )
@@ -1478,7 +1479,7 @@ if ($ACTION=="RedirectXtraCXNeW")
{
$channel_liveY=0;
echo "No Local agent to send call to, Redirect command not inserted\n";
- if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "No Local agent to send call to";}
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename)) {$DBout .= "No Local agent to send call to";}
}
else
{
@@ -1514,7 +1515,7 @@ if ($ACTION=="RedirectXtraCXNeW")
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02044',$user,$server_ip,$session_name,$one_mysql_log);}
echo "RedirectXtraCX command sent for Channel $channel on $call_server_ip and \nHungup $extrachannel on $server_ip\n";
- if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel on $call_server_ip, Hungup $extrachannel on $server_ip";}
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename)) {$DBout .= "$channel on $call_server_ip, Hungup $extrachannel on $server_ip";}
}
}
else
@@ -1523,10 +1524,10 @@ if ($ACTION=="RedirectXtraCXNeW")
{$ACTION="Redirect"; $server_ip = $call_server_ip;}
if ($channel_liveY==1)
{$ACTION="Redirect"; $channel=$extrachannel;}
- if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Changed to Redirect: $channel on $server_ip";}
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename)) {$DBout .= "Changed to Redirect: $channel on $server_ip";}
}
- if (ereg("SECOND|FIRST|DEBUG",$filename))
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename))
{
if ($WeBRooTWritablE > 0)
{
@@ -1556,7 +1557,7 @@ if ($ACTION=="RedirectXtraNeW")
$row=''; $rowx='';
$channel_liveX=1;
$channel_liveY=1;
- if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!ereg("NEXTAVAILABLE",$exten)) ) )
+ if ( (strlen($channel)<3) or (strlen($queryCID)<15) or (strlen($ext_context)<1) or (strlen($ext_priority)<1) or (strlen($session_id)<3) or ( ( (strlen($extrachannel)<3) or (strlen($exten)<1) ) and (!preg_match("/NEXTAVAILABLE/",$exten)) ) )
{
$channel_liveX=0;
$channel_liveY=0;
@@ -1569,7 +1570,7 @@ if ($ACTION=="RedirectXtraNeW")
echo "ext_priority $ext_priority must be set\n";
echo "session_id $session_id must be set\n";
echo "\nRedirect Action not sent\n";
- if (ereg("SECOND|FIRST|DEBUG",$filename))
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename))
{
if ($WeBRooTWritablE > 0)
{
@@ -1581,7 +1582,7 @@ if ($ACTION=="RedirectXtraNeW")
}
else
{
- if (ereg("NEXTAVAILABLE",$exten))
+ if (preg_match("/NEXTAVAILABLE/",$exten))
{
$stmt="SELECT count(*) FROM vicidial_conferences where server_ip='$server_ip' and ((extension='') or (extension is null)) and conf_exten != '$session_id';";
if ($format=='debug') {echo "\n";}
@@ -1640,7 +1641,7 @@ if ($ACTION=="RedirectXtraNeW")
{
$channel_liveX=0;
echo "Cannot find empty vicidial_conference on $server_ip, Redirect command not inserted\n|$stmt|";
- if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "Cannot find empty conference on $server_ip";}
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename)) {$DBout .= "Cannot find empty conference on $server_ip";}
}
}
@@ -1651,7 +1652,7 @@ if ($ACTION=="RedirectXtraNeW")
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02053',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
- if ( ($row[0]==0) and (!ereg("SECOND",$filename)) )
+ if ( ($row[0]==0) and (!preg_match("/SECOND/",$filename)) )
{
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$call_server_ip' and channel='$channel';";
if ($format=='debug') {echo "\n";}
@@ -1662,7 +1663,7 @@ if ($ACTION=="RedirectXtraNeW")
{
$channel_liveX=0;
echo "Channel $channel is not live on $call_server_ip, Redirect command not inserted\n";
- if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $call_server_ip";}
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename)) {$DBout .= "$channel is not live on $call_server_ip";}
}
}
$stmt="SELECT count(*) FROM live_channels where server_ip = '$server_ip' and channel='$extrachannel';";
@@ -1670,7 +1671,7 @@ if ($ACTION=="RedirectXtraNeW")
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02055',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
- if ( ($row[0]==0) and (!ereg("SECOND",$filename)) )
+ if ( ($row[0]==0) and (!preg_match("/SECOND/",$filename)) )
{
$stmt="SELECT count(*) FROM live_sip_channels where server_ip = '$server_ip' and channel='$extrachannel';";
if ($format=='debug') {echo "\n";}
@@ -1681,7 +1682,7 @@ if ($ACTION=="RedirectXtraNeW")
{
$channel_liveY=0;
echo "Channel $channel is not live on $server_ip, Redirect command not inserted\n";
- if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel is not live on $server_ip";}
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename)) {$DBout .= "$channel is not live on $server_ip";}
}
}
if ( ($channel_liveX==1) and ($channel_liveY==1) )
@@ -1694,7 +1695,7 @@ if ($ACTION=="RedirectXtraNeW")
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02057',$user,$server_ip,$session_name,$one_mysql_log);}
echo "RedirectXtra command sent for Channel $channel and \nExtraChannel $extrachannel\n to $exten on $server_ip\n";
- if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel and $extrachannel to $exten on $server_ip";}
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename)) {$DBout .= "$channel and $extrachannel to $exten on $server_ip";}
}
else
{
@@ -1721,7 +1722,7 @@ if ($ACTION=="RedirectXtraNeW")
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02059',$user,$server_ip,$session_name,$one_mysql_log);}
echo "RedirectXtra command sent for Channel $channel on $call_server_ip and \nExtraChannel $extrachannel\n to $exten on $server_ip\n";
- if (ereg("SECOND|FIRST|DEBUG",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";}
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename)) {$DBout .= "$channel/$call_server_ip and $extrachannel/$server_ip to $exten";}
}
}
else
@@ -1732,7 +1733,7 @@ if ($ACTION=="RedirectXtraNeW")
{$ACTION="Redirect"; $channel=$extrachannel;}
}
- if (ereg("SECOND|FIRST|DEBUG",$filename))
+ if (preg_match("/SECOND|FIRST|DEBUG/",$filename))
{
if ($WeBRooTWritablE > 0)
{
@@ -1771,8 +1772,8 @@ if ($ACTION=="Redirect")
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02061',$user,$server_ip,$session_name,$one_mysql_log);}
$rowx=mysql_fetch_row($rslt);
$channel=$rowx[0];
- $channel = eregi_replace("1$","2",$channel);
- $queryCID = eregi_replace("^.","Q",$queryCID);
+ $channel = preg_replace("/1$/i","2",$channel);
+ $queryCID = preg_replace("/^./i","Q",$queryCID);
}
}
@@ -2095,10 +2096,10 @@ if ($ACTION=="VolumeControl")
else
{
$participant_number='XXYYXXYYXXYYXX';
- if (eregi('UP',$stage)) {$vol_prefix='4';}
- if (eregi('DOWN',$stage)) {$vol_prefix='3';}
- if (eregi('UNMUTE',$stage)) {$vol_prefix='2';}
- if (eregi('MUTING',$stage)) {$vol_prefix='1';}
+ if (preg_match('/UP/i',$stage)) {$vol_prefix='4';}
+ if (preg_match('/DOWN/i',$stage)) {$vol_prefix='3';}
+ if (preg_match('/UNMUTE/i',$stage)) {$vol_prefix='2';}
+ if (preg_match('/MUTING/i',$stage)) {$vol_prefix='1';}
$local_DEF = 'Local/';
$local_AMP = '@';
$volume_local_channel = "$local_DEF$participant_number$vol_prefix$exten$local_AMP$ext_context";
diff --git a/www/agc/park_calls_display.php b/www/agc/park_calls_display.php
index 55e975df..927eae14 100644
--- a/www/agc/park_calls_display.php
+++ b/www/agc/park_calls_display.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# This script is designed purely to send the details on the parked calls on the server
# This script depends on the server_ip being sent and also needs to have a valid user/pass from the vicidial_users table
@@ -23,6 +23,7 @@
# 60421-1111 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60619-1205 - Added variable filters to close security holes for login form
# 90508-0727 - Changed to PHP long tags
+# 130328-0024 - Converted ereg to preg functions
#
require("dbconnect.php");
@@ -43,8 +44,8 @@ if (isset($_GET["exten"])) {$exten=$_GET["exten"];}
if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];}
elseif (isset($_POST["protocol"])) {$protocol=$_POST["protocol"];}
-$user=ereg_replace("[^0-9a-zA-Z]","",$user);
-$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
+$user=preg_replace("/[^0-9a-zA-Z]/","",$user);
+$pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
# default optional vars if not set
if (!isset($format)) {$format="text";}
diff --git a/www/agc/phone_only.php b/www/agc/phone_only.php
index 4ae0fdf8..987e2c79 100644
--- a/www/agc/phone_only.php
+++ b/www/agc/phone_only.php
@@ -8,10 +8,11 @@
# 110526-1757 - Added webphone_auto_answer option
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
# 130123-1923 - Added ability to use user-login-first options.php option
+# 130328-0005 - Converted ereg to preg functions
#
-$version = '2.6-4p';
-$build = '130123-1923';
+$version = '2.6-5p';
+$build = '130328-0005';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=73;
$one_mysql_log=0;
@@ -48,11 +49,11 @@ if (!isset($flag_channels))
}
### security strip all non-alphanumeric characters out of the variables ###
-$DB=ereg_replace("[^0-9a-z]","",$DB);
-$phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login);
-$phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass);
-$VD_login=ereg_replace("[^-_0-9a-zA-Z]","",$VD_login);
-$VD_pass=ereg_replace("[^-_0-9a-zA-Z]","",$VD_pass);
+$DB=preg_replace("[^0-9a-z]","",$DB);
+$phone_login=preg_replace("/[^\,0-9a-zA-Z]/","",$phone_login);
+$phone_pass=preg_replace("/[^0-9a-zA-Z]/","",$phone_pass);
+$VD_login=preg_replace("/[^-_0-9a-zA-Z]/","",$VD_login);
+$VD_pass=preg_replace("/[^-_0-9a-zA-Z]/","",$VD_pass);
$forever_stop=0;
@@ -146,12 +147,12 @@ $browser = getenv("HTTP_USER_AGENT");
$script_name = getenv("SCRIPT_NAME");
$server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT");
-if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';}
+if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';}
if (($server_port == '80') or ($server_port == '443') ) {$server_port='';}
else {$server_port = "$CL$server_port";}
$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name";
-$agcDIR = eregi_replace('phone_only.php','',$agcPAGE);
+$agcDIR = preg_replace('/phone_only\.php/i','',$agcPAGE);
if (strlen($static_agent_url) > 5)
{$agcPAGE = $static_agent_url;}
@@ -371,7 +372,7 @@ else
}
$user_abb = "$VD_login$VD_login$VD_login$VD_login";
while ( (strlen($user_abb) > 4) and ($forever_stop < 200) )
- {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;}
+ {$user_abb = preg_replace("/^./i","",$user_abb); $forever_stop++;}
}
else
@@ -450,7 +451,7 @@ else
}
$pa=0;
- if ( (eregi(',',$phone_login)) and (strlen($phone_login) > 2) )
+ if ( (preg_match('/,/',$phone_login)) and (strlen($phone_login) > 2) )
{
$phoneSQL = "(";
$phones_auto = explode(',',$phone_login);
@@ -691,13 +692,13 @@ else
}
$SIP_user = "$protocol/$extension";
$SIP_user_DiaL = "$protocol/$extension";
- if ( (ereg('8300',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') )
+ if ( (preg_match('/8300/',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') )
{
$SIP_user = "$protocol/$extension$VD_login";
}
- $session_ext = eregi_replace("[^a-z0-9]", "", $extension);
+ $session_ext = preg_replace("/[^a-z0-9]/i", "", $extension);
if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);}
$session_rand = (rand(1,9999999) + 10000000);
$session_name = "$StarTtimE$US$session_ext$session_rand";
@@ -797,7 +798,7 @@ else
$webphone_content = "";
}
- if (ereg('MSIE',$browser))
+ if (preg_match('/MSIE/',$browser))
{
$useIE=1;
echo "\n";
diff --git a/www/agc/timeclock.php b/www/agc/timeclock.php
index 1627bd92..57a5dc20 100644
--- a/www/agc/timeclock.php
+++ b/www/agc/timeclock.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# CHANGELOG
# 80523-0134 - First Build
@@ -10,10 +10,11 @@
# 80602-0641 - Fixed status update bug
# 90508-0727 - Changed to PHP long tags
# 100621-1023 - Added admin_web_directory variable
+# 130328-0021 - Converted ereg to preg functions
#
-$version = '2.2.0-6';
-$build = '100621-1023';
+$version = '2.6-7';
+$build = '130328-0021';
$StarTtimE = date("U");
$NOW_TIME = date("Y-m-d H:i:s");
@@ -29,12 +30,12 @@ $browser = getenv("HTTP_USER_AGENT");
$script_name = getenv("SCRIPT_NAME");
$server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT");
-if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';}
+if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';}
if (($server_port == '80') or ($server_port == '443') ) {$server_port='';}
else {$server_port = "$CL$server_port";}
$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name";
-$agcDIR = eregi_replace('timeclock.php','',$agcPAGE);
+$agcDIR = preg_replace('/timeclock\.php/i','',$agcPAGE);
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
@@ -72,17 +73,17 @@ if (!isset($phone_pass))
}
### security strip all non-alphanumeric characters out of the variables ###
- $DB=ereg_replace("[^0-9a-z]","",$DB);
- $phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login);
- $phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass);
- $VD_login=ereg_replace("[^0-9a-zA-Z]","",$VD_login);
- $VD_pass=ereg_replace("[^0-9a-zA-Z]","",$VD_pass);
- $VD_campaign=ereg_replace("[^0-9a-zA-Z_]","",$VD_campaign);
- $user=ereg_replace("[^0-9a-zA-Z]","",$user);
- $pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
- $stage=ereg_replace("[^0-9a-zA-Z]","",$stage);
- $commit=ereg_replace("[^0-9a-zA-Z]","",$commit);
- $referrer=ereg_replace("[^0-9a-zA-Z]","",$referrer);
+ $DB=preg_replace("/[^0-9a-z]/","",$DB);
+ $phone_login=preg_replace("/[^\,0-9a-zA-Z]/","",$phone_login);
+ $phone_pass=preg_replace("/[^0-9a-zA-Z]/","",$phone_pass);
+ $VD_login=preg_replace("/[^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);
+ $user=preg_replace("/[^0-9a-zA-Z]/","",$user);
+ $pass=preg_replace("/[^0-9a-zA-Z]/","",$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);
require("dbconnect.php");
diff --git a/www/agc/vdc_call_url_test.php b/www/agc/vdc_call_url_test.php
index 080d86de..5eb788ad 100644
--- a/www/agc/vdc_call_url_test.php
+++ b/www/agc/vdc_call_url_test.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# This script is designed display and log the start_call_url and dispo_call_url
# queries if activated
@@ -9,10 +9,11 @@
# CHANGELOG:
# 100103-1317 - First build of script
# 100113-2023 - Added dispo_name
+# 130328-0023 - Converted ereg to preg functions
#
-$version = '2.2.0-2';
-$build = '100113-2023';
+$version = '2.6-3';
+$build = '130328-0023';
require("dbconnect.php");
@@ -185,16 +186,16 @@ if ($qm_conf_ct > 0)
if ($non_latin < 1)
{
- $user=ereg_replace("[^-_0-9a-zA-Z]","",$user);
- $pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass);
- $length_in_sec = ereg_replace("[^0-9]","",$length_in_sec);
- $phone_code = ereg_replace("[^0-9]","",$phone_code);
- $phone_number = ereg_replace("[^0-9]","",$phone_number);
+ $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
+ $pass=preg_replace("/[^-_0-9a-zA-Z]/","",$pass);
+ $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);
}
else
{
- $user = ereg_replace("'|\"|\\\\|;","",$user);
- $pass = ereg_replace("'|\"|\\\\|;","",$pass);
+ $user = preg_replace("/\'|\"|\\\\|;/","",$user);
+ $pass = preg_replace("/\'|\"|\\\\|;/","",$pass);
}
diff --git a/www/agc/vdc_db_query.php b/www/agc/vdc_db_query.php
index 59b537c3..7944e039 100644
--- a/www/agc/vdc_db_query.php
+++ b/www/agc/vdc_db_query.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# This script is designed to exchange information between vicidial.php and the database server for various actions
#
@@ -323,10 +323,11 @@
# 121206-0635 - Added inbound lead search feature
# 121214-2208 - Added inbound email features
# 121223-1627 - Fixed issue with manual alt dial manual dial filter
+# 130328-0009 - Converted ereg to preg functions
#
-$version = '2.6-221';
-$build = '121223-1627';
+$version = '2.6-222';
+$build = '130328-0009';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=533;
$one_mysql_log=0;
@@ -602,7 +603,7 @@ if ($gmt_recs > 0)
else
{
$SERVER_GMT = date("O");
- $SERVER_GMT = eregi_replace("\+","",$SERVER_GMT);
+ $SERVER_GMT = preg_replace("/\+/i","",$SERVER_GMT);
$SERVER_GMT = ($SERVER_GMT + 0);
$SERVER_GMT = ($SERVER_GMT / 100);
}
@@ -690,22 +691,22 @@ if ($qm_conf_ct > 0)
if ($non_latin < 1)
{
- $user=ereg_replace("[^-_0-9a-zA-Z]","",$user);
- $pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass);
- $length_in_sec = ereg_replace("[^0-9]","",$length_in_sec);
- $phone_code = ereg_replace("[^0-9]","",$phone_code);
- $phone_number = ereg_replace("[^0-9a-zA-Z]","",$phone_number);
+ $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
+ $pass=preg_replace("/[^-_0-9a-zA-Z]/","",$pass);
+ $length_in_sec = preg_replace("/[^0-9]/","",$length_in_sec);
+ $phone_code = preg_replace("/[^0-9]/","",$phone_code);
+ $phone_number = preg_replace("/[^0-9a-zA-Z]/","",$phone_number);
}
else
{
- $user = ereg_replace("'|\"|\\\\|;","",$user);
- $pass = ereg_replace("'|\"|\\\\|;","",$pass);
+ $user = preg_replace("/\'|\"|\\\\|;/","",$user);
+ $pass = preg_replace("/\'|\"|\\\\|;/","",$pass);
}
-$session_name = ereg_replace("'|\"|\\\\|;","",$session_name);
-$server_ip = ereg_replace("'|\"|\\\\|;","",$server_ip);
-$alt_phone = ereg_replace(" ","",$alt_phone);
-$phone_number = ereg_replace(" ","",$phone_number);
+$session_name = preg_replace("/\'|\"|\\\\|;/","",$session_name);
+$server_ip = preg_replace("/\'|\"|\\\\|;/","",$server_ip);
+$alt_phone = preg_replace("/\s/","",$alt_phone);
+$phone_number = preg_replace("/\s/","",$phone_number);
# default optional vars if not set
if (!isset($format)) {$format="text";}
@@ -806,19 +807,19 @@ if ($ACTION == 'LogiNCamPaigns')
$row=mysql_fetch_row($rslt);
$forced_timeclock_login = $row[1];
$shift_enforcement = $row[2];
- $LOGgroup_shiftsSQL = eregi_replace(' ','',$row[3]);
- $LOGgroup_shiftsSQL = eregi_replace(' ',"','",$LOGgroup_shiftsSQL);
+ $LOGgroup_shiftsSQL = preg_replace('/\s\s/','',$row[3]);
+ $LOGgroup_shiftsSQL = preg_replace('/\s/',"','",$LOGgroup_shiftsSQL);
$LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')";
- if ( (!eregi("ALL-CAMPAIGNS",$row[0])) )
+ if ( (!preg_match("/ALL-CAMPAIGNS/i",$row[0])) )
{
- $LOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]);
- $LOGallowed_campaignsSQL = eregi_replace(' ',"','",$LOGallowed_campaignsSQL);
+ $LOGallowed_campaignsSQL = preg_replace('/\s-/i','',$row[0]);
+ $LOGallowed_campaignsSQL = preg_replace('/\s/i',"','",$LOGallowed_campaignsSQL);
$LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')";
}
$show_campaign_list=1;
### CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR
- if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) )
+ if ( (preg_match('/Y/',$forced_timeclock_login)) or ( (preg_match('/ADMIN_EXEMPT/',$forced_timeclock_login)) and ($VU_user_level < 8) ) )
{
$last_agent_event='';
$HHMM = date("Hi");
@@ -843,13 +844,13 @@ if ($ACTION == 'LogiNCamPaigns')
$rowx=mysql_fetch_row($rslt);
$last_agent_event = $rowx[0];
}
- if ( (strlen($last_agent_event)<2) or (ereg('LOGOUT',$last_agent_event)) )
+ if ( (strlen($last_agent_event)<2) or (preg_match('/LOGOUT/',$last_agent_event)) )
{$show_campaign_list=0;}
}
}
### CHECK TO SEE IF AGENT IS WITHIN THEIR SHIFT IF RESTRICTED, IF NOT, OUTPUT ERROR
- if ( ( (ereg("START|ALL",$shift_enforcement)) and (!ereg("OFF",$VU_agent_shift_enforcement_override)) ) or (ereg("START|ALL",$VU_agent_shift_enforcement_override)) )
+ if ( ( (preg_match("/START|ALL/",$shift_enforcement)) and (!preg_match("/OFF/",$VU_agent_shift_enforcement_override)) ) or (preg_match("/START|ALL/",$VU_agent_shift_enforcement_override)) )
{
$shift_ok=0;
if ( (strlen($LOGgroup_shiftsSQL) < 3) and ($VU_shift_override_flag < 1) )
@@ -876,7 +877,7 @@ if ($ACTION == 'LogiNCamPaigns')
$shift_length = $rowx[2];
$shift_weekdays = $rowx[3];
- if (eregi("$wday",$shift_weekdays))
+ if (preg_match("/$wday/i",$shift_weekdays))
{
$HHshift_length = substr($shift_length,0,2);
$MMshift_length = substr($shift_length,3,2);
@@ -1249,8 +1250,8 @@ if ($ACTION == 'UpdateFields')
$rank = trim("$row[23]");
$owner = trim("$row[24]");
- $comments = eregi_replace("\r",'',$comments);
- $comments = eregi_replace("\n",'!N',$comments);
+ $comments = preg_replace("/\r/i",'',$comments);
+ $comments = preg_replace("/\n/i",'!N',$comments);
$LeaD_InfO = "GOOD\n";
$LeaD_InfO .= $vendor_id . "\n";
@@ -1306,7 +1307,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$row=''; $rowx='';
$override_dial_number='';
$channel_live=1;
- $lead_id = ereg_replace("[^0-9]","",$lead_id);
+ $lead_id = preg_replace("/[^0-9]/","",$lead_id);
if ( (strlen($conf_exten)<1) || (strlen($campaign)<1) || (strlen($ext_context)<1) )
{
$channel_live=0;
@@ -1370,7 +1371,7 @@ if ($ACTION == 'manDiaLnextCaLL')
{
if (strlen($phone_number)>3)
{
- if (ereg("ENABLED",$manual_dial_call_time_check))
+ if (preg_match("/ENABLED/",$manual_dial_call_time_check))
{
$secX = date("U");
$hour = date("H");
@@ -1435,9 +1436,9 @@ if ($ACTION == 'manDiaLnextCaLL')
}
}
- if (ereg("DNC",$manual_dial_filter))
+ if (preg_match("/DNC/",$manual_dial_filter))
{
- if (ereg("AREACODE",$use_internal_dnc))
+ if (preg_match("/AREACODE/",$use_internal_dnc))
{
$phone_number_areacode = substr($phone_number, 0, 3);
$phone_number_areacode .= "XXXXXXX";
@@ -1467,7 +1468,7 @@ if ($ACTION == 'manDiaLnextCaLL')
echo "DNC NUMBER\n";
exit;
}
- if ( (ereg("Y",$use_campaign_dnc)) or (ereg("AREACODE",$use_campaign_dnc)) )
+ if ( (preg_match("/Y/",$use_campaign_dnc)) or (preg_match("/AREACODE/",$use_campaign_dnc)) )
{
$stmt="SELECT use_other_campaign_dnc from vicidial_campaigns where campaign_id='$campaign';";
$rslt=mysql_query($stmt, $link);
@@ -1477,7 +1478,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$temp_campaign_id = $campaign;
if (strlen($use_other_campaign_dnc) > 0) {$temp_campaign_id = $use_other_campaign_dnc;}
- if (ereg("AREACODE",$use_campaign_dnc))
+ if (preg_match("/AREACODE/",$use_campaign_dnc))
{
$phone_number_areacode = substr($phone_number, 0, 3);
$phone_number_areacode .= "XXXXXXX";
@@ -1509,7 +1510,7 @@ if ($ACTION == 'manDiaLnextCaLL')
}
}
}
- if (ereg("CAMPLISTS",$manual_dial_filter))
+ if (preg_match("/CAMPLISTS/",$manual_dial_filter))
{
$stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign'";
$rslt=mysql_query($stmt, $link);
@@ -1520,20 +1521,20 @@ if ($ACTION == 'manDiaLnextCaLL')
while ($lists_to_parse > $o)
{
$rowx=mysql_fetch_row($rslt);
- if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";}
- if (ereg("ALL",$manual_dial_filter))
+ if (preg_match("/Y/", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";}
+ if (preg_match("/ALL/",$manual_dial_filter))
{
- if (ereg("N", $rowx[1]))
+ if (preg_match("/N/", $rowx[1]))
{$inactive_lists++; $camp_lists .= "'$rowx[0]',";}
}
else
{
- if (ereg("N", $rowx[1]))
+ if (preg_match("/N/", $rowx[1]))
{$inactive_lists++;}
}
$o++;
}
- $camp_lists = eregi_replace(".$","",$camp_lists);
+ $camp_lists = preg_replace("/.$/i","",$camp_lists);
$stmt="SELECT count(*) FROM vicidial_list where phone_number='$phone_number' and list_id IN($camp_lists);";
$rslt=mysql_query($stmt, $link);
@@ -1633,7 +1634,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$lead_order_secondary = $row[8];
$call_count_limit = $row[9];
}
- if (eregi("N",$no_hopper_dialing))
+ if (preg_match("/N/i",$no_hopper_dialing))
{
### grab the next lead in the hopper for this campaign and reserve it for the user
$stmt = "UPDATE vicidial_hopper set status='QUEUE', user='$user' where campaign_id='$campaign' and status='READY' order by priority desc,hopper_id LIMIT 1";
@@ -1837,7 +1838,7 @@ if ($ACTION == 'manDiaLnextCaLL')
}
if (strlen($ct_states)>2)
{
- $ct_states = eregi_replace(",$",'',$ct_states);
+ $ct_states = preg_replace("/,$/i",'',$ct_states);
$ct_statesSQL = "and state NOT IN($ct_states)";
}
else
@@ -1999,7 +2000,7 @@ if ($ACTION == 'manDiaLnextCaLL')
$camp_lists .= "'$row[0]',";
$k++;
}
- $camp_lists = eregi_replace(".$","",$camp_lists);
+ $camp_lists = preg_replace("/.$/i","",$camp_lists);
if (strlen($camp_lists) < 4) {$camp_lists="''";}
$stmt="SELECT user_group,territory FROM vicidial_users where user='$user';";
@@ -2015,7 +2016,7 @@ if ($ACTION == 'manDiaLnextCaLL')
}
$adooSQL = '';
- if (eregi("TERRITORY",$agent_dial_owner_only))
+ if (preg_match("/TERRITORY/i",$agent_dial_owner_only))
{
$agent_territories='';
$agent_choose_territories=0;
@@ -2065,8 +2066,8 @@ if ($ACTION == 'manDiaLnextCaLL')
$adooSQL = $searchownerSQL;
}
- if (eregi("USER",$agent_dial_owner_only)) {$adooSQL = "and owner='$user'";}
- if (eregi("USER_GROUP",$agent_dial_owner_only)) {$adooSQL = "and owner='$user_group'";}
+ if (preg_match("/USER/i",$agent_dial_owner_only)) {$adooSQL = "and owner='$user'";}
+ if (preg_match("/USER_GROUP/i",$agent_dial_owner_only)) {$adooSQL = "and owner='$user_group'";}
if (preg_match("/_BLANK/",$agent_dial_owner_only))
{
$adooSQLa = preg_replace("/^and /",'',$adooSQL);
@@ -2085,23 +2086,23 @@ if ($ACTION == 'manDiaLnextCaLL')
}
$order_stmt = '';
- if (eregi("DOWN",$lead_order)){$order_stmt = 'order by lead_id asc';}
- if (eregi("UP",$lead_order)){$order_stmt = 'order by lead_id desc';}
- if (eregi("UP LAST NAME",$lead_order)){$order_stmt = "order by last_name desc, $last_order";}
- if (eregi("DOWN LAST NAME",$lead_order)){$order_stmt = "order by last_name, $last_order";}
- if (eregi("UP PHONE",$lead_order)){$order_stmt = "order by phone_number desc, $last_order";}
- if (eregi("DOWN PHONE",$lead_order)){$order_stmt = "order by phone_number, $last_order";}
- if (eregi("UP COUNT",$lead_order)){$order_stmt = "order by called_count desc, $last_order";}
- if (eregi("DOWN COUNT",$lead_order)){$order_stmt = "order by called_count, $last_order";}
- if (eregi("UP LAST CALL TIME",$lead_order)){$order_stmt = "order by last_local_call_time desc, $last_order";}
- if (eregi("DOWN LAST CALL TIME",$lead_order)){$order_stmt = "order by last_local_call_time, $last_order";}
- if (eregi("RANDOM",$lead_order)){$order_stmt = "order by RAND()";}
- if (eregi("UP RANK",$lead_order)){$order_stmt = "order by rank desc, $last_order";}
- if (eregi("DOWN RANK",$lead_order)){$order_stmt = "order by rank, $last_order";}
- if (eregi("UP OWNER",$lead_order)){$order_stmt = "order by owner desc, $last_order";}
- if (eregi("DOWN OWNER",$lead_order)){$order_stmt = "order by owner, $last_order";}
- if (eregi("UP TIMEZONE",$lead_order)){$order_stmt = "order by gmt_offset_now desc, $last_order";}
- if (eregi("DOWN TIMEZONE",$lead_order)){$order_stmt = "order by gmt_offset_now, $last_order";}
+ if (preg_match("/DOWN/i",$lead_order)){$order_stmt = 'order by lead_id asc';}
+ if (preg_match("/UP/i",$lead_order)){$order_stmt = 'order by lead_id desc';}
+ if (preg_match("/UP LAST NAME/i",$lead_order)){$order_stmt = "order by last_name desc, $last_order";}
+ if (preg_match("/DOWN LAST NAME/i",$lead_order)){$order_stmt = "order by last_name, $last_order";}
+ if (preg_match("/UP PHONE/i",$lead_order)){$order_stmt = "order by phone_number desc, $last_order";}
+ if (preg_match("/DOWN PHONE/i",$lead_order)){$order_stmt = "order by phone_number, $last_order";}
+ if (preg_match("/UP COUNT/i",$lead_order)){$order_stmt = "order by called_count desc, $last_order";}
+ if (preg_match("/DOWN COUNT/i",$lead_order)){$order_stmt = "order by called_count, $last_order";}
+ if (preg_match("/UP LAST CALL TIME/i",$lead_order)){$order_stmt = "order by last_local_call_time desc, $last_order";}
+ if (preg_match("/DOWN LAST CALL TIME/i",$lead_order)){$order_stmt = "order by last_local_call_time, $last_order";}
+ if (preg_match("/RANDOM/i",$lead_order)){$order_stmt = "order by RAND()";}
+ if (preg_match("/UP RANK/i",$lead_order)){$order_stmt = "order by rank desc, $last_order";}
+ if (preg_match("/DOWN RANK/i",$lead_order)){$order_stmt = "order by rank, $last_order";}
+ if (preg_match("/UP OWNER/i",$lead_order)){$order_stmt = "order by owner desc, $last_order";}
+ if (preg_match("/DOWN OWNER/i",$lead_order)){$order_stmt = "order by owner, $last_order";}
+ if (preg_match("/UP TIMEZONE/i",$lead_order)){$order_stmt = "order by gmt_offset_now desc, $last_order";}
+ if (preg_match("/DOWN TIMEZONE/i",$lead_order)){$order_stmt = "order by gmt_offset_now, $last_order";}
$stmt="UPDATE vicidial_list SET user='QUEUE$user' where called_since_last_reset='N' and user NOT LIKE \"QUEUE%\" and status IN($Dsql) and list_id IN($camp_lists) and ($all_gmtSQL) $CCLsql $DLTsql $fSQL $adooSQL $order_stmt LIMIT 1;";
if ($DB) {echo "$stmt\n";}
@@ -2219,8 +2220,8 @@ if ($ACTION == 'manDiaLnextCaLL')
get_audited_comments($lead_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log);
}
$ACcomments = strip_tags(htmlentities($ACcomments));
- $ACcomments = eregi_replace("\r",'',$ACcomments);
- $ACcomments = eregi_replace("\n",'!N',$ACcomments);
+ $ACcomments = preg_replace("/\r/i",'',$ACcomments);
+ $ACcomments = preg_replace("/\n/i",'!N',$ACcomments);
//END Added by Poundteam for Audited Comments
}
@@ -2362,9 +2363,9 @@ if ($ACTION == 'manDiaLnextCaLL')
$LLCT_DATE_offset = ($local_gmt - $gmt_offset_now);
$LLCT_DATE = date("Y-m-d H:i:s", mktime(date("H")-$LLCT_DATE_offset,date("i"),date("s"),date("m"),date("d"),date("Y")));
- if (ereg('Y',$called_since_last_reset))
+ if (preg_match('/Y/',$called_since_last_reset))
{
- $called_since_last_reset = ereg_replace('Y','',$called_since_last_reset);
+ $called_since_last_reset = preg_replace('/Y/','',$called_since_last_reset);
if (strlen($called_since_last_reset) < 1) {$called_since_last_reset = 0;}
$called_since_last_reset++;
$called_since_last_reset = "Y$called_since_last_reset";
@@ -2474,7 +2475,7 @@ if ($ACTION == 'manDiaLnextCaLL')
{$CCID = "$temp_CID"; $CCID_on++;}
}
- if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';}
+ if (preg_match("/x/i",$dial_prefix)) {$Local_out_prefix = '';}
$PADlead_id = sprintf("%010s", $lead_id);
while (strlen($PADlead_id) > 10) {$PADlead_id = substr("$PADlead_id", 1);}
@@ -2502,7 +2503,7 @@ if ($ACTION == 'manDiaLnextCaLL')
}
### whether to omit phone_code or not
- if (eregi('Y',$omit_phone_code))
+ if (preg_match('/Y/i',$omit_phone_code))
{$Ndialstring = "$Local_out_prefix$agent_dialed_number";}
else
{$Ndialstring = "$Local_out_prefix$phone_code$agent_dialed_number";}
@@ -2821,7 +2822,7 @@ if ($ACTION == 'manDiaLnextCaLL')
}
if ($cffn_ct > 0)
{
- $custom_field_names_SQL = eregi_replace(".$","",$custom_field_names_SQL);
+ $custom_field_names_SQL = preg_replace("/.$/i","",$custom_field_names_SQL);
### find the values of the named custom fields
$stmt = "SELECT $custom_field_names_SQL FROM custom_$entry_list_id where lead_id='$lead_id' limit 1;";
$rslt=mysql_query($stmt, $link);
@@ -2845,8 +2846,8 @@ if ($ACTION == 'manDiaLnextCaLL')
}
- $comments = eregi_replace("\r",'',$comments);
- $comments = eregi_replace("\n",'!N',$comments);
+ $comments = preg_replace("/\r/i",'',$comments);
+ $comments = preg_replace("/\n/i",'!N',$comments);
$LeaD_InfO = $MqueryCID . "\n";
$LeaD_InfO .= $lead_id . "\n";
@@ -2955,7 +2956,7 @@ if ($ACTION == 'AlertControl')
}
else
{
- if (ereg('ON',$stage)) {$stage = '1';}
+ if (preg_match('/ON/',$stage)) {$stage = '1';}
else {$stage = '0';}
$stmt = "UPDATE vicidial_users set alert_enabled='$stage' where user='$user' and pass='$pass';";
@@ -3074,9 +3075,9 @@ if ($ACTION == 'manDiaLonly')
}
### BEGIN check phone filtering for DNC or camplists if enabled ###
- if (ereg("DNC",$manual_dial_filter))
+ if (preg_match("/DNC/",$manual_dial_filter))
{
- if (ereg("AREACODE",$use_internal_dnc))
+ if (preg_match("/AREACODE/",$use_internal_dnc))
{
$phone_number_areacode = substr($phone_number, 0, 3);
$phone_number_areacode .= "XXXXXXX";
@@ -3093,7 +3094,7 @@ if ($ACTION == 'manDiaLonly')
echo " CALL NOT PLACED\nDNC NUMBER\n";
exit;
}
- if ( (ereg("Y",$use_campaign_dnc)) or (ereg("AREACODE",$use_campaign_dnc)) )
+ if ( (preg_match("/Y/",$use_campaign_dnc)) or (preg_match("/AREACODE/",$use_campaign_dnc)) )
{
$stmt="SELECT use_other_campaign_dnc from vicidial_campaigns where campaign_id='$campaign';";
$rslt=mysql_query($stmt, $link);
@@ -3103,7 +3104,7 @@ if ($ACTION == 'manDiaLonly')
$temp_campaign_id = $campaign;
if (strlen($use_other_campaign_dnc) > 0) {$temp_campaign_id = $use_other_campaign_dnc;}
- if (ereg("AREACODE",$use_campaign_dnc))
+ if (preg_match("/AREACODE/",$use_campaign_dnc))
{
$phone_number_areacode = substr($phone_number, 0, 3);
$phone_number_areacode .= "XXXXXXX";
@@ -3122,7 +3123,7 @@ if ($ACTION == 'manDiaLonly')
}
}
}
- if (ereg("CAMPLISTS",$manual_dial_filter))
+ if (preg_match("/CAMPLISTS/",$manual_dial_filter))
{
$stmt="SELECT list_id,active from vicidial_lists where campaign_id='$campaign'";
$rslt=mysql_query($stmt, $link);
@@ -3133,20 +3134,20 @@ if ($ACTION == 'manDiaLonly')
while ($lists_to_parse > $o)
{
$rowx=mysql_fetch_row($rslt);
- if (ereg("Y", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";}
- if (ereg("ALL",$manual_dial_filter))
+ if (preg_match("/Y/", $rowx[1])) {$active_lists++; $camp_lists .= "'$rowx[0]',";}
+ if (preg_match("/ALL/",$manual_dial_filter))
{
- if (ereg("N", $rowx[1]))
+ if (preg_match("/N/", $rowx[1]))
{$inactive_lists++; $camp_lists .= "'$rowx[0]',";}
}
else
{
- if (ereg("N", $rowx[1]))
+ if (preg_match("/N/", $rowx[1]))
{$inactive_lists++;}
}
$o++;
}
- $camp_lists = eregi_replace(".$","",$camp_lists);
+ $camp_lists = preg_replace("/.$/i","",$camp_lists);
$stmt="SELECT count(*) FROM vicidial_list where phone_number='$phone_number' and list_id IN($camp_lists);";
$rslt=mysql_query($stmt, $link);
@@ -3176,7 +3177,7 @@ if ($ACTION == 'manDiaLonly')
$Local_dial_timeout = ($Local_dial_timeout * 1000);
if (strlen($dial_prefix) > 0) {$Local_out_prefix = "$dial_prefix";}
if (strlen($campaign_cid) > 6) {$CCID = "$campaign_cid"; $CCID_on++;}
- if (eregi("x",$dial_prefix)) {$Local_out_prefix = '';}
+ if (preg_match("/x/i",$dial_prefix)) {$Local_out_prefix = '';}
$campaign_cid_override='';
### check if there is a list_id override
if (strlen($lead_id) > 1)
@@ -3272,7 +3273,7 @@ if ($ACTION == 'manDiaLonly')
{$account=''; $variable='';}
### whether to omit phone_code or not
- if (eregi('Y',$omit_phone_code))
+ if (preg_match('/Y/i',$omit_phone_code))
{$Ndialstring = "$Local_out_prefix$phone_number";}
else
{$Ndialstring = "$Local_out_prefix$phone_code$phone_number";}
@@ -3928,7 +3929,7 @@ if ($stage == "end")
$use_other_campaign_dnc = $row[3];
}
else {$auto_alt_dial = 'NONE';}
- if (eregi("(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED|EXTENDED_ONLY)",$auto_alt_dial))
+ if (preg_match("/(ALT_ONLY|ADDR3_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED|EXTENDED_ONLY)/i",$auto_alt_dial))
{
### check to see if lead should be alt_dialed
if (strlen($alt_dial)<2) {$alt_dial = 'NONE';}
@@ -3950,7 +3951,7 @@ if ($stage == "end")
}
}
- if ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("(ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED)",$auto_alt_dial)) )
+ if ( (preg_match("/(NONE|MAIN)/i",$alt_dial)) and (preg_match("/(ALT_ONLY|ALT_AND_ADDR3|ALT_AND_EXTENDED)/i",$auto_alt_dial)) )
{
$alt_dial_skip=0;
$stmt="SELECT alt_phone,gmt_offset_now,state,vendor_lead_code FROM vicidial_list where lead_id='$lead_id';";
@@ -3962,7 +3963,7 @@ if ($stage == "end")
{
$row=mysql_fetch_row($rslt);
$alt_phone = $row[0];
- $alt_phone = eregi_replace("[^0-9]","",$alt_phone);
+ $alt_phone = preg_replace("/[^0-9]/i","",$alt_phone);
$gmt_offset_now = $row[1];
$state = $row[2];
$vendor_lead_code = $row[3];
@@ -3970,9 +3971,9 @@ if ($stage == "end")
else {$alt_phone = '';}
if (strlen($alt_phone)>5)
{
- if ( (ereg("Y",$use_internal_dnc)) or (ereg("AREACODE",$use_internal_dnc)) )
+ if ( (preg_match("/Y/",$use_internal_dnc)) or (preg_match("/AREACODE/",$use_internal_dnc)) )
{
- if (ereg("AREACODE",$use_internal_dnc))
+ if (preg_match("/AREACODE/",$use_internal_dnc))
{
$alt_phone_areacode = substr($alt_phone, 0, 3);
$alt_phone_areacode .= "XXXXXXX";
@@ -3991,11 +3992,11 @@ if ($stage == "end")
}
}
else {$VD_alt_dnc_count=0;}
- if ( (ereg("Y",$use_campaign_dnc)) or (ereg("AREACODE",$use_campaign_dnc)) )
+ if ( (preg_match("/Y/",$use_campaign_dnc)) or (preg_match("/AREACODE/",$use_campaign_dnc)) )
{
$temp_campaign_id = $campaign;
if (strlen($use_other_campaign_dnc) > 0) {$temp_campaign_id = $use_other_campaign_dnc;}
- if (ereg("AREACODE",$use_campaign_dnc))
+ if (preg_match("/AREACODE/",$use_campaign_dnc))
{
$alt_phone_areacode = substr($alt_phone, 0, 3);
$alt_phone_areacode .= "XXXXXXX";
@@ -4030,7 +4031,7 @@ if ($stage == "end")
{$alt_dial='ALT';}
}
- if ( ( (eregi("(ALT)",$alt_dial)) and (eregi("ALT_AND_ADDR3",$auto_alt_dial)) ) or ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("ADDR3_ONLY",$auto_alt_dial)) ) )
+ if ( ( (preg_match("/(ALT)/i",$alt_dial)) and (preg_match("/ALT_AND_ADDR3/i",$auto_alt_dial)) ) or ( (preg_match("/(NONE|MAIN)/i",$alt_dial)) and (preg_match("/ADDR3_ONLY/i",$auto_alt_dial)) ) )
{
$addr3_dial_skip=0;
$stmt="SELECT address3,gmt_offset_now,state,vendor_lead_code FROM vicidial_list where lead_id='$lead_id';";
@@ -4042,7 +4043,7 @@ if ($stage == "end")
{
$row=mysql_fetch_row($rslt);
$address3 = $row[0];
- $address3 = eregi_replace("[^0-9]","",$address3);
+ $address3 = preg_replace("/[^0-9]/i","",$address3);
$gmt_offset_now = $row[1];
$state = $row[2];
$vendor_lead_code = $row[3];
@@ -4050,9 +4051,9 @@ if ($stage == "end")
else {$address3 = '';}
if (strlen($address3)>5)
{
- if ( (ereg("Y",$use_internal_dnc)) or (ereg("AREACODE",$use_internal_dnc)) )
+ if ( (preg_match("/Y/",$use_internal_dnc)) or (preg_match("/AREACODE/",$use_internal_dnc)) )
{
- if (ereg("AREACODE",$use_internal_dnc))
+ if (preg_match("/AREACODE/",$use_internal_dnc))
{
$addr3_phone_areacode = substr($address3, 0, 3);
$addr3_phone_areacode .= "XXXXXXX";
@@ -4071,11 +4072,11 @@ if ($stage == "end")
}
}
else {$VD_alt_dnc_count=0;}
- if ( (ereg("Y",$use_campaign_dnc)) or (ereg("AREACODE",$use_campaign_dnc)) )
+ if ( (preg_match("/Y/",$use_campaign_dnc)) or (preg_match("/AREACODE/",$use_campaign_dnc)) )
{
$temp_campaign_id = $campaign;
if (strlen($use_other_campaign_dnc) > 0) {$temp_campaign_id = $use_other_campaign_dnc;}
- if (ereg("AREACODE",$use_campaign_dnc))
+ if (preg_match("/AREACODE/",$use_campaign_dnc))
{
$addr3_phone_areacode = substr($address3, 0, 3);
$addr3_phone_areacode .= "XXXXXXX";
@@ -4114,11 +4115,11 @@ if ($stage == "end")
# fwrite ($fp, "$NOW_TIME|PRE-X|$campaign|$lead_id|$phone_number|$user|$Ctype|$callerid|$uniqueid|$stmt|$auto_alt_dial|$alt_dial\n");
# fclose($fp);
- if ( ( ( (eregi("(NONE|MAIN)",$alt_dial)) and (eregi("EXTENDED_ONLY",$auto_alt_dial)) ) or ( (eregi("(ALT)",$alt_dial)) and (eregi("(ALT_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(ADDR3)",$alt_dial)) and (eregi("(ADDR3_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED)",$auto_alt_dial)) ) or ( (eregi("(X)",$alt_dial)) and (eregi("EXTENDED",$auto_alt_dial)) ) ) and (!eregi("LAST",$alt_dial)) )
+ if ( ( ( (preg_match("/(NONE|MAIN)/i",$alt_dial)) and (preg_match("/EXTENDED_ONLY/i",$auto_alt_dial)) ) or ( (preg_match("/(ALT)/i",$alt_dial)) and (preg_match("/(ALT_AND_EXTENDED)/i",$auto_alt_dial)) ) or ( (preg_match("/(ADDR3)/i",$alt_dial)) and (preg_match("/(ADDR3_AND_EXTENDED|ALT_AND_ADDR3_AND_EXTENDED)/i",$auto_alt_dial)) ) or ( (preg_match("/(X)/i",$alt_dial)) and (preg_match("/EXTENDED/i",$auto_alt_dial)) ) ) and (!preg_match("/LAST/i",$alt_dial)) )
{
- if (eregi("(ADDR3)",$alt_dial)) {$Xlast=0;}
+ if (preg_match("/(ADDR3)/i",$alt_dial)) {$Xlast=0;}
else
- {$Xlast = ereg_replace("[^0-9]","",$alt_dial);}
+ {$Xlast = preg_replace("/[^0-9]/","",$alt_dial);}
if (strlen($Xlast)<1)
{$Xlast=0;}
$VD_altdialx='';
@@ -4166,11 +4167,11 @@ if ($stage == "end")
else
{$Xlast=9999999999;}
- if (ereg("Y",$VD_altdial_active))
+ if (preg_match("/Y/",$VD_altdial_active))
{
- if ( (ereg("Y",$use_internal_dnc)) or (ereg("AREACODE",$use_internal_dnc)) )
+ if ( (preg_match("/Y/",$use_internal_dnc)) or (preg_match("/AREACODE/",$use_internal_dnc)) )
{
- if (ereg("AREACODE",$use_internal_dnc))
+ if (preg_match("/AREACODE/",$use_internal_dnc))
{
$vdap_phone_areacode = substr($VD_altdial_phone, 0, 3);
$vdap_phone_areacode .= "XXXXXXX";
@@ -4189,11 +4190,11 @@ if ($stage == "end")
}
}
else {$VD_alt_dnc_count=0;}
- if ( (ereg("Y",$use_campaign_dnc)) or (ereg("AREACODE",$use_campaign_dnc)) )
+ if ( (preg_match("/Y/",$use_campaign_dnc)) or (preg_match("/AREACODE/",$use_campaign_dnc)) )
{
$temp_campaign_id = $campaign;
if (strlen($use_other_campaign_dnc) > 0) {$temp_campaign_id = $use_other_campaign_dnc;}
- if (ereg("AREACODE",$use_campaign_dnc))
+ if (preg_match("/AREACODE/",$use_campaign_dnc))
{
$vdap_phone_areacode = substr($VD_altdial_phone, 0, 3);
$vdap_phone_areacode .= "XXXXXXX";
@@ -4435,7 +4436,7 @@ if ($stage == "end")
{
$SQLterm = "term_reason='$term_reason',";
- if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) )
+ if ( (preg_match("/NONE/",$term_reason)) or (preg_match("/NONE/",$VDterm_reason)) or (strlen($VDterm_reason) < 1) )
{
### check to see if lead should be alt_dialed
$stmt="SELECT term_reason,uniqueid,status from vicidial_log where uniqueid='$uniqueid' and lead_id='$lead_id' order by call_date desc limit 1;";
@@ -4450,7 +4451,7 @@ if ($stage == "end")
$VDstatus = $row[2];
$VDIDselect = "VDL_UIDLID $uniqueid $lead_id";
}
- if (ereg("CALLER",$VDterm_reason))
+ if (preg_match("/CALLER/",$VDterm_reason))
{
$SQLterm = "";
}
@@ -4531,7 +4532,7 @@ if ($stage == "end")
$SQLterm = "term_reason='$term_reason'";
$QL_term='';
- if ( (ereg("NONE",$term_reason)) or (ereg("NONE",$VDterm_reason)) or (strlen($VDterm_reason) < 1) )
+ if ( (preg_match("/NONE/",$term_reason)) or (preg_match("/NONE/",$VDterm_reason)) or (strlen($VDterm_reason) < 1) )
{
### find out who hung up the call
$stmt="SELECT term_reason,closecallid,queue_position from vicidial_closer_log where lead_id='$lead_id' and call_date > \"$four_hours_ago\" order by call_date desc limit 1;";
@@ -4546,7 +4547,7 @@ if ($stage == "end")
$VDqueue_position = $row[2];
$VDIDselect = "VDCL_LID4HOUR $lead_id $four_hours_ago";
}
- if (ereg("CALLER",$VDterm_reason))
+ if (preg_match("/CALLER/",$VDterm_reason))
{
$SQLterm = "";
}
@@ -4667,7 +4668,7 @@ if ($stage == "end")
else
{
# if (preg_match("/$agentchannel/i",$row[0]))
- if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) )
+ if ( ($agentchannel == "$row[0]") or (preg_match('/ASTblind/',$row[0])) )
{
$donothing=1;
}
@@ -4698,7 +4699,7 @@ if ($stage == "end")
else
{
# if (preg_match("/$agentchannel/i",$row[0]))
- if ( ($agentchannel == "$row[0]") or (ereg('ASTblind',$row[0])) )
+ if ( ($agentchannel == "$row[0]") or (preg_match('/ASTblind/',$row[0])) )
{
$donothing=1;
}
@@ -4781,9 +4782,9 @@ if ($stage == "end")
{$vidSQL = ",vicidial_id='$VDvicidial_id'";}
else
{
- if ( (ereg('.',$vicidial_id)) and ($VLA_inOUT == 'INBOUND') )
+ if ( (preg_match('/\./',$vicidial_id)) and ($VLA_inOUT == 'INBOUND') )
{
- if (!ereg('.',$VDvicidial_id))
+ if (!preg_match('/\./',$VDvicidial_id))
{$vidSQL = ",vicidial_id='$VDvicidial_id'";}
if ($WeBRooTWritablE > 0)
@@ -4840,12 +4841,12 @@ if ($stage == "end")
if ($VDpr_ct > 0)
{
$row=mysql_fetch_row($rslt);
- if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) )
+ if ( (preg_match("/NULL/i",$row[0])) or ($row[0] < 1000) )
{
$talk_epochSQL=",talk_epoch='$StarTtime'";
$row[0]=$row[3];
}
- if ( (!eregi("NULL",$row[6])) and ($row[6] > 1000) )
+ if ( (!preg_match("/NULL/i",$row[6])) and ($row[6] > 1000) )
{
$dead_sec = ($StarTtime - $row[6]);
if ($dead_sec < 0) {$dead_sec=0;}
@@ -4854,11 +4855,11 @@ if ($stage == "end")
$talk_sec = (($StarTtime - $row[0]) + $row[1]);
if ( ( ($auto_dial_level < 1) or (preg_match('/^M/',$MDnextCID)) ) and (preg_match('/INBOUND_MAN/',$dial_method)) )
{
- if ( (eregi("NULL",$row[5])) or (strlen($row[5]) < 1) )
+ if ( (preg_match("/NULL/i",$row[5])) or (strlen($row[5]) < 1) )
{
$lead_id_commentsSQL .= ",comments='MANUAL'";
}
- if ( (eregi("NULL",$row[4])) or ($row[4] < 1) or (strlen($row[4]) < 1) )
+ if ( (preg_match("/NULL/i",$row[4])) or ($row[4] < 1) or (strlen($row[4]) < 1) )
{
$lead_id_commentsSQL .= ",lead_id='$lead_id'";
}
@@ -5070,8 +5071,8 @@ if ($ACTION == 'VDADcheckINCOMING')
get_audited_comments($lead_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log);
}
$ACcomments = strip_tags(htmlentities($ACcomments));
- $ACcomments = eregi_replace("\r",'',$ACcomments);
- $ACcomments = eregi_replace("\n",'!N',$ACcomments);
+ $ACcomments = preg_replace("/\r/i",'',$ACcomments);
+ $ACcomments = preg_replace("/\n/i",'!N',$ACcomments);
//END Added by Poundteam for Audited Comments
}
@@ -5331,15 +5332,15 @@ if ($ACTION == 'VDADcheckINCOMING')
echo "|||||$VDCL_campaign_script|$VDCL_get_call_launch|$VDCL_xferconf_a_dtmf|$VDCL_xferconf_a_number|$VDCL_xferconf_b_dtmf|$VDCL_xferconf_b_number|$VDCL_default_xfer_group|X|X|||||$VDCL_timer_action|$VDCL_timer_action_message|$VDCL_timer_action_seconds|$VDCL_xferconf_c_number|$VDCL_xferconf_d_number|$VDCL_xferconf_e_number||||$VDCL_timer_action_destination||||||\n|\n";
- if (ereg('X',$dialed_label))
+ if (preg_match('/X/',$dialed_label))
{
- if (ereg('LAST',$dialed_label))
+ if (preg_match('/LAST/',$dialed_label))
{
$stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' order by alt_phone_count desc limit 1;";
}
else
{
- $Talt_dial = ereg_replace("[^0-9]","",$dialed_label);
+ $Talt_dial = preg_replace("/[^0-9]/","",$dialed_label);
$stmt = "SELECT phone_code,phone_number,alt_phone_note,active,alt_phone_count FROM vicidial_list_alt_phones where lead_id='$lead_id' and alt_phone_count='$Talt_dial';";
}
@@ -5477,7 +5478,7 @@ if ($ACTION == 'VDADcheckINCOMING')
if (strlen($VDCL_timer_action_destination) < 1)
{$VDCL_timer_action_destination = $row[14];}
- if ( ( (ereg('NONE',$VDCL_ingroup_script)) and (strlen($VDCL_ingroup_script) < 5) ) or (strlen($VDCL_ingroup_script) < 1) )
+ if ( ( (preg_match('/NONE/',$VDCL_ingroup_script)) and (strlen($VDCL_ingroup_script) < 5) ) or (strlen($VDCL_ingroup_script) < 1) )
{
$VDCL_ingroup_script = $row[0];
$script_recording_delay=0;
@@ -5719,7 +5720,7 @@ if ($ACTION == 'VDADcheckINCOMING')
}
if ($cffn_ct > 0)
{
- $custom_field_names_SQL = eregi_replace(".$","",$custom_field_names_SQL);
+ $custom_field_names_SQL = preg_replace("/.$/i","",$custom_field_names_SQL);
### find the values of the named custom fields
$stmt = "SELECT $custom_field_names_SQL FROM custom_$entry_list_id where lead_id='$lead_id' limit 1;";
$rslt=mysql_query($stmt, $link);
@@ -5742,8 +5743,8 @@ if ($ACTION == 'VDADcheckINCOMING')
}
- $comments = eregi_replace("\r",'',$comments);
- $comments = eregi_replace("\n",'!N',$comments);
+ $comments = preg_replace("/\r/i",'',$comments);
+ $comments = preg_replace("/\n/i",'!N',$comments);
$LeaD_InfO = $callerid . "\n";
$LeaD_InfO .= $lead_id . "\n";
@@ -5844,7 +5845,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$CBstatus = $row[0];
}
}
- if ( ($CBstatus > 0) or (eregi("CALLBK|CBHOLD", $dispo)) )
+ if ( ($CBstatus > 0) or (preg_match("/CALLBK|CBHOLD/i", $dispo)) )
{
$stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');";
if ($format=='debug') {echo "\n";}
@@ -5876,7 +5877,7 @@ if ($ACTION == 'VDADcheckINCOMING')
### Issue Start Call URL if defined
if (strlen($VDCL_start_call_url) > 7)
{
- if (eregi('--A--user_custom_',$VDCL_start_call_url))
+ if (preg_match('/--A--user_custom_/i',$VDCL_start_call_url))
{
$stmt = "SELECT custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user='$user';";
if ($DB) {echo "$stmt\n";}
@@ -5894,76 +5895,76 @@ if ($ACTION == 'VDADcheckINCOMING')
}
}
$VDCL_start_call_url = preg_replace('/^VAR/','',$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--lead_id--B--',urlencode(trim($lead_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--vendor_id--B--',urlencode(trim($vendor_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--vendor_lead_code--B--',urlencode(trim($vendor_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--list_id--B--',urlencode(trim($list_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--gmt_offset_now--B--',urlencode(trim($gmt_offset_now)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--phone_code--B--',urlencode(trim($phone_code)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--phone_number--B--',urlencode(trim($phone_number)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--title--B--',urlencode(trim($title)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--first_name--B--',urlencode(trim($first_name)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--middle_initial--B--',urlencode(trim($middle_initial)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--last_name--B--',urlencode(trim($last_name)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--address1--B--',urlencode(trim($address1)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--address2--B--',urlencode(trim($address2)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--address3--B--',urlencode(trim($address3)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--city--B--',urlencode(trim($city)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--state--B--',urlencode(trim($state)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--province--B--',urlencode(trim($province)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--postal_code--B--',urlencode(trim($postal_code)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--country_code--B--',urlencode(trim($country_code)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--gender--B--',urlencode(trim($gender)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--date_of_birth--B--',urlencode(trim($date_of_birth)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--alt_phone--B--',urlencode(trim($alt_phone)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--email--B--',urlencode(trim($email)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--security_phrase--B--',urlencode(trim($security_phrase)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--comments--B--',urlencode(trim($comments)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--user--B--',urlencode(trim($user)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--pass--B--',urlencode(trim($pass)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--campaign--B--',urlencode(trim($campaign)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--phone_login--B--',urlencode(trim($phone_login)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--original_phone_login--B--',urlencode(trim($original_phone_login)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--phone_pass--B--',urlencode(trim($phone_pass)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--fronter--B--',urlencode(trim($fronter)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--closer--B--',urlencode(trim($closer)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--group--B--',urlencode(trim($VDADchannel_group)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--channel_group--B--',urlencode(trim($VDADchannel_group)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--SQLdate--B--',urlencode(trim($SQLdate)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--epoch--B--',urlencode(trim($epoch)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--uniqueid--B--',urlencode(trim($uniqueid)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--customer_zap_channel--B--',urlencode(trim($customer_zap_channel)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--customer_server_ip--B--',urlencode(trim($customer_server_ip)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--server_ip--B--',urlencode(trim($server_ip)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--SIPexten--B--',urlencode(trim($SIPexten)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--session_id--B--',urlencode(trim($session_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--phone--B--',urlencode(trim($phone)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--parked_by--B--',urlencode(trim($parked_by)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--dispo--B--',urlencode(trim($dispo)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--dialed_number--B--',urlencode(trim($dialed_number)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--dialed_label--B--',urlencode(trim($dialed_label)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--source_id--B--',urlencode(trim($source_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--rank--B--',urlencode(trim($rank)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--owner--B--',urlencode(trim($owner)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--camp_script--B--',urlencode(trim($camp_script)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--in_script--B--',urlencode(trim($in_script)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--fullname--B--',urlencode(trim($fullname)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--user_custom_one--B--',urlencode(trim($user_custom_one)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--user_custom_two--B--',urlencode(trim($user_custom_two)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--user_custom_three--B--',urlencode(trim($user_custom_three)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--user_custom_four--B--',urlencode(trim($user_custom_four)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--user_custom_five--B--',urlencode(trim($user_custom_five)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--talk_time--B--',"0",$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--talk_time_min--B--',"0",$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--entry_list_id--B--',urlencode(trim($entry_list_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--did_id--B--',urlencode(trim($DID_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--did_extension--B--',urlencode(trim($DID_extension)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--did_pattern--B--',urlencode(trim($DID_pattern)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--did_description--B--',urlencode(trim($DID_description)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--closecallid--B--',urlencode(trim($INclosecallid)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--xfercallid--B--',urlencode(trim($INxfercallid)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--agent_log_id--B--',urlencode(trim($agent_log_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--call_id--B--',urlencode(trim($callerid)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--lead_id--B--/i',urlencode(trim($lead_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--vendor_id--B--/i',urlencode(trim($vendor_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--vendor_lead_code--B--/i',urlencode(trim($vendor_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--list_id--B--/i',urlencode(trim($list_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--gmt_offset_now--B--/i',urlencode(trim($gmt_offset_now)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--phone_code--B--/i',urlencode(trim($phone_code)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--phone_number--B--/i',urlencode(trim($phone_number)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--title--B--/i',urlencode(trim($title)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--first_name--B--/i',urlencode(trim($first_name)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--middle_initial--B--/i',urlencode(trim($middle_initial)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--last_name--B--/i',urlencode(trim($last_name)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--address1--B--/i',urlencode(trim($address1)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--address2--B--/i',urlencode(trim($address2)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--address3--B--/i',urlencode(trim($address3)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--city--B--/i',urlencode(trim($city)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--state--B--/i',urlencode(trim($state)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--province--B--/i',urlencode(trim($province)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--postal_code--B--/i',urlencode(trim($postal_code)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--country_code--B--/i',urlencode(trim($country_code)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--gender--B--/i',urlencode(trim($gender)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--date_of_birth--B--/i',urlencode(trim($date_of_birth)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--alt_phone--B--/i',urlencode(trim($alt_phone)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--email--B--/i',urlencode(trim($email)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--security_phrase--B--/i',urlencode(trim($security_phrase)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--comments--B--/i',urlencode(trim($comments)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--user--B--/i',urlencode(trim($user)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--pass--B--/i',urlencode(trim($pass)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--campaign--B--/i',urlencode(trim($campaign)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--phone_login--B--/i',urlencode(trim($phone_login)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--original_phone_login--B--/i',urlencode(trim($original_phone_login)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--phone_pass--B--/i',urlencode(trim($phone_pass)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--fronter--B--/i',urlencode(trim($fronter)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--closer--B--/i',urlencode(trim($closer)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--group--B--/i',urlencode(trim($VDADchannel_group)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--channel_group--B--/i',urlencode(trim($VDADchannel_group)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--SQLdate--B--/i',urlencode(trim($SQLdate)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--epoch--B--/i',urlencode(trim($epoch)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--uniqueid--B--/i',urlencode(trim($uniqueid)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--customer_zap_channel--B--/i',urlencode(trim($customer_zap_channel)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--customer_server_ip--B--/i',urlencode(trim($customer_server_ip)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--server_ip--B--/i',urlencode(trim($server_ip)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--SIPexten--B--/i',urlencode(trim($SIPexten)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--session_id--B--/i',urlencode(trim($session_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--phone--B--/i',urlencode(trim($phone)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--parked_by--B--/i',urlencode(trim($parked_by)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--dispo--B--/i',urlencode(trim($dispo)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--dialed_number--B--/i',urlencode(trim($dialed_number)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--dialed_label--B--/i',urlencode(trim($dialed_label)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--source_id--B--/i',urlencode(trim($source_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--rank--B--/i',urlencode(trim($rank)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--owner--B--/i',urlencode(trim($owner)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--camp_script--B--/i',urlencode(trim($camp_script)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--in_script--B--/i',urlencode(trim($in_script)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--fullname--B--/i',urlencode(trim($fullname)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--user_custom_one--B--/i',urlencode(trim($user_custom_one)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--user_custom_two--B--/i',urlencode(trim($user_custom_two)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--user_custom_three--B--/i',urlencode(trim($user_custom_three)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--user_custom_four--B--/i',urlencode(trim($user_custom_four)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--user_custom_five--B--/i',urlencode(trim($user_custom_five)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--talk_time--B--/i',"0",$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--talk_time_min--B--/i',"0",$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--entry_list_id--B--/i',urlencode(trim($entry_list_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--did_id--B--/i',urlencode(trim($DID_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--did_extension--B--/i',urlencode(trim($DID_extension)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--did_pattern--B--/i',urlencode(trim($DID_pattern)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--did_description--B--/i',urlencode(trim($DID_description)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--closecallid--B--/i',urlencode(trim($INclosecallid)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--xfercallid--B--/i',urlencode(trim($INxfercallid)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--agent_log_id--B--/i',urlencode(trim($agent_log_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--call_id--B--/i',urlencode(trim($callerid)),$VDCL_start_call_url);
if (strlen($custom_field_names)>2)
{
@@ -5988,7 +5989,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$form_field_value = urlencode(trim("$row[$o]"));
$field_name_id = $custom_field_names_ARY[$o];
$field_name_tag = "--A--" . $field_name_id . "--B--";
- $VDCL_start_call_url = eregi_replace("$field_name_tag","$form_field_value",$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace("/$field_name_tag/i","$form_field_value",$VDCL_start_call_url);
$o++;
}
}
@@ -6002,7 +6003,7 @@ if ($ACTION == 'VDADcheckINCOMING')
### insert a new url log entry
$SQL_log = "$VDCL_start_call_url";
- $SQL_log = ereg_replace(';','',$SQL_log);
+ $SQL_log = preg_replace('/;/','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt = "INSERT INTO vicidial_url_log SET uniqueid='$uniqueid',url_date='$NOW_TIME',url_type='start',url='$SQL_log',url_response='';";
if ($DB) {echo "$stmt\n";}
@@ -6022,7 +6023,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$URLend_sec = date("U");
$URLdiff_sec = ($URLend_sec - $URLstart_sec);
$SCUfile_contents = implode("", $SCUfile);
- $SCUfile_contents = ereg_replace(';','',$SCUfile_contents);
+ $SCUfile_contents = preg_replace('/;/','',$SCUfile_contents);
$SCUfile_contents = addslashes($SCUfile_contents);
$stmt = "UPDATE vicidial_url_log SET response_sec='$URLdiff_sec',url_response='$SCUfile_contents' where url_log_id='$url_id';";
if ($DB) {echo "$stmt\n";}
@@ -6041,7 +6042,7 @@ if ($ACTION == 'VDADcheckINCOMING')
$row=mysql_fetch_row($rslt);
$enable_vtiger_integration = $row[0];
}
- if ( ( ($enable_vtiger_integration > 0) and (ereg('callxfer',$VDCL_start_call_url)) and (ereg('contactwsid',$VDCL_start_call_url)) ) or (preg_match("/minuteswarning/",$VDCL_start_call_url)) )
+ if ( ( ($enable_vtiger_integration > 0) and (preg_match('/callxfer/',$VDCL_start_call_url)) and (preg_match('/contactwsid/',$VDCL_start_call_url)) ) or (preg_match("/minuteswarning/",$VDCL_start_call_url)) )
{
$SCUoutput='';
foreach ($SCUfile as $SCUline)
@@ -6657,7 +6658,7 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
}
if ($cffn_ct > 0)
{
- $custom_field_names_SQL = eregi_replace(".$","",$custom_field_names_SQL);
+ $custom_field_names_SQL = preg_replace("/.$/i","",$custom_field_names_SQL);
### find the values of the named custom fields
$stmt = "SELECT $custom_field_names_SQL FROM custom_$entry_list_id where lead_id='$lead_id' limit 1;";
$rslt=mysql_query($stmt, $link);
@@ -6680,8 +6681,8 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
}
- $comments = eregi_replace("\r",'',$comments);
- $comments = eregi_replace("\n",'!N',$comments);
+ $comments = preg_replace("/\r/i",'',$comments);
+ $comments = preg_replace("/\n/i",'!N',$comments);
$LeaD_InfO = $callerid . "\n";
$LeaD_InfO .= $lead_id . "\n";
@@ -6778,7 +6779,7 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
$CBstatus = $row[0];
}
}
- if ( ($CBstatus > 0) or (eregi("CALLBK|CBHOLD", $dispo)) )
+ if ( ($CBstatus > 0) or (preg_match("/CALLBK|CBHOLD/i", $dispo)) )
{
$stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');";
if ($format=='debug') {echo "\n";}
@@ -6810,7 +6811,7 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
### Issue Start Call URL if defined
if (strlen($VDCL_start_call_url) > 7)
{
- if (eregi('--A--user_custom_',$VDCL_start_call_url))
+ if (preg_match('/--A--user_custom_/i',$VDCL_start_call_url))
{
$stmt = "SELECT custom_one,custom_two,custom_three,custom_four,custom_five from vicidial_users where user='$user';";
if ($DB) {echo "$stmt\n";}
@@ -6828,76 +6829,76 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
}
}
$VDCL_start_call_url = preg_replace('/^VAR/','',$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--lead_id--B--',urlencode(trim($lead_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--vendor_id--B--',urlencode(trim($vendor_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--vendor_lead_code--B--',urlencode(trim($vendor_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--list_id--B--',urlencode(trim($list_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--gmt_offset_now--B--',urlencode(trim($gmt_offset_now)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--phone_code--B--',urlencode(trim($phone_code)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--phone_number--B--',urlencode(trim($phone_number)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--title--B--',urlencode(trim($title)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--first_name--B--',urlencode(trim($first_name)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--middle_initial--B--',urlencode(trim($middle_initial)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--last_name--B--',urlencode(trim($last_name)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--address1--B--',urlencode(trim($address1)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--address2--B--',urlencode(trim($address2)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--address3--B--',urlencode(trim($address3)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--city--B--',urlencode(trim($city)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--state--B--',urlencode(trim($state)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--province--B--',urlencode(trim($province)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--postal_code--B--',urlencode(trim($postal_code)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--country_code--B--',urlencode(trim($country_code)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--gender--B--',urlencode(trim($gender)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--date_of_birth--B--',urlencode(trim($date_of_birth)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--alt_phone--B--',urlencode(trim($alt_phone)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--email--B--',urlencode(trim($email)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--security_phrase--B--',urlencode(trim($security_phrase)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--comments--B--',urlencode(trim($comments)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--user--B--',urlencode(trim($user)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--pass--B--',urlencode(trim($pass)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--campaign--B--',urlencode(trim($campaign)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--phone_login--B--',urlencode(trim($phone_login)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--original_phone_login--B--',urlencode(trim($original_phone_login)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--phone_pass--B--',urlencode(trim($phone_pass)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--fronter--B--',urlencode(trim($fronter)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--closer--B--',urlencode(trim($closer)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--group--B--',urlencode(trim($VDADchannel_group)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--channel_group--B--',urlencode(trim($VDADchannel_group)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--SQLdate--B--',urlencode(trim($SQLdate)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--epoch--B--',urlencode(trim($epoch)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--uniqueid--B--',urlencode(trim($uniqueid)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--customer_zap_channel--B--',urlencode(trim($customer_zap_channel)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--customer_server_ip--B--',urlencode(trim($customer_server_ip)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--server_ip--B--',urlencode(trim($server_ip)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--SIPexten--B--',urlencode(trim($SIPexten)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--session_id--B--',urlencode(trim($session_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--phone--B--',urlencode(trim($phone)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--parked_by--B--',urlencode(trim($parked_by)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--dispo--B--',urlencode(trim($dispo)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--dialed_number--B--',urlencode(trim($dialed_number)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--dialed_label--B--',urlencode(trim($dialed_label)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--source_id--B--',urlencode(trim($source_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--rank--B--',urlencode(trim($rank)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--owner--B--',urlencode(trim($owner)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--camp_script--B--',urlencode(trim($camp_script)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--in_script--B--',urlencode(trim($in_script)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--fullname--B--',urlencode(trim($fullname)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--user_custom_one--B--',urlencode(trim($user_custom_one)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--user_custom_two--B--',urlencode(trim($user_custom_two)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--user_custom_three--B--',urlencode(trim($user_custom_three)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--user_custom_four--B--',urlencode(trim($user_custom_four)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--user_custom_five--B--',urlencode(trim($user_custom_five)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--talk_time--B--',"0",$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--talk_time_min--B--',"0",$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--entry_list_id--B--',urlencode(trim($entry_list_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--did_id--B--',urlencode(trim($DID_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--did_extension--B--',urlencode(trim($DID_extension)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--did_pattern--B--',urlencode(trim($DID_pattern)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--did_description--B--',urlencode(trim($DID_description)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--closecallid--B--',urlencode(trim($INclosecallid)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--xfercallid--B--',urlencode(trim($INxfercallid)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--agent_log_id--B--',urlencode(trim($agent_log_id)),$VDCL_start_call_url);
- $VDCL_start_call_url = eregi_replace('--A--call_id--B--',urlencode(trim($callerid)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--lead_id--B--/i',urlencode(trim($lead_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--vendor_id--B--/i',urlencode(trim($vendor_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--vendor_lead_code--B--/i',urlencode(trim($vendor_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--list_id--B--/i',urlencode(trim($list_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--gmt_offset_now--B--/i',urlencode(trim($gmt_offset_now)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--phone_code--B--/i',urlencode(trim($phone_code)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--phone_number--B--/i',urlencode(trim($phone_number)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--title--B--/i',urlencode(trim($title)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--first_name--B--/i',urlencode(trim($first_name)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--middle_initial--B--/i',urlencode(trim($middle_initial)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--last_name--B--/i',urlencode(trim($last_name)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--address1--B--/i',urlencode(trim($address1)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--address2--B--/i',urlencode(trim($address2)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--address3--B--/i',urlencode(trim($address3)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--city--B--/i',urlencode(trim($city)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--state--B--/i',urlencode(trim($state)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--province--B--/i',urlencode(trim($province)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--postal_code--B--/i',urlencode(trim($postal_code)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--country_code--B--/i',urlencode(trim($country_code)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--gender--B--/i',urlencode(trim($gender)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--date_of_birth--B--/i',urlencode(trim($date_of_birth)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--alt_phone--B--/i',urlencode(trim($alt_phone)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--email--B--/i',urlencode(trim($email)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--security_phrase--B--/i',urlencode(trim($security_phrase)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--comments--B--/i',urlencode(trim($comments)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--user--B--/i',urlencode(trim($user)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--pass--B--/i',urlencode(trim($pass)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--campaign--B--/i',urlencode(trim($campaign)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--phone_login--B--/i',urlencode(trim($phone_login)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--original_phone_login--B--/i',urlencode(trim($original_phone_login)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--phone_pass--B--/i',urlencode(trim($phone_pass)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--fronter--B--/i',urlencode(trim($fronter)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--closer--B--/i',urlencode(trim($closer)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--group--B--/i',urlencode(trim($VDADchannel_group)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--channel_group--B--/i',urlencode(trim($VDADchannel_group)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--SQLdate--B--/i',urlencode(trim($SQLdate)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--epoch--B--/i',urlencode(trim($epoch)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--uniqueid--B--/i',urlencode(trim($uniqueid)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--customer_zap_channel--B--/i',urlencode(trim($customer_zap_channel)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--customer_server_ip--B--/i',urlencode(trim($customer_server_ip)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--server_ip--B--/i',urlencode(trim($server_ip)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--SIPexten--B--/i',urlencode(trim($SIPexten)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--session_id--B--/i',urlencode(trim($session_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--phone--B--/i',urlencode(trim($phone)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--parked_by--B--/i',urlencode(trim($parked_by)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--dispo--B--/i',urlencode(trim($dispo)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--dialed_number--B--/i',urlencode(trim($dialed_number)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--dialed_label--B--/i',urlencode(trim($dialed_label)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--source_id--B--/i',urlencode(trim($source_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--rank--B--/i',urlencode(trim($rank)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--owner--B--/i',urlencode(trim($owner)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--camp_script--B--/i',urlencode(trim($camp_script)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--in_script--B--/i',urlencode(trim($in_script)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--fullname--B--/i',urlencode(trim($fullname)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--user_custom_one--B--/i',urlencode(trim($user_custom_one)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--user_custom_two--B--/i',urlencode(trim($user_custom_two)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--user_custom_three--B--/i',urlencode(trim($user_custom_three)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--user_custom_four--B--/i',urlencode(trim($user_custom_four)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--user_custom_five--B--/i',urlencode(trim($user_custom_five)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--talk_time--B--/i',"0",$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--talk_time_min--B--/i',"0",$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--entry_list_id--B--/i',urlencode(trim($entry_list_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--did_id--B--/i',urlencode(trim($DID_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--did_extension--B--/i',urlencode(trim($DID_extension)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--did_pattern--B--/i',urlencode(trim($DID_pattern)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--did_description--B--/i',urlencode(trim($DID_description)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--closecallid--B--/i',urlencode(trim($INclosecallid)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--xfercallid--B--/i',urlencode(trim($INxfercallid)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--agent_log_id--B--/i',urlencode(trim($agent_log_id)),$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace('/--A--call_id--B--/i',urlencode(trim($callerid)),$VDCL_start_call_url);
if (strlen($custom_field_names)>2)
{
@@ -6922,7 +6923,7 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
$form_field_value = urlencode(trim("$row[$o]"));
$field_name_id = $custom_field_names_ARY[$o];
$field_name_tag = "--A--" . $field_name_id . "--B--";
- $VDCL_start_call_url = eregi_replace("$field_name_tag","$form_field_value",$VDCL_start_call_url);
+ $VDCL_start_call_url = preg_replace("/$field_name_tag/i","$form_field_value",$VDCL_start_call_url);
$o++;
}
}
@@ -6936,7 +6937,7 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
### insert a new url log entry
$SQL_log = "$VDCL_start_call_url";
- $SQL_log = ereg_replace(';','',$SQL_log);
+ $SQL_log = preg_replace('/;/','',$SQL_log);
$SQL_log = addslashes($SQL_log);
# $upd_stmt="update vicidial_email_list set message='URL: $SQL_log' where lead_id='$lead_id'";
# $upd_rslt=mysql_query($upd_stmt, $link);
@@ -6959,7 +6960,7 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
$URLend_sec = date("U");
$URLdiff_sec = ($URLend_sec - $URLstart_sec);
$SCUfile_contents = implode("", $SCUfile);
- $SCUfile_contents = ereg_replace(';','',$SCUfile_contents);
+ $SCUfile_contents = preg_replace('/;/','',$SCUfile_contents);
$SCUfile_contents = addslashes($SCUfile_contents);
$stmt = "UPDATE vicidial_url_log SET response_sec='$URLdiff_sec',url_response='$SCUfile_contents' where url_log_id='$url_id';";
if ($DB) {echo "$stmt\n";}
@@ -6978,7 +6979,7 @@ if ($ACTION == 'VDADcheckINCOMINGemail')
$row=mysql_fetch_row($rslt);
$enable_vtiger_integration = $row[0];
}
- if ( ( ($enable_vtiger_integration > 0) and (ereg('callxfer',$VDCL_start_call_url)) and (ereg('contactwsid',$VDCL_start_call_url)) ) or (preg_match("/minuteswarning/",$VDCL_start_call_url)) )
+ if ( ( ($enable_vtiger_integration > 0) and (preg_match('/callxfer/',$VDCL_start_call_url)) and (preg_match('/contactwsid/',$VDCL_start_call_url)) ) or (preg_match("/minuteswarning/",$VDCL_start_call_url)) )
{
$SCUoutput='';
foreach ($SCUfile as $SCUline)
@@ -7208,8 +7209,8 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
get_audited_comments($lead_id,$format,$user,$mel,$NOW_TIME,$link,$server_ip,$session_name,$one_mysql_log);
}
$ACcomments = strip_tags(htmlentities($ACcomments));
- $ACcomments = eregi_replace("\r",'',$ACcomments);
- $ACcomments = eregi_replace("\n",'!N',$ACcomments);
+ $ACcomments = preg_replace("/\r/i",'',$ACcomments);
+ $ACcomments = preg_replace("/\n/i",'!N',$ACcomments);
//END Added by Poundteam for Audited Comments
}
@@ -7449,7 +7450,7 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
if (strlen($VDCL_timer_action_destination) < 1)
{$VDCL_timer_action_destination = $row[14];}
- if ( ( (ereg('NONE',$VDCL_ingroup_script)) and (strlen($VDCL_ingroup_script) < 5) ) or (strlen($VDCL_ingroup_script) < 1) )
+ if ( ( (preg_match('/NONE/',$VDCL_ingroup_script)) and (strlen($VDCL_ingroup_script) < 5) ) or (strlen($VDCL_ingroup_script) < 1) )
{
$VDCL_ingroup_script = $row[0];
$script_recording_delay=0;
@@ -7618,7 +7619,7 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
}
if ($cffn_ct > 0)
{
- $custom_field_names_SQL = eregi_replace(".$","",$custom_field_names_SQL);
+ $custom_field_names_SQL = preg_replace("/.$/i","",$custom_field_names_SQL);
### find the values of the named custom fields
$stmt = "SELECT $custom_field_names_SQL FROM custom_$entry_list_id where lead_id='$lead_id' limit 1;";
$rslt=mysql_query($stmt, $link);
@@ -7652,8 +7653,8 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
{$address3 = $original_phone_number;}
}
}
- $comments = eregi_replace("\r",'',$comments);
- $comments = eregi_replace("\n",'!N',$comments);
+ $comments = preg_replace("/\r/i",'',$comments);
+ $comments = preg_replace("/\n/i",'!N',$comments);
$LeaD_InfO = $callerid . "\n";
$LeaD_InfO .= $lead_id . "\n";
@@ -7741,7 +7742,7 @@ if ($ACTION == 'LeaDSearcHSelecTUpdatE')
$CBstatus = $row[0];
}
}
- if ( ($CBstatus > 0) or (eregi("CALLBK|CBHOLD", $dispo)) )
+ if ( ($CBstatus > 0) or (preg_match("/CALLBK|CBHOLD/i", $dispo)) )
{
$stmt="UPDATE vicidial_callbacks set status='INACTIVE' where lead_id='$lead_id' and status NOT IN('INACTIVE','DEAD','ARCHIVE');";
if ($format=='debug') {echo "\n";}
@@ -7908,7 +7909,7 @@ if ($ACTION == 'userLOGout')
}
##### END QUEUEMETRICS LOGGING LOOKUP #####
###########################################
- if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (eregi("SIP",$protocol)) )
+ if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (preg_match("/SIP/i",$protocol)) )
{
$SIPSAK_message = 'LOGGED OUT';
passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_message\" -r 5060 -s sip:$extension@$phone_ip > /dev/null");
@@ -8308,7 +8309,7 @@ if ($ACTION == 'updateDISPO')
}
$insert_into_dnc=0;
- if ( ( ($use_internal_dnc=='Y') or ($use_internal_dnc=='AREACODE') ) and (eregi("\|$log_dispo_choice\|", $DNC_string_check) ) )
+ if ( ( ($use_internal_dnc=='Y') or ($use_internal_dnc=='AREACODE') ) and (preg_match("/\|$log_dispo_choice\|/i", $DNC_string_check) ) )
{
$stmt = "SELECT phone_number from vicidial_list where lead_id='$lead_id';";
if ($DB) {echo "$stmt\n";}
@@ -8321,7 +8322,7 @@ if ($ACTION == 'updateDISPO')
if ($DB) {echo "$stmt\n";}
$insert_into_dnc++;
}
- if ( ( ($use_campaign_dnc=='Y') or ($use_campaign_dnc=='AREACODE') ) and (eregi("\|$log_dispo_choice\|", $DNC_string_check) ) )
+ if ( ( ($use_campaign_dnc=='Y') or ($use_campaign_dnc=='AREACODE') ) and (preg_match("/\|$log_dispo_choice\|/i", $DNC_string_check) ) )
{
$stmt="SELECT use_other_campaign_dnc from vicidial_campaigns where campaign_id='$campaign';";
$rslt=mysql_query($stmt, $link);
@@ -8357,13 +8358,13 @@ if ($ACTION == 'updateDISPO')
{
$row=mysql_fetch_row($rslt);
$agent_log_id = $row[6];
- if ( (eregi("NULL",$row[2])) or ($row[2] < 1000) )
+ if ( (preg_match("/NULL/i",$row[2])) or ($row[2] < 1000) )
{
$row[2]=$StarTtime;
$wait_sec=($row[2] - $row[3]);
$dispo_epochSQL = ",talk_epoch='$row[2]',wait_sec='$wait_sec'";
}
- if ( (eregi("NULL",$row[0])) or ($row[0] < 1000) )
+ if ( (preg_match("/NULL/i",$row[0])) or ($row[0] < 1000) )
{
$dispo_epochSQL .= ",dispo_epoch='$StarTtime'";
$row[0]=$row[2];
@@ -8371,11 +8372,11 @@ if ($ACTION == 'updateDISPO')
$dispo_sec = (($StarTtime - $row[0]) + $row[1]);
if ( (preg_match('/^M/',$MDnextCID)) and (preg_match('/INBOUND_MAN/',$dial_method)) )
{
- if ( (eregi("NULL",$row[5])) or (strlen($row[5]) < 1) )
+ if ( (preg_match("/NULL/i",$row[5])) or (strlen($row[5]) < 1) )
{
$lead_id_commentsSQL .= ",comments='MANUAL'";
}
- if ( (eregi("NULL",$row[4])) or ($row[4] < 1) or (strlen($row[4]) < 1) )
+ if ( (preg_match("/NULL/i",$row[4])) or ($row[4] < 1) or (strlen($row[4]) < 1) )
{
$lead_id_commentsSQL .= ",lead_id='$lead_id'";
}
@@ -8426,10 +8427,10 @@ if ($ACTION == 'updateDISPO')
### CALLBACK ENTRY
if ( ($dispo_choice == 'CBHOLD') and (strlen($CallBackDatETimE)>10) )
{
- $comments = eregi_replace('"','',$comments);
- $comments = eregi_replace("'",'',$comments);
- $comments = eregi_replace(';','',$comments);
- $comments = eregi_replace("\\\\",' ',$comments);
+ $comments = preg_replace('/"/i','',$comments);
+ $comments = preg_replace("/'/i",'',$comments);
+ $comments = preg_replace('/;/i','',$comments);
+ $comments = preg_replace("/\\\\/i",' ',$comments);
$stmt="INSERT INTO vicidial_callbacks (lead_id,list_id,campaign_id,status,entry_time,callback_time,user,recipient,comments,user_group,lead_status) values('$lead_id','$list_id','$campaign','ACTIVE','$NOW_TIME','$CallBackDatETimE','$user','$recipient','$comments','$user_group','$CallBackLeadStatus');";
if ($DB) {echo "$stmt\n";}
$rslt=mysql_query($stmt, $link);
@@ -8474,7 +8475,7 @@ if ($ACTION == 'updateDISPO')
$api_manual_dial = $row[3];
$use_other_campaign_dnc = $row[4];
- if ( ($auto_dial_level > 0) and (ereg(" $dispo_choice ",$VC_auto_alt_dial_statuses)) )
+ if ( ($auto_dial_level > 0) and (preg_match("/\s$dispo_choice\s/",$VC_auto_alt_dial_statuses)) )
{
$stmt = "SELECT count(*) from vicidial_hopper where lead_id='$lead_id' and status='HOLD';";
if ($DB) {echo "$stmt\n";}
@@ -8499,9 +8500,9 @@ if ($ACTION == 'updateDISPO')
$vh_phone = $row[0];
}
- if ( (ereg("Y",$use_internal_dnc)) or (ereg("AREACODE",$use_internal_dnc)) )
+ if ( (preg_match("/Y/",$use_internal_dnc)) or (preg_match("/AREACODE/",$use_internal_dnc)) )
{
- if (ereg("AREACODE",$use_internal_dnc))
+ if (preg_match("/AREACODE/",$use_internal_dnc))
{
$vhp_phone_areacode = substr($vh_phone, 0, 3);
$vhp_phone_areacode .= "XXXXXXX";
@@ -8520,11 +8521,11 @@ if ($ACTION == 'updateDISPO')
}
}
- if ( (ereg("Y",$use_campaign_dnc)) or (ereg("AREACODE",$use_campaign_dnc)) )
+ if ( (preg_match("/Y/",$use_campaign_dnc)) or (preg_match("/AREACODE/",$use_campaign_dnc)) )
{
$temp_campaign_id = $campaign;
if (strlen($use_other_campaign_dnc) > 0) {$temp_campaign_id = $use_other_campaign_dnc;}
- if (ereg("AREACODE",$use_campaign_dnc))
+ if (preg_match("/AREACODE/",$use_campaign_dnc))
{
$vhp_phone_areacode = substr($vh_phone, 0, 3);
$vhp_phone_areacode .= "XXXXXXX";
@@ -8545,7 +8546,7 @@ if ($ACTION == 'updateDISPO')
if ( ($UD_DNC_campaign > 0) or ($UD_DNC_internal > 0) )
{
- if ( ( (ereg(" DNCC ",$VC_auto_alt_dial_statuses)) and ($UD_DNC_campaign > 0) ) or ( (ereg(" DNCL ",$VC_auto_alt_dial_statuses)) and ($UD_DNC_internal > 0) ) )
+ if ( ( (preg_match("/\sDNCC\s/",$VC_auto_alt_dial_statuses)) and ($UD_DNC_campaign > 0) ) or ( (preg_match("/\sDNCL\s/",$VC_auto_alt_dial_statuses)) and ($UD_DNC_internal > 0) ) )
{
$stmt="UPDATE vicidial_hopper set status='DNC' where lead_id='$lead_id' and status='HOLD' limit 1;";
if ($format=='debug') {echo "\n";}
@@ -8608,7 +8609,7 @@ if ($ACTION == 'updateDISPO')
$vtiger_search_dead = $row[3];
$vtiger_status_call = $row[4];
}
- if ( (ereg('ACCTID',$vtiger_search_category)) or (ereg('ACCOUNT',$vtiger_search_category)) )
+ if ( (preg_match('/ACCTID/',$vtiger_search_category)) or (preg_match('/ACCOUNT/',$vtiger_search_category)) )
{
### find the full status name for this status
$stmt = "SELECT status_name from vicidial_statuses where status='$dispo_choice';";
@@ -8661,7 +8662,7 @@ if ($ACTION == 'updateDISPO')
if ($VIDcount > 0)
{
### create a call record in vtiger linked to the account
- if (ereg('DISPO',$vtiger_create_call_record))
+ if (preg_match('/DISPO/',$vtiger_create_call_record))
{
$TODAY = date("Y-m-d");
$HHMMnow = date("H:i");
@@ -8772,7 +8773,7 @@ if ($ACTION == 'updateDISPO')
}
}
### update the status of the record in vtiger
- if (ereg('Y',$vtiger_status_call))
+ if (preg_match('/Y/',$vtiger_status_call))
{
#Get logged in user ID
$stmt="SELECT id from vtiger_users where user_name='$user';";
@@ -8859,9 +8860,9 @@ if ($ACTION == 'updateDISPO')
$VT_last_noncontact_update=0; $VT_last_noncontact_ct=0;
$VT_last_contact_update=0; $VT_last_contact_ct=0;
$VT_last_sale_update=0; $VT_last_sale_ct=0;
- if (eregi("\|$dispo_choice\|", $SALE_string_check) )
+ if (preg_match("/\|$dispo_choice\|/i", $SALE_string_check) )
{$VT_last_sale_update++;}
- if (eregi("\|$dispo_choice\|", $CC_string_check) )
+ if (preg_match("/\|$dispo_choice\|/i", $CC_string_check) )
{$VT_last_contact_update++;}
else
{$VT_last_noncontact_update++;}
@@ -9102,7 +9103,7 @@ if ($ACTION == 'updateDISPO')
$talk_time=0;
$talk_time_ms=0;
$talk_time_min=0;
- if ( (eregi('--A--user_custom_',$dispo_call_url)) or (eregi('--A--fullname',$dispo_call_url)) )
+ if ( (preg_match('/--A--user_custom_/i',$dispo_call_url)) or (preg_match('/--A--fullname/i',$dispo_call_url)) )
{
$stmt = "SELECT custom_one,custom_two,custom_three,custom_four,custom_five,full_name from vicidial_users where user='$user';";
if ($DB) {echo "$stmt\n";}
@@ -9121,7 +9122,7 @@ if ($ACTION == 'updateDISPO')
}
}
- if (eregi('--A--talk_time',$dispo_call_url))
+ if (preg_match('/--A--talk_time/i',$dispo_call_url))
{
$stmt = "SELECT talk_sec,dead_sec from vicidial_agent_log where lead_id='$lead_id' and agent_log_id='$CALL_agent_log_id';";
if ($DB) {echo "$stmt\n";}
@@ -9147,7 +9148,7 @@ if ($ACTION == 'updateDISPO')
}
}
- if (eregi('--A--dispo_name--B--',$dispo_call_url))
+ if (preg_match('/--A--dispo_name--B--/i',$dispo_call_url))
{
### find the full status name for this status
$stmt = "SELECT status_name from vicidial_statuses where status='$dispo_choice';";
@@ -9177,7 +9178,7 @@ if ($ACTION == 'updateDISPO')
}
$dispo_name = urlencode(trim($status_name));
- if (eregi('--A--call_notes',$dispo_call_url))
+ if (preg_match('/--A--call_notes/i',$dispo_call_url))
{
if (strlen($call_notes) > 1)
{$url_call_notes = urlencode(trim($call_notes));}
@@ -9185,7 +9186,7 @@ if ($ACTION == 'updateDISPO')
{$url_call_notes = urlencode(" ");}
}
- if (eregi('--A--dialed_',$dispo_call_url))
+ if (preg_match('/--A--dialed_/i',$dispo_call_url))
{
$dialed_number = $phone_number;
$dialed_label = 'NONE';
@@ -9207,7 +9208,7 @@ if ($ACTION == 'updateDISPO')
}
}
- if (eregi('--A--did_',$dispo_call_url))
+ if (preg_match('/--A--did_/i',$dispo_call_url))
{
$DID_id='';
$DID_extension='';
@@ -9239,7 +9240,7 @@ if ($ACTION == 'updateDISPO')
}
}
- if ((eregi('callid--B--',$dispo_call_url)) or (eregi('group--B--',$dispo_call_url)))
+ if ((preg_match('/callid--B--/i',$dispo_call_url)) or (preg_match('/group--B--/i',$dispo_call_url)))
{
$INclosecallid='';
$INxfercallid='';
@@ -9301,79 +9302,79 @@ if ($ACTION == 'updateDISPO')
}
$dispo_call_url = preg_replace('/^VAR/','',$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--lead_id--B--',"$lead_id",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--vendor_id--B--',"$vendor_id",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--vendor_lead_code--B--',"$vendor_lead_code",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--list_id--B--',"$list_id",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--gmt_offset_now--B--',"$gmt_offset_now",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--phone_code--B--',"$phone_code",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--phone_number--B--',"$phone_number",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--title--B--',"$title",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--first_name--B--',"$first_name",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--middle_initial--B--',"$middle_initial",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--last_name--B--',"$last_name",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--address1--B--',"$address1",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--address2--B--',"$address2",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--address3--B--',"$address3",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--city--B--',"$city",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--state--B--',"$state",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--province--B--',"$province",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--postal_code--B--',"$postal_code",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--country_code--B--',"$country_code",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--gender--B--',"$gender",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--date_of_birth--B--',"$date_of_birth",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--alt_phone--B--',"$alt_phone",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--email--B--',"$email",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--security_phrase--B--',"$security_phrase",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--comments--B--',"$comments",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--user--B--',"$user",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--pass--B--',"$pass",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--campaign--B--',"$campaign",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--phone_login--B--',"$phone_login",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--original_phone_login--B--',"$original_phone_login",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--phone_pass--B--',"$phone_pass",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--fronter--B--',"$fronter",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--closer--B--',"$user",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--group--B--',"$VDADchannel_group",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--channel_group--B--',"$VDADchannel_group",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--SQLdate--B--',"$SQLdate",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--epoch--B--',"$epoch",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--uniqueid--B--',"$uniqueid",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--customer_zap_channel--B--',"$customer_zap_channel",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--customer_server_ip--B--',"$customer_server_ip",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--server_ip--B--',"$server_ip",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--SIPexten--B--',"$SIPexten",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--session_id--B--',"$session_id",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--phone--B--',"$phone",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--parked_by--B--',"$parked_by",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--dispo--B--',"$dispo",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--dispo_name--B--',"$dispo_name",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--dialed_number--B--',"$dialed_number",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--dialed_label--B--',"$dialed_label",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--source_id--B--',"$source_id",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--rank--B--',"$rank",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--owner--B--',"$owner",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--camp_script--B--',"$camp_script",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--in_script--B--',"$in_script",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--fullname--B--',"$fullname",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--user_custom_one--B--',"$user_custom_one",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--user_custom_two--B--',"$user_custom_two",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--user_custom_three--B--',"$user_custom_three",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--user_custom_four--B--',"$user_custom_four",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--user_custom_five--B--',"$user_custom_five",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--talk_time--B--',"$talk_time",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--talk_time_ms--B--',"$talk_time_ms",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--talk_time_min--B--',"$talk_time_min",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--agent_log_id--B--',"$CALL_agent_log_id",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--entry_list_id--B--',"$entry_list_id",$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--did_id--B--',urlencode(trim($DID_id)),$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--did_extension--B--',urlencode(trim($DID_extension)),$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--did_pattern--B--',urlencode(trim($DID_pattern)),$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--did_description--B--',urlencode(trim($DID_description)),$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--closecallid--B--',urlencode(trim($INclosecallid)),$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--xfercallid--B--',urlencode(trim($INxfercallid)),$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--call_id--B--',urlencode(trim($MDnextCID)),$dispo_call_url);
- $dispo_call_url = eregi_replace('--A--call_notes--B--',"$url_call_notes",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--lead_id--B--/i',"$lead_id",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--vendor_id--B--/i',"$vendor_id",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--vendor_lead_code--B--/i',"$vendor_lead_code",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--list_id--B--/i',"$list_id",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--gmt_offset_now--B--/i',"$gmt_offset_now",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--phone_code--B--/i',"$phone_code",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--phone_number--B--/i',"$phone_number",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--title--B--/i',"$title",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--first_name--B--/i',"$first_name",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--middle_initial--B--/i',"$middle_initial",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--last_name--B--/i',"$last_name",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--address1--B--/i',"$address1",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--address2--B--/i',"$address2",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--address3--B--/i',"$address3",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--city--B--/i',"$city",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--state--B--/i',"$state",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--province--B--/i',"$province",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--postal_code--B--/i',"$postal_code",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--country_code--B--/i',"$country_code",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--gender--B--/i',"$gender",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--date_of_birth--B--/i',"$date_of_birth",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--alt_phone--B--/i',"$alt_phone",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--email--B--/i',"$email",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--security_phrase--B--/i',"$security_phrase",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--comments--B--/i',"$comments",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--user--B--/i',"$user",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--pass--B--/i',"$pass",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--campaign--B--/i',"$campaign",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--phone_login--B--/i',"$phone_login",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--original_phone_login--B--/i',"$original_phone_login",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--phone_pass--B--/i',"$phone_pass",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--fronter--B--/i',"$fronter",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--closer--B--/i',"$user",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--group--B--/i',"$VDADchannel_group",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--channel_group--B--/i',"$VDADchannel_group",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--SQLdate--B--/i',"$SQLdate",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--epoch--B--/i',"$epoch",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--uniqueid--B--/i',"$uniqueid",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--customer_zap_channel--B--/i',"$customer_zap_channel",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--customer_server_ip--B--/i',"$customer_server_ip",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--server_ip--B--/i',"$server_ip",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--SIPexten--B--/i',"$SIPexten",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--session_id--B--/i',"$session_id",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--phone--B--/i',"$phone",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--parked_by--B--/i',"$parked_by",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--dispo--B--/i',"$dispo",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--dispo_name--B--/i',"$dispo_name",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--dialed_number--B--/i',"$dialed_number",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--dialed_label--B--/i',"$dialed_label",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--source_id--B--/i',"$source_id",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--rank--B--/i',"$rank",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--owner--B--/i',"$owner",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--camp_script--B--/i',"$camp_script",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--in_script--B--/i',"$in_script",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--fullname--B--/i',"$fullname",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--user_custom_one--B--/i',"$user_custom_one",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--user_custom_two--B--/i',"$user_custom_two",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--user_custom_three--B--/i',"$user_custom_three",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--user_custom_four--B--/i',"$user_custom_four",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--user_custom_five--B--/i',"$user_custom_five",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--talk_time--B--/i',"$talk_time",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--talk_time_ms--B--/i',"$talk_time_ms",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--talk_time_min--B--/i',"$talk_time_min",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--agent_log_id--B--/i',"$CALL_agent_log_id",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--entry_list_id--B--/i',"$entry_list_id",$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--did_id--B--/i',urlencode(trim($DID_id)),$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--did_extension--B--/i',urlencode(trim($DID_extension)),$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--did_pattern--B--/i',urlencode(trim($DID_pattern)),$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--did_description--B--/i',urlencode(trim($DID_description)),$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--closecallid--B--/i',urlencode(trim($INclosecallid)),$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--xfercallid--B--/i',urlencode(trim($INxfercallid)),$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--call_id--B--/i',urlencode(trim($MDnextCID)),$dispo_call_url);
+ $dispo_call_url = preg_replace('/--A--call_notes--B--/i',"$url_call_notes",$dispo_call_url);
if (strlen($FORMcustom_field_names)>2)
{
@@ -9398,7 +9399,7 @@ if ($ACTION == 'updateDISPO')
$form_field_value = urlencode(trim("$row[$o]"));
$field_name_id = $custom_field_names_ARY[$o];
$field_name_tag = "--A--" . $field_name_id . "--B--";
- $dispo_call_url = eregi_replace("$field_name_tag","$form_field_value",$dispo_call_url);
+ $dispo_call_url = preg_replace("/$field_name_tag/i","$form_field_value",$dispo_call_url);
$o++;
}
}
@@ -9412,7 +9413,7 @@ if ($ACTION == 'updateDISPO')
### insert a new url log entry
$SQL_log = "$dispo_call_url";
- $SQL_log = ereg_replace(';','',$SQL_log);
+ $SQL_log = preg_replace('/;/','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt = "INSERT INTO vicidial_url_log SET uniqueid='$uniqueid',url_date='$NOW_TIME',url_type='dispo',url='$SQL_log',url_response='';";
if ($DB) {echo "$stmt\n";}
@@ -9432,7 +9433,7 @@ if ($ACTION == 'updateDISPO')
$URLend_sec = date("U");
$URLdiff_sec = ($URLend_sec - $URLstart_sec);
$SCUfile_contents = implode("", $SCUfile);
- $SCUfile_contents = ereg_replace(';','',$SCUfile_contents);
+ $SCUfile_contents = preg_replace('/;/','',$SCUfile_contents);
$SCUfile_contents = addslashes($SCUfile_contents);
$stmt = "UPDATE vicidial_url_log SET response_sec='$URLdiff_sec',url_response='$SCUfile_contents' where url_log_id='$url_id';";
if ($DB) {echo "$stmt\n";}
@@ -9450,7 +9451,7 @@ if ($ACTION == 'updateDISPO')
$row=mysql_fetch_row($rslt);
$enable_vtiger_integration = $row[0];
}
- if ( ($enable_vtiger_integration > 0) and (ereg('mode=callend',$dispo_call_url)) and (ereg('contactwsid',$dispo_call_url)) )
+ if ( ($enable_vtiger_integration > 0) and (preg_match('/mode=callend/',$dispo_call_url)) and (preg_match('/contactwsid/',$dispo_call_url)) )
{
$SCUoutput='';
foreach ($SCUfile as $SCUline)
@@ -9580,14 +9581,14 @@ if ($ACTION == 'updateLEAD')
$disable_alter_custphone = $row[1];
$i++;
}
- if ( (ereg('Y',$disable_alter_custdata)) or (ereg('Y',$disable_alter_custphone)) )
+ if ( (preg_match('/Y/',$disable_alter_custdata)) or (preg_match('/Y/',$disable_alter_custphone)) )
{
- if (ereg('Y',$disable_alter_custdata))
+ if (preg_match('/Y/',$disable_alter_custdata))
{
$DO_NOT_UPDATE=1;
$DO_NOT_UPDATE_text=' NOT';
}
- if (ereg('Y',$disable_alter_custphone))
+ if (preg_match('/Y/',$disable_alter_custphone))
{
$DO_NOT_UPDATEphone=1;
}
@@ -9604,12 +9605,12 @@ if ($ACTION == 'updateLEAD')
$alter_custphone_override = $row[1];
$i++;
}
- if (ereg('ALLOW_ALTER',$alter_custdata_override))
+ if (preg_match('/ALLOW_ALTER/',$alter_custdata_override))
{
$DO_NOT_UPDATE=0;
$DO_NOT_UPDATE_text='';
}
- if (ereg('ALLOW_ALTER',$alter_custphone_override))
+ if (preg_match('/ALLOW_ALTER/',$alter_custphone_override))
{
$DO_NOT_UPDATEphone=0;
}
@@ -9617,11 +9618,11 @@ if ($ACTION == 'updateLEAD')
if ($DO_NOT_UPDATE < 1)
{
- $comments = eregi_replace("\r",'',$comments);
- $comments = eregi_replace("\n",'!N',$comments);
- $comments = eregi_replace("--AMP--",'&',$comments);
- $comments = eregi_replace("--QUES--",'?',$comments);
- $comments = eregi_replace("--POUND--",'#',$comments);
+ $comments = preg_replace("/\r/i",'',$comments);
+ $comments = preg_replace("/\n/i",'!N',$comments);
+ $comments = preg_replace("/--AMP--/i",'&',$comments);
+ $comments = preg_replace("/--QUES--/i",'?',$comments);
+ $comments = preg_replace("/--POUND--/i",'#',$comments);
$phoneSQL='';
if ($DO_NOT_UPDATEphone < 1)
@@ -9734,8 +9735,8 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
###########################################
if ($enable_queuemetrics_logging > 0)
{
- if ( (ereg('READY',$stage)) or (ereg('CLOSER',$stage)) ) {$QMstatus='UNPAUSEALL';}
- if (ereg('PAUSE',$stage)) {$QMstatus='PAUSEALL';}
+ if ( (preg_match('/READY/',$stage)) or (preg_match('/CLOSER/',$stage)) ) {$QMstatus='UNPAUSEALL';}
+ if (preg_match('/PAUSE/',$stage)) {$QMstatus='PAUSEALL';}
$linkB=mysql_connect("$queuemetrics_server_ip", "$queuemetrics_login", "$queuemetrics_pass");
mysql_select_db("$queuemetrics_dbname", $linkB);
@@ -9791,7 +9792,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
{
$wait_sec = (($StarTtime - $row[2]) + $row[3]);
}
- if ( (eregi("NULL",$row[4])) or ($row[4] < 1000) )
+ if ( (preg_match("/NULL/i",$row[4])) or ($row[4] < 1000) )
{$pause_sec = (($StarTtime - $row[0]) + $row[1]);}
else
{$pause_sec = (($row[4] - $row[0]) + $row[1]);}
@@ -9799,7 +9800,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
}
if ($ACTION == 'VDADready')
{
- if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) )
+ if ( (preg_match("/NULL/i",$dispo_epoch)) or ($dispo_epoch < 1000) )
{
$stmt="UPDATE vicidial_agent_log set pause_sec='$pause_sec',wait_epoch='$StarTtime' where agent_log_id='$agent_log_id';";
if ($format=='debug') {echo "\n";}
@@ -9809,7 +9810,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
}
if ($ACTION == 'VDADpause')
{
- if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) )
+ if ( (preg_match("/NULL/i",$dispo_epoch)) or ($dispo_epoch < 1000) )
{
$stmt="UPDATE vicidial_agent_log set wait_sec='$wait_sec' where agent_log_id='$agent_log_id';";
if ($format=='debug') {echo "\n";}
@@ -9822,7 +9823,7 @@ if ( ($ACTION == 'VDADpause') || ($ACTION == 'VDADready') )
if ($wrapup == 'WRAPUP')
{
- if ( (eregi("NULL",$dispo_epoch)) or ($dispo_epoch < 1000) )
+ if ( (preg_match("/NULL/i",$dispo_epoch)) or ($dispo_epoch < 1000) )
{
$stmt="UPDATE vicidial_agent_log set dispo_epoch='$StarTtime', dispo_sec='0' where agent_log_id='$agent_log_id';";
}
@@ -10011,7 +10012,7 @@ if ($ACTION == 'PauseCodeSubmit')
}
##### END QUEUEMETRICS LOGGING LOOKUP #####
###########################################
- if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (eregi("SIP",$protocol)) )
+ if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (preg_match("/SIP/i",$protocol)) )
{
$SIPSAK_prefix = 'BK-';
passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_prefix$status\" -r 5060 -s sip:$extension@$phone_ip > /dev/null");
@@ -10056,8 +10057,8 @@ if ($ACTION == 'AGENTSview')
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00226',$VD_login,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$agent_status_viewable_groups = $row[0];
- $agent_status_viewable_groupsSQL = eregi_replace(' ','',$agent_status_viewable_groups);
- $agent_status_viewable_groupsSQL = eregi_replace(' ',"','",$agent_status_viewable_groupsSQL);
+ $agent_status_viewable_groupsSQL = preg_replace('/\s\s/i','',$agent_status_viewable_groups);
+ $agent_status_viewable_groupsSQL = preg_replace('/\s/i',"','",$agent_status_viewable_groupsSQL);
$agent_status_viewable_groupsSQL = "user_group IN('$agent_status_viewable_groupsSQL')";
$agent_status_view = 0;
if (strlen($agent_status_viewable_groups) > 2)
@@ -10066,13 +10067,13 @@ if ($ACTION == 'AGENTSview')
if ($row[1] == 'Y')
{$agent_status_view_time=1;}
$andSQL='';
- if (ereg("ALL-GROUPS",$agent_status_viewable_groups))
+ if (preg_match("/ALL-GROUPS/",$agent_status_viewable_groups))
{$AGENTviewSQL = "";}
else
{
$AGENTviewSQL = "($agent_status_viewable_groupsSQL)";
- if (ereg("CAMPAIGN-AGENTS",$agent_status_viewable_groups))
+ if (preg_match("/CAMPAIGN-AGENTS/",$agent_status_viewable_groups))
{$AGENTviewSQL = "($AGENTviewSQL or (campaign_id='$campaign'))";}
$AGENTviewSQL = "and $AGENTviewSQL";
}
@@ -10151,11 +10152,11 @@ if ($ACTION == 'AGENTSview')
}
$loop_count++;
}
- $agentviewlistSQL = eregi_replace(".$","",$agentviewlistSQL);
+ $agentviewlistSQL = preg_replace("/.$/i","",$agentviewlistSQL);
if (strlen($agentviewlistSQL)<3)
{$agentviewlistSQL = "''";}
- if (ereg("NOT-LOGGED-IN-AGENTS",$agent_status_viewable_groups))
+ if (preg_match("/NOT-LOGGED-IN-AGENTS/",$agent_status_viewable_groups))
{
$stmt="SELECT user,full_name from vicidial_users where user NOT IN($agentviewlistSQL) order by full_name;";
$rslt=mysql_query($stmt, $link);
@@ -10232,7 +10233,7 @@ if ($ACTION == 'AGENTSview')
echo " \n";
echo " -READY -INCALL -PAUSED \n";
- if (ereg("NOT-LOGGED-IN-AGENTS",$agent_status_viewable_groups))
+ if (preg_match("/NOT-LOGGED-IN-AGENTS/",$agent_status_viewable_groups))
{echo " -LOGGED-OUT \n";}
echo "\n";
@@ -10252,14 +10253,14 @@ if ($ACTION == 'CALLSINQUEUEview')
$view_calls_in_queue = $row[0];
$grab_calls_in_queue = $row[1];
- if (eregi('NONE',$view_calls_in_queue))
+ if (preg_match('/NONE/i',$view_calls_in_queue))
{
echo "Calls in Queue View Disabled for this campaign\n";
exit;
}
else
{
- $view_calls_in_queue = ereg_replace('ALL','99', $view_calls_in_queue);
+ $view_calls_in_queue = preg_replace('/ALL/','99', $view_calls_in_queue);
### grab the status and campaign/in-group information for this agent to display
$ADsql='';
@@ -10271,11 +10272,11 @@ if ($ACTION == 'CALLSINQUEUEview')
$Alogin=$row[0];
$Acampaign=$row[1];
$AccampSQL=$row[2];
- $AccampSQL = ereg_replace(' -','', $AccampSQL);
- $AccampSQL = ereg_replace(' ',"','", $AccampSQL);
- if (eregi('AGENTDIRECT', $AccampSQL))
+ $AccampSQL = preg_replace('/\s-/','', $AccampSQL);
+ $AccampSQL = preg_replace('/\s/',"','", $AccampSQL);
+ if (preg_match('/AGENTDIRECT/i', $AccampSQL))
{
- $AccampSQL = ereg_replace('AGENTDIRECT','', $AccampSQL);
+ $AccampSQL = preg_replace('/AGENTDIRECT/','', $AccampSQL);
$ADsql = "or ( (campaign_id LIKE \"%AGENTDIRECT%\") and (agent_only='$user') )";
}
@@ -10304,7 +10305,7 @@ if ($ACTION == 'CALLSINQUEUEview')
$o=0;
while ($calls_count > $loop_count)
{
- if (eregi('AGENTDIRECT', $CQcampaign_id[$loop_count]))
+ if (preg_match('/AGENTDIRECT/i', $CQcampaign_id[$loop_count]))
{
$OQlead_id[$o] = $CQlead_id[$loop_count];
$OQcampaign_id[$o] = $CQcampaign_id[$loop_count];
@@ -10320,7 +10321,7 @@ if ($ACTION == 'CALLSINQUEUEview')
$loop_count=0;
while ($calls_count > $loop_count)
{
- if (!eregi('AGENTDIRECT', $CQcampaign_id[$loop_count]))
+ if (!preg_match('/AGENTDIRECT/i', $CQcampaign_id[$loop_count]))
{
$OQlead_id[$o] = $CQlead_id[$loop_count];
$OQcampaign_id[$o] = $CQcampaign_id[$loop_count];
@@ -10395,10 +10396,10 @@ if ($ACTION == 'CALLSINQUEUEview')
{$caller_name = $comments;}
if (strlen($caller_name) > 30) {$caller_name = substr("$caller_name", 0, 30);}
- if (eregi("0$|2$|4$|6$|8$", $loop_count)) {$Qcolor='bgcolor="#FCFCFC"';}
+ if (preg_match("/0$|2$|4$|6$|8$/i", $loop_count)) {$Qcolor='bgcolor="#FCFCFC"';}
else{$Qcolor='bgcolor="#ECECEC"';}
- if ( (eregi('Y',$grab_calls_in_queue)) and ($OQcall_type[$loop_count]=='IN') )
+ if ( (preg_match('/Y/i',$grab_calls_in_queue)) and ($OQcall_type[$loop_count]=='IN') )
{
echo "
\n";
-if ( ( ($IFRAME < 1) and ($ScrollDIV > 0) ) or (eregi("IGNORENOSCROLL",$script_text)) )
+if ( ( ($IFRAME < 1) and ($ScrollDIV > 0) ) or (preg_match("/IGNORENOSCROLL/i",$script_text)) )
{echo "
";}
echo "
$script_name
\n";
echo "$script_text\n";
-if ( ( ($IFRAME < 1) and ($ScrollDIV > 0) ) or (eregi("IGNORENOSCROLL",$script_text)) )
+if ( ( ($IFRAME < 1) and ($ScrollDIV > 0) ) or (preg_match("/IGNORENOSCROLL/i",$script_text)) )
{echo "
";}
echo "
\n";
diff --git a/www/agc/vdc_script_dispo_example.php b/www/agc/vdc_script_dispo_example.php
index e1b63394..9d387100 100644
--- a/www/agc/vdc_script_dispo_example.php
+++ b/www/agc/vdc_script_dispo_example.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# This script is designed to be used in the SCRIPT tab in an IFRAME and will not submit unless a specific field is filled in
#
@@ -14,10 +14,11 @@
# CHANGELOG:
# 110208-1239 - First build of script based upon vdc_script_notes.php
# 110221-1252 - Added missing variables, accounted for call notes on manual dial calls
+# 130328-0019 - Converted ereg to preg functions
#
-$version = '2.4-2';
-$build = '110221-1252';
+$version = '2.6-3';
+$build = '130328-0019';
require("dbconnect.php");
@@ -261,16 +262,16 @@ if ($qm_conf_ct > 0)
if ($non_latin < 1)
{
- $user=ereg_replace("[^-_0-9a-zA-Z]","",$user);
- $pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass);
- $length_in_sec = ereg_replace("[^0-9]","",$length_in_sec);
- $phone_code = ereg_replace("[^0-9]","",$phone_code);
- $phone_number = ereg_replace("[^0-9]","",$phone_number);
+ $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
+ $pass=preg_replace("/[^-_0-9a-zA-Z]/","",$pass);
+ $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);
}
else
{
- $user = ereg_replace("'|\"|\\\\|;","",$user);
- $pass = ereg_replace("'|\"|\\\\|;","",$pass);
+ $user = preg_replace("/\'|\"|\\\\|;/","",$user);
+ $pass = preg_replace("/\'|\"|\\\\|;/","",$pass);
}
if ($DB > 0)
@@ -704,7 +705,7 @@ $DS=0;
while ($statuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
- if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) )
+ if ( (strlen($dispo) == strlen($rowx[0])) and (preg_match("/$dispo/i",$rowx[0])) )
{$statuses_list .= "\n"; $DS++;}
else
{$statuses_list .= "\n";}
@@ -720,7 +721,7 @@ $CBhold_set=0;
while ($CAMPstatuses_to_print > $o)
{
$rowx=mysql_fetch_row($rslt);
- if ( (strlen($dispo) == strlen($rowx[0])) and (eregi($dispo,$rowx[0])) )
+ if ( (strlen($dispo) == strlen($rowx[0])) and (preg_match("/$dispo/i",$rowx[0])) )
{$statuses_list .= "\n"; $DS++;}
else
{$statuses_list .= "\n";}
diff --git a/www/agc/vdc_script_notes.php b/www/agc/vdc_script_notes.php
index 818f9750..4992981d 100644
--- a/www/agc/vdc_script_notes.php
+++ b/www/agc/vdc_script_notes.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell LICENSE: AGPLv2
#
# This script is designed open in the SCRIPT tab in the agent interface through
# an IFRAME. It will create a new record for every SUBMIT
@@ -12,10 +12,11 @@
# CHANGELOG:
# 100215-0744 - First build of script
# 100622-2230 - Added field labels
+# 130328-0020 - Converted ereg to preg functions
#
-$version = '2.4-2';
-$build = '100622-2230';
+$version = '2.6-3';
+$build = '130328-0020';
require("dbconnect.php");
@@ -229,16 +230,16 @@ if ($qm_conf_ct > 0)
if ($non_latin < 1)
{
- $user=ereg_replace("[^-_0-9a-zA-Z]","",$user);
- $pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass);
- $length_in_sec = ereg_replace("[^0-9]","",$length_in_sec);
- $phone_code = ereg_replace("[^0-9]","",$phone_code);
- $phone_number = ereg_replace("[^0-9]","",$phone_number);
+ $user=preg_replace("/[^-_0-9a-zA-Z]/","",$user);
+ $pass=preg_replace("/[^-_0-9a-zA-Z]/","",$pass);
+ $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);
}
else
{
- $user = ereg_replace("'|\"|\\\\|;","",$user);
- $pass = ereg_replace("'|\"|\\\\|;","",$pass);
+ $user = preg_replace("/\'|\"|\\\\|;/","",$user);
+ $pass = preg_replace("/\'|\"|\\\\|;/","",$pass);
}
if ($DB > 0)
diff --git a/www/agc/vicidial.php b/www/agc/vicidial.php
index 57209422..aafb5e7a 100644
--- a/www/agc/vicidial.php
+++ b/www/agc/vicidial.php
@@ -394,10 +394,11 @@
# 121206-0634 - Added inbound lead search feature
# 121222-2315 - Added inbound email features
# 130220-1214 - Fixed issue with 3-way call dial timeout
+# 130328-0006 - Converted ereg to preg functions
#
-$version = '2.6-362c';
-$build = '130220-1214';
+$version = '2.6-363c';
+$build = '130328-0006';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=79;
$one_mysql_log=0;
@@ -438,7 +439,7 @@ if (!isset($phone_pass))
if (isset($VD_campaign))
{
$VD_campaign = strtoupper($VD_campaign);
- $VD_campaign = eregi_replace(" ",'',$VD_campaign);
+ $VD_campaign = preg_replace("/\s/i",'',$VD_campaign);
}
if (!isset($flag_channels))
{
@@ -447,12 +448,12 @@ if (!isset($flag_channels))
}
### security strip all non-alphanumeric characters out of the variables ###
-$DB=ereg_replace("[^0-9a-z]","",$DB);
-$phone_login=ereg_replace("[^\,0-9a-zA-Z]","",$phone_login);
-$phone_pass=ereg_replace("[^0-9a-zA-Z]","",$phone_pass);
-$VD_login=ereg_replace("[^-_0-9a-zA-Z]","",$VD_login);
-$VD_pass=ereg_replace("[^-_0-9a-zA-Z]","",$VD_pass);
-$VD_campaign = ereg_replace("[^-_0-9a-zA-Z]","",$VD_campaign);
+$DB=preg_replace("/[^0-9a-z]/","",$DB);
+$phone_login=preg_replace("/[^\,0-9a-zA-Z]/","",$phone_login);
+$phone_pass=preg_replace("/[^0-9a-zA-Z]/","",$phone_pass);
+$VD_login=preg_replace("/[^-_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);
$forever_stop=0;
@@ -627,12 +628,12 @@ $browser = getenv("HTTP_USER_AGENT");
$script_name = getenv("SCRIPT_NAME");
$server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT");
-if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';}
+if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';}
if (($server_port == '80') or ($server_port == '443') ) {$server_port='';}
else {$server_port = "$CL$server_port";}
$agcPAGE = "$HTTPprotocol$server_name$server_port$script_name";
-$agcDIR = eregi_replace('vicidial.php','',$agcPAGE);
+$agcDIR = preg_replace('/vicidial\.php/i','',$agcPAGE);
if (strlen($static_agent_url) > 5)
{$agcPAGE = $static_agent_url;}
@@ -670,10 +671,10 @@ if ($campaign_login_list > 0)
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01003',$VD_login,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
- if ( (!eregi("ALL-CAMPAIGNS",$row[0])) )
+ if ( (!preg_match("/ALL-CAMPAIGNS/i",$row[0])) )
{
- $LOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]);
- $LOGallowed_campaignsSQL = eregi_replace(' ',"','",$LOGallowed_campaignsSQL);
+ $LOGallowed_campaignsSQL = preg_replace('/\s-/i','',$row[0]);
+ $LOGallowed_campaignsSQL = preg_replace('/\s/i',"','",$LOGallowed_campaignsSQL);
$LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')";
}
}
@@ -703,7 +704,7 @@ if ($campaign_login_list > 0)
### Add a record to the vicidial_admin_log
$SQL_log = "$stmt|";
- $SQL_log = ereg_replace(';','',$SQL_log);
+ $SQL_log = preg_replace('/;/','',$SQL_log);
$SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$MGR_login', ip_address='$ip', event_section='AGENT', event_type='OVERRIDE', record_id='$VD_login', event_code='MANAGER OVERRIDE OF AGENT SHIFT ENFORCEMENT', event_sql=\"$SQL_log\", event_notes='user: $VD_login';";
if ($DB) {echo "|$stmt|\n";}
@@ -729,17 +730,17 @@ if ($campaign_login_list > 0)
{$campname = '';}
if ($VD_campaign)
{
- if ( (eregi("$VD_campaign",$rowx[0])) and (strlen($VD_campaign) == strlen($rowx[0])) )
+ if ( (preg_match("/$VD_campaign/i",$rowx[0])) and (strlen($VD_campaign) == strlen($rowx[0])) )
{$camp_form_code .= "\n";}
else
{
- if (!ereg('login_allowable_campaigns',$camp_form_code))
+ if (!preg_match('/login_allowable_campaigns/',$camp_form_code))
{$camp_form_code .= "\n";}
}
}
else
{
- if (!ereg('login_allowable_campaigns',$camp_form_code))
+ if (!preg_match('/login_allowable_campaigns/',$camp_form_code))
{$camp_form_code .= "\n";}
}
$o++;
@@ -765,7 +766,7 @@ if ($LogiNAJAX > 0)
function browser_dimensions()
{
2)
@@ -1129,7 +1130,7 @@ else
{$webphone_dialpad = $webphone_dialpad_override;}
### BEGIN - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR
- if ( (ereg('Y',$forced_timeclock_login)) or ( (ereg('ADMIN_EXEMPT',$forced_timeclock_login)) and ($VU_user_level < 8) ) )
+ if ( (preg_match('/Y/',$forced_timeclock_login)) or ( (preg_match('/ADMIN_EXEMPT/',$forced_timeclock_login)) and ($VU_user_level < 8) ) )
{
$last_agent_event='';
$HHMM = date("Hi");
@@ -1154,7 +1155,7 @@ else
$last_agent_event = $rowx[0];
}
if ($DB>0) {echo "|$stmt|$events_to_parse|$last_agent_event|";}
- if ( (strlen($last_agent_event)<2) or (ereg('LOGOUT',$last_agent_event)) )
+ if ( (strlen($last_agent_event)<2) or (preg_match('/LOGOUT/',$last_agent_event)) )
{
$VDloginDISPLAY=1;
$VDdisplayMESSAGE = "YOU MUST LOG IN TO THE TIMECLOCK FIRST ";
@@ -1163,7 +1164,7 @@ else
### END - CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR
### BEGIN - CHECK TO SEE IF SHIFT ENFORCEMENT IS ENABLED AND AGENT IS OUTSIDE OF THEIR SHIFTS, IF SO, OUTPUT ERROR
- if ( ( (ereg("START|ALL",$shift_enforcement)) and (!ereg("OFF",$VU_agent_shift_enforcement_override)) ) or (ereg("START|ALL",$VU_agent_shift_enforcement_override)) )
+ if ( ( (preg_match("/START|ALL/",$shift_enforcement)) and (!preg_match("/OFF/",$VU_agent_shift_enforcement_override)) ) or (preg_match("/START|ALL/",$VU_agent_shift_enforcement_override)) )
{
$shift_ok=0;
if ( (strlen($LOGgroup_shiftsSQL) < 3) and ($VU_shift_override_flag < 1) )
@@ -1190,7 +1191,7 @@ else
$shift_length = $rowx[2];
$shift_weekdays = $rowx[3];
- if (eregi("$wday",$shift_weekdays))
+ if (preg_match("/$wday/i",$shift_weekdays))
{
$HHshift_length = substr($shift_length,0,2);
$MMshift_length = substr($shift_length,3,2);
@@ -1251,7 +1252,7 @@ else
}
$user_abb = "$VD_login$VD_login$VD_login$VD_login";
while ( (strlen($user_abb) > 4) and ($forever_stop < 200) )
- {$user_abb = eregi_replace("^.","",$user_abb); $forever_stop++;}
+ {$user_abb = preg_replace("/^\./i","",$user_abb); $forever_stop++;}
$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';";
$rslt=mysql_query($stmt, $link);
@@ -1259,7 +1260,7 @@ else
$row=mysql_fetch_row($rslt);
$LOGallowed_campaigns =$row[0];
- if ( (!eregi(" $VD_campaign ",$LOGallowed_campaigns)) and (!eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) )
+ if ( (!preg_match("/\s$VD_campaign\s/i",$LOGallowed_campaigns)) and (!preg_match("/ALL-CAMPAIGNS/i",$LOGallowed_campaigns)) )
{
echo "Agent web client: Campaign Login\n";
echo "\n";
@@ -1711,7 +1712,7 @@ else
$default_web_vars = $row[0];
}
- if ( (!ereg('DISABLED',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) )
+ if ( (!preg_match('/DISABLED/',$VU_vicidial_recording_override)) and ($VU_vicidial_recording > 0) )
{
$campaign_recording = $VU_vicidial_recording_override;
echo "\n";
@@ -1742,7 +1743,7 @@ else
$closer_campaigns = preg_replace("/ /","','",$closer_campaigns);
$closer_campaigns = "'$closer_campaigns'";
- if ( (ereg('Y',$agent_pause_codes_active)) or (ereg('FORCE',$agent_pause_codes_active)) )
+ if ( (preg_match('/Y/',$agent_pause_codes_active)) or (preg_match('/FORCE/',$agent_pause_codes_active)) )
{
##### grab the pause codes for this campaign
$stmt="SELECT pause_code,pause_code_name FROM vicidial_pause_codes WHERE campaign_id='$VD_campaign' order by pause_code limit 100;";
@@ -1903,7 +1904,7 @@ else
$VARxfergroupsnames = substr("$VARxfergroupsnames", 0, -1);
}
- if (ereg('Y',$agent_allow_group_alias))
+ if (preg_match('/Y/',$agent_allow_group_alias))
{
##### grab the active group aliases
$stmt="SELECT group_alias_id,group_alias_name,caller_id_number FROM groups_alias WHERE active='Y' order by group_alias_id limit 1000;";
@@ -2026,7 +2027,7 @@ else
}
$pa=0;
- if ( (eregi(',',$phone_login)) and (strlen($phone_login) > 2) )
+ if ( (preg_match('/,/i',$phone_login)) and (strlen($phone_login) > 2) )
{
$phoneSQL = "(";
$phones_auto = explode(',',$phone_login);
@@ -2345,7 +2346,7 @@ else
$SIP_user = "$protocol/$extension";
$SIP_user_DiaL = "$protocol/$extension";
$qm_extension = "$extension";
- if ( (ereg('8300',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') )
+ if ( (preg_match('/8300/',$dialplan_number)) and (strlen($dialplan_number)<5) and ($protocol == 'Local') )
{
$SIP_user = "$protocol/$extension$VD_login";
$qm_extension = "$extension$VD_login";
@@ -2401,7 +2402,7 @@ else
}
- $session_ext = eregi_replace("[^a-z0-9]", "", $extension);
+ $session_ext = preg_replace("/[^a-z0-9]/i", "", $extension);
if (strlen($session_ext) > 10) {$session_ext = substr($session_ext, 0, 10);}
$session_rand = (rand(1,9999999) + 10000000);
$session_name = "$StarTtimE$US$session_ext$session_rand";
@@ -2421,7 +2422,7 @@ else
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01030',$VD_login,$server_ip,$session_name,$one_mysql_log);}
- if ( ( ($campaign_allow_inbound == 'Y') and ($dial_method != 'MANUAL') ) || ($campaign_leads_to_call > 0) || (ereg('Y',$no_hopper_leads_logins)) )
+ if ( ( ($campaign_allow_inbound == 'Y') and ($dial_method != 'MANUAL') ) || ($campaign_leads_to_call > 0) || (preg_match('/Y/',$no_hopper_leads_logins)) )
{
##### check to see if the user has a conf extension already, this happens if they previously exited uncleanly
$stmt="SELECT conf_exten FROM vicidial_conferences where extension='$SIP_user' and server_ip = '$server_ip' LIMIT 1;";
@@ -2530,7 +2531,7 @@ else
##### END QUEUEMETRICS LOGGING LOOKUP #####
###########################################
- if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (eregi("SIP",$protocol)) )
+ if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (preg_match("/SIP/i",$protocol)) )
{
$SIPSAK_prefix = 'LIN-';
echo "\n";
@@ -2848,7 +2849,7 @@ else
exit;
}
- if (ereg('MSIE',$browser))
+ if (preg_match('/MSIE/',$browser))
{
$useIE=1;
echo "\n";
@@ -14478,7 +14479,7 @@ $zi=2;
{
echo "$label_phone_number:
";
- if ( (ereg('Y',$disable_alter_custphone)) or (ereg('HIDE',$disable_alter_custphone)) )
+ if ( (preg_match('/Y/',$disable_alter_custphone)) or (preg_match('/HIDE/',$disable_alter_custphone)) )
{
echo "";
echo "";
@@ -14595,7 +14596,7 @@ $zi=2;
0) )
+ if ( (preg_match('/ON/',$VU_alert_enabled)) and ($AgentAlert_allowed > 0) )
{echo "Alert is ON";}
else
{echo "Alert is OFF";}
@@ -15081,7 +15082,7 @@ class="cust_form_text" value="">
NEW MANUAL DIAL LEAD FOR :
Enter information below for the new lead you wish to call.
\n";
}
diff --git a/www/agc/voicemail_check.php b/www/agc/voicemail_check.php
index e454af09..37181747 100644
--- a/www/agc/voicemail_check.php
+++ b/www/agc/voicemail_check.php
@@ -1,7 +1,7 @@
LICENSE: AGPLv2
+# Copyright (C) 2013 Matt Florell 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
@@ -23,6 +23,7 @@
# 60421-1147 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60619-1204 - Added variable filters to close security holes for login form
# 90508-0727 - Changed to PHP long tags
+# 130328-0025 - Converted ereg to preg functions
#
require("dbconnect.php");
@@ -41,33 +42,32 @@ if (isset($_GET["format"])) {$format=$_GET["format"];}
if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];}
elseif (isset($_POST["vmail_box"])) {$vmail_box=$_POST["vmail_box"];}
-$user=ereg_replace("[^0-9a-zA-Z]","",$user);
-$pass=ereg_replace("[^0-9a-zA-Z]","",$pass);
+$user=preg_replace("/[^0-9a-zA-Z]/","",$user);
+$pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
# default optional vars if not set
if (!isset($format)) {$format="text";}
-$version = '0.0.5';
-$build = '60619-1204';
+$version = '0.0.7';
+$build = '130328-0025';
$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;}
- $stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
- if ($DB) {echo "|$stmt|\n";}
- $rslt=mysql_query($stmt, $link);
- $row=mysql_fetch_row($rslt);
- $auth=$row[0];
+$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;";
+if ($DB) {echo "|$stmt|\n";}
+$rslt=mysql_query($stmt, $link);
+$row=mysql_fetch_row($rslt);
+$auth=$row[0];
- if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
+if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0))
{
- echo "Invalid Username/Password: |$user|$pass|\n";
- exit;
+ echo "Invalid Username/Password: |$user|$pass|\n";
+ exit;
}
- else
+else
{
-
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
{
echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n";
@@ -93,25 +93,25 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
}
if ($format=='debug')
-{
-echo "\n";
-echo "\n";
-echo "\n";
-echo "Voicemail Check";
-echo "\n";
-echo "\n";
-echo "\n";
-}
+ {
+ echo "\n";
+ echo "\n";
+ echo "\n";
+ echo "Voicemail Check";
+ echo "\n";
+ echo "\n";
+ echo "\n";
+ }
- $MT[0]='';
- $row=''; $rowx='';
- if (strlen($vmail_box)<1)
+$MT[0]='';
+$row=''; $rowx='';
+if (strlen($vmail_box)<1)
{
$channel_live=0;
echo "voicemail box $vmail_box is not valid\n";
exit;
}
- else
+else
{
$stmt="SELECT messages,old_messages FROM phones where server_ip='$server_ip' and voicemail_id='$vmail_box' limit 1;";
if ($format=='debug') {echo "\n";}
diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php
index 85307035..180b1125 100644
--- a/www/vicidial/admin.php
+++ b/www/vicidial/admin.php
@@ -2548,7 +2548,6 @@ if ($non_latin < 1)
$amd_callmenu = ereg_replace("[^-_0-9a-zA-Z]","",$amd_callmenu);
### ALPHA-NUMERIC and underscore and dash and slash and dot
- $menu_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_prompt);
$menu_timeout_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_timeout_prompt);
$menu_invalid_prompt = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$menu_invalid_prompt);
$after_hours_message_filename = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$after_hours_message_filename);
@@ -2590,6 +2589,9 @@ if ($non_latin < 1)
$safe_harbor_audio_field = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$safe_harbor_audio_field);
$voicemail_greeting = ereg_replace("[^-\/\|\._0-9a-zA-Z]","",$voicemail_greeting);
+ ### ALPHA-NUMERIC and underscore and dash and slash and dot and comma
+ $menu_prompt = ereg_replace("[^-\/\|\,\._0-9a-zA-Z]","",$menu_prompt);
+
### ALPHA-NUMERIC and underscore and dash and comma
$logins_list = ereg_replace("[^-\,\_0-9a-zA-Z]","",$logins_list);
$forced_timeclock_login = ereg_replace("[^-\,\_0-9a-zA-Z]","",$forced_timeclock_login);
@@ -5559,7 +5561,7 @@ if ($ADD==99999)
- Scheduled Callbacks Count - This option allows you to set whether only LIVE callbacks, user-only scheduled callbacks that have hit their trigger date and time, or ALL_ACTIVE callbacks, user-only callbacks that are active in the system as well as LIVE callbacks, should be3 counted int he agent callback alert section on the agent screen. Default is ALL_ACTIVE.
+ Scheduled Callbacks Count - These options allows you to limit the viewable callbacks in the agent callback alert section on the agent screen, to only LIVE callbacks. LIVE callbacks are user-only scheduled callbacks that have hit their trigger date and time. ACTIVE call backs are user-only callbacks that are active in the system but have not yet triggered. You can view both ACTIVE and LIVE callbacks by selecting ALL_ACTIVE. Default is ALL_ACTIVE.