Added several security changes to the agent interface, including freezing a user's account for 15 minutes after 10 failed login attempts.

Changed all of the admin scripts from using the PHP ereg functions to preg. This is a requirement for moving to PHP6 where ereg functions are  depricated. This will also have the benefit of speeding up those scripts because preg is supposed to be more efficient and faster than ereg.
Added recording_id to the available fields for the dispo call url feature
Added pause code to the agent_status non-agent api function output

git-svn-id: svn://192.168.202.10@1994 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2013-06-15 16:08:13 +00:00
parent d810e35c65
commit 9884e2ce4d
120 changed files with 5813 additions and 5314 deletions
+7
View File
@@ -56,6 +56,13 @@ OTHER CHANGES:
1. Added outbound state call time holidays functionality. Only works if the 1. Added outbound state call time holidays functionality. Only works if the
"state" field is populated properly in your leads. "state" field is populated properly in your leads.
2. Added several security changes to the agent interface, including freezing a
user's account for 15 minutes after 10 failed login attempts.
3. Changing all of the admin scripts from using the PHP ereg functions to preg.
This is a requirement for moving to PHP6 where ereg functions are
depricated. This will also have the benefit of speeding up those scripts
because preg is supposed to be more efficient and faster than ereg.
+4 -3
View File
@@ -1,4 +1,4 @@
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2013-04-20 NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2013-06-14
This document describes the functions of an API(Application Programming This document describes the functions of an API(Application Programming
Interface) for all functions NOT directly relating to the VICIDIAL Agent screen. Interface) for all functions NOT directly relating to the VICIDIAL Agent screen.
@@ -82,6 +82,7 @@ Changes:
130328-0949 - Added update_phone_number option to update_lead function 130328-0949 - Added update_phone_number option to update_lead function
130405-1538 - Added agent_status function 130405-1538 - Added agent_status function
130420-1938 - Added NANPA prefix validation and timezone options 130420-1938 - Added NANPA prefix validation and timezone options
130614-0907 - Added pause code to output of agent_status function
API Functions use the 'function' variable API Functions use the 'function' variable
@@ -422,8 +423,8 @@ ERROR: agent_status AGENT NOT FOUND - 6666||
ERROR: agent_status AGENT NOT LOGGED IN - 6666|| ERROR: agent_status AGENT NOT LOGGED IN - 6666||
A SUCCESS response will not show "SUCCESS", but instead will just print the results in the following format: A SUCCESS response will not show "SUCCESS", but instead will just print the results in the following format:
status,call_id,lead_id,campaign_id,calls_today,full_name,user_group,user_level status,call_id,lead_id,campaign_id,calls_today,full_name,user_group,user_level,pause_code
INCALL,M4050908070000012345,12345,TESTCAMP,12,Test Agent,AGENTS,3 INCALL,M4050908070000012345,12345,TESTCAMP,1,Test Agent,AGENTS,3,LOGIN
@@ -603,7 +603,11 @@ modify_same_user_level ENUM('0','1') default '1',
admin_hide_lead_data ENUM('0','1') default '0', admin_hide_lead_data ENUM('0','1') default '0',
admin_hide_phone_data ENUM('0','1','2_DIGITS','3_DIGITS','4_DIGITS') default '0', admin_hide_phone_data ENUM('0','1','2_DIGITS','3_DIGITS','4_DIGITS') default '0',
agentcall_email ENUM('0','1') default '0', agentcall_email ENUM('0','1') default '0',
modify_email_accounts ENUM('0','1') default '0' modify_email_accounts ENUM('0','1') default '0',
failed_login_count TINYINT(3) UNSIGNED default '0',
last_login_date DATETIME default '2001-01-01 00:00:01',
last_ip VARCHAR(15) default '',
pass_hash VARCHAR(200) default ''
); );
CREATE UNIQUE INDEX user ON vicidial_users (user); CREATE UNIQUE INDEX user ON vicidial_users (user);
@@ -1511,7 +1515,8 @@ queuemetrics_socket VARCHAR(20) default 'NONE',
queuemetrics_socket_url TEXT, queuemetrics_socket_url TEXT,
enhanced_disconnect_logging ENUM('0','1') default '0', enhanced_disconnect_logging ENUM('0','1') default '0',
allow_emails ENUM('0','1') default '0', allow_emails ENUM('0','1') default '0',
level_8_disable_add ENUM('0','1') default '0' level_8_disable_add ENUM('0','1') default '0',
pass_hash_enabled ENUM('0','1') default '0'
); );
CREATE TABLE vicidial_campaigns_list_mix ( CREATE TABLE vicidial_campaigns_list_mix (
@@ -3124,4 +3129,4 @@ UPDATE vicidial_configuration set value='1766' where name='qc_database_version';
UPDATE system_settings set vdc_agent_api_active='1'; UPDATE system_settings set vdc_agent_api_active='1';
UPDATE system_settings SET db_schema_version='1350',db_schema_update_date=NOW(); UPDATE system_settings SET db_schema_version='1351',db_schema_update_date=NOW();
+9
View File
@@ -3,3 +3,12 @@ UPDATE system_settings SET db_schema_version='1349',version='2.8b0.5',db_schema_
ALTER TABLE vicidial_state_call_times ADD ct_holidays TEXT default ''; ALTER TABLE vicidial_state_call_times ADD ct_holidays TEXT default '';
UPDATE system_settings SET db_schema_version='1350',db_schema_update_date=NOW() where db_schema_version < 1350; UPDATE system_settings SET db_schema_version='1350',db_schema_update_date=NOW() where db_schema_version < 1350;
ALTER TABLE vicidial_users ADD failed_login_count TINYINT(3) UNSIGNED default '0';
ALTER TABLE vicidial_users ADD last_login_date DATETIME default '2001-01-01 00:00:01';
ALTER TABLE vicidial_users ADD last_ip VARCHAR(15) default '';
ALTER TABLE vicidial_users ADD pass_hash VARCHAR(100) default '';
ALTER TABLE system_settings ADD pass_hash_enabled ENUM('0','1') default '0';
UPDATE system_settings SET db_schema_version='1351',db_schema_update_date=NOW() where db_schema_version < 1351;
+28 -25
View File
@@ -1,5 +1,5 @@
<?php <?php
# active_list_refresh.php version 2.6 # active_list_refresh.php version 2.8
# #
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
@@ -40,9 +40,11 @@
# 60619-1118 - Added variable filters to close security holes for login form # 60619-1118 - Added variable filters to close security holes for login form
# 90508-0727 - Changed to PHP long tags # 90508-0727 - Changed to PHP long tags
# 130328-0029 - Converted ereg to preg functions # 130328-0029 - Converted ereg to preg functions
# # 130603-2222 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
#
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
### If you have globals turned off uncomment these lines ### If you have globals turned off uncomment these lines
if (isset($_GET["user"])) {$user=$_GET["user"];} if (isset($_GET["user"])) {$user=$_GET["user"];}
@@ -83,22 +85,24 @@ if (isset($_GET["field_name"])) {$field_name=$_GET["field_name"];}
elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];} elseif (isset($_POST["field_name"])) {$field_name=$_POST["field_name"];}
### security strip all non-alphanumeric characters out of the variables ### ### security strip all non-alphanumeric characters out of the variables ###
$user=preg_replace("/[^0-9a-zA-Z]/","",$user); $user=preg_replace("/[^0-9a-zA-Z]/","",$user);
$pass=preg_replace("/[^0-9a-zA-Z]/","",$pass); $pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
$ADD=preg_replace("/[^0-9]/","",$ADD); $ADD=preg_replace("/[^0-9]/","",$ADD);
$order=preg_replace("/[^0-9a-zA-Z]/","",$order); $order=preg_replace("/[^0-9a-zA-Z]/","",$order);
$format=preg_replace("/[^0-9a-zA-Z]/","",$format); $format=preg_replace("/[^0-9a-zA-Z]/","",$format);
$bgcolor=preg_replace("/[^\#0-9a-zA-Z]/","",$bgcolor); $bgcolor=preg_replace("/[^\#0-9a-zA-Z]/","",$bgcolor);
$txtcolor=preg_replace("/[^\#0-9a-zA-Z]/","",$txtcolor); $txtcolor=preg_replace("/[^\#0-9a-zA-Z]/","",$txtcolor);
$txtsize=preg_replace("/[^0-9a-zA-Z]/","",$txtsize); $txtsize=preg_replace("/[^0-9a-zA-Z]/","",$txtsize);
$selectsize=preg_replace("/[^0-9a-zA-Z]/","",$selectsize); $selectsize=preg_replace("/[^0-9a-zA-Z]/","",$selectsize);
$selectfontsize=preg_replace("/[^0-9a-zA-Z]/","",$selectfontsize); $selectfontsize=preg_replace("/[^0-9a-zA-Z]/","",$selectfontsize);
$selectedext=preg_replace("/[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]/","",$selectedext); $selectedext=preg_replace("/[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]/","",$selectedext);
$selectedtrunk=preg_replace("/[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]/","",$selectedtrunk); $selectedtrunk=preg_replace("/[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]/","",$selectedtrunk);
$selectedlocal=preg_replace("/[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]/","",$selectedlocal); $selectedlocal=preg_replace("/[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]/","",$selectedlocal);
$textareaheight=preg_replace("/[^0-9a-zA-Z]/","",$textareaheight); $textareaheight=preg_replace("/[^0-9a-zA-Z]/","",$textareaheight);
$textareawidth=preg_replace("/[^0-9a-zA-Z]/","",$textareawidth); $textareawidth=preg_replace("/[^0-9a-zA-Z]/","",$textareawidth);
$field_name=preg_replace("/[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]/","",$field_name); $field_name=preg_replace("/[^ \#\*\:\/\@\.\-\_0-9a-zA-Z]/","",$field_name);
$session_name = preg_replace("/\'|\"|\\\\|;/","",$session_name);
$server_ip = preg_replace("/\'|\"|\\\\|;/","",$server_ip);
# default optional vars if not set # default optional vars if not set
if (!isset($ADD)) {$ADD="1";} if (!isset($ADD)) {$ADD="1";}
@@ -119,16 +123,15 @@ $NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s"); $NOW_TIME = date("Y-m-d H:i:s");
if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
$rslt=mysql_query($stmt, $link); if ($auth_message == 'GOOD')
$row=mysql_fetch_row($rslt); {$auth=1;}
$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"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
exit; exit;
} }
else else
{ {
+13 -6
View File
@@ -65,14 +65,16 @@
# 121120-0855 - Added QM socket-send functionality # 121120-0855 - Added QM socket-send functionality
# 121124-2354 - Added Other Campaign DNC option # 121124-2354 - Added Other Campaign DNC option
# 130328-0010 - Converted ereg to preg functions # 130328-0010 - Converted ereg to preg functions
# 130603-2221 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
$version = '2.6-31'; $version = '2.8-32';
$build = '130328-0010'; $build = '130603-2221';
$startMS = microtime(); $startMS = microtime();
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
$query_string = getenv("QUERY_STRING"); $query_string = getenv("QUERY_STRING");
@@ -335,18 +337,23 @@ else
} }
else else
{ {
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and vdc_agent_api_access = '1';"; $auth=0;
$auth_message = user_authorization($user,$pass,'',0);
if ($auth_message == 'GOOD')
{$auth=1;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and vdc_agent_api_access='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$auth=$row[0]; $auth_api=$row[0];
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0)) if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) or ($auth_api==0))
{ {
$result = 'ERROR'; $result = 'ERROR';
$result_reason = "Invalid Username/Password"; $result_reason = "Invalid Username/Password";
echo "$result: $result_reason: |$user|$pass|$auth|\n"; echo "$result: $result_reason: |$user|$pass|$auth|$auth_api|$auth_message|\n";
$data = "$user|$pass|$auth"; $data = "$user|$pass|$auth";
api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data); api_log($link,$api_logging,$api_script,$user,$agent_user,$function,$value,$result,$result_reason,$source,$data);
exit; exit;
+9 -9
View File
@@ -60,9 +60,11 @@
# 91129-2211 - Replaced SELECT STAR in SQL query # 91129-2211 - Replaced SELECT STAR in SQL query
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled # 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
# 130328-0017 - Converted ereg to preg functions # 130328-0017 - Converted ereg to preg functions
# 130603-2220 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
### If you have globals turned off uncomment these lines ### If you have globals turned off uncomment these lines
if (isset($_GET["user"])) {$user=$_GET["user"];} if (isset($_GET["user"])) {$user=$_GET["user"];}
@@ -116,14 +118,13 @@ if ($force_logout)
$StarTtime = date("U"); $StarTtime = date("U");
$NOW_TIME = date("Y-m-d H:i:s"); $NOW_TIME = date("Y-m-d H:i:s");
$FILE_TIME = date("Ymd-His"); $FILE_TIME = date("Ymd-His");
$month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y")); $month_old = mktime(0, 0, 0, date("m"), date("d")-7, date("Y"));
$past_month_date = date("Y-m-d H:i:s",$month_old); $past_month_date = date("Y-m-d H:i:s",$month_old);
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',1);
$rslt=mysql_query($stmt, $link); if ($auth_message == 'GOOD')
$row=mysql_fetch_row($rslt); {$auth=1;}
$auth=$row[0];
$US='_'; $US='_';
$CL=':'; $CL=':';
@@ -178,12 +179,11 @@ if( (strlen($user)<2) or (strlen($pass)<2) or (!$auth) or ($relogin == 'YES') )
} }
else else
{ {
if($auth>0) if($auth>0)
{ {
$office_no=strtoupper($user); $office_no=strtoupper($user);
$password=strtoupper($pass); $password=strtoupper($pass);
$stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass'"; $stmt="SELECT full_name,user_level from vicidial_users where user='$user' and pass='$pass' and active='Y';";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$LOGfullname=$row[0]; $LOGfullname=$row[0];
+11 -8
View File
@@ -1,5 +1,5 @@
<?php <?php
# call_log_display.php version 2.6 # call_log_display.php version 2.8
# #
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
@@ -30,9 +30,11 @@
# 60619-1202 - Added variable filters to close security holes for login form # 60619-1202 - Added variable filters to close security holes for login form
# 90508-0727 - Changed to PHP long tags # 90508-0727 - Changed to PHP long tags
# 130328-0028 - Converted ereg to preg functions # 130328-0028 - Converted ereg to preg functions
# 130603-2219 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
### If you have globals turned off uncomment these lines ### If you have globals turned off uncomment these lines
if (isset($_GET["user"])) {$user=$_GET["user"];} if (isset($_GET["user"])) {$user=$_GET["user"];}
@@ -52,6 +54,8 @@ if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];}
$user=preg_replace("/[^0-9a-zA-Z]/","",$user); $user=preg_replace("/[^0-9a-zA-Z]/","",$user);
$pass=preg_replace("/[^0-9a-zA-Z]/","",$pass); $pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
$session_name = preg_replace("/\'|\"|\\\\|;/","",$session_name);
$server_ip = preg_replace("/\'|\"|\\\\|;/","",$server_ip);
# default optional vars if not set # default optional vars if not set
if (!isset($format)) {$format="text";} if (!isset($format)) {$format="text";}
@@ -67,16 +71,15 @@ $NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s"); $NOW_TIME = date("Y-m-d H:i:s");
if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
$rslt=mysql_query($stmt, $link); if ($auth_message == 'GOOD')
$row=mysql_fetch_row($rslt); {$auth=1;}
$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"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
exit; exit;
} }
else else
{ {
+14 -34
View File
@@ -1,5 +1,5 @@
<?php <?php
# conf_exten_check.php version 2.6 # conf_exten_check.php version 2.8
# #
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
@@ -58,16 +58,18 @@
# 120809-2353 - Added external_recording function # 120809-2353 - Added external_recording function
# 121028-2305 - Added extra check on session_name to validate agent screen requests # 121028-2305 - Added extra check on session_name to validate agent screen requests
# 130328-0011 - Converted ereg to preg functions # 130328-0011 - Converted ereg to preg functions
# 130603-2218 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
$version = '2.6-33'; $version = '2.8-34';
$build = '130328-0011'; $build = '130603-2218';
$mel=1; # Mysql Error Log enabled = 1 $mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=39; $mysql_log_count=39;
$one_mysql_log=0; $one_mysql_log=0;
$DB=0; $DB=0;
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
### If you have globals turned off uncomment these lines ### If you have globals turned off uncomment these lines
if (isset($_GET["DB"])) {$DB=$_GET["DB"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
@@ -126,6 +128,9 @@ else
$pass = preg_replace("/\'|\"|\\\\|;/","",$pass); $pass = preg_replace("/\'|\"|\\\\|;/","",$pass);
} }
$session_name = preg_replace("/\'|\"|\\\\|;/","",$session_name);
$server_ip = preg_replace("/\'|\"|\\\\|;/","",$server_ip);
# default optional vars if not set # default optional vars if not set
if (!isset($format)) {$format="text";} if (!isset($format)) {$format="text";}
if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($ACTION)) {$ACTION="refresh";}
@@ -143,18 +148,15 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
$random = (rand(1000000, 9999999) + 10000000); $random = (rand(1000000, 9999999) + 10000000);
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} if ($auth_message == 'GOOD')
$rslt=mysql_query($stmt, $link); {$auth=1;}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'03002',$user,$server_ip,$session_name,$one_mysql_log);}
$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"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
exit; exit;
} }
else else
{ {
@@ -766,26 +768,4 @@ if ($format=='debug')
exit; exit;
##### MySQL Error Logging #####
function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log)
{
$NOW_TIME = date("Y-m-d H:i:s");
# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00001',$user,$server_ip,$session_name,$one_mysql_log);
$errno=''; $error='';
if ( ($mel > 0) or ($one_mysql_log > 0) )
{
$errno = mysql_errno($link);
if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) )
{
$error = mysql_error($link);
$efp = fopen ("./vicidial_mysql_errors.txt", "a");
fwrite ($efp, "$NOW_TIME|conf_check |$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n");
fclose($efp);
}
}
$one_mysql_log=0;
return $errno;
}
?> ?>
+7 -8
View File
@@ -25,6 +25,7 @@
# 100304-0354 - First Build # 100304-0354 - First Build
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled # 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
# 130328-0016 - Converted ereg to preg functions # 130328-0016 - Converted ereg to preg functions
# 130603-2217 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
$api_script = 'deactivate'; $api_script = 'deactivate';
@@ -32,6 +33,7 @@ $api_script = 'deactivate';
header ("Content-type: text/html; charset=utf-8"); header ("Content-type: text/html; charset=utf-8");
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
$filedate = date("Ymd"); $filedate = date("Ymd");
$filetime = date("H:i:s"); $filetime = date("H:i:s");
@@ -100,20 +102,17 @@ if (preg_match("/$TD$dispo$TD/",$sale_status))
$pass = preg_replace("/\'|\"|\\\\|;/","",$pass); $pass = preg_replace("/\'|\"|\\\\|;/","",$pass);
} }
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} if ($auth_message == 'GOOD')
$rslt=mysql_query($stmt, $link); {$auth=1;}
$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"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
exit; exit;
} }
$stmt = "SELECT $search_field FROM vicidial_list where lead_id='$lead_id';"; $stmt = "SELECT $search_field FROM vicidial_list where lead_id='$lead_id';";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
+10 -7
View File
@@ -32,6 +32,7 @@
# 111005-1102 - Added check and update for scheduled callback entry # 111005-1102 - Added check and update for scheduled callback entry
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled # 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
# 130328-0015 - Converted ereg to preg functions # 130328-0015 - Converted ereg to preg functions
# 130603-2216 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
$api_script = 'deactivate'; $api_script = 'deactivate';
@@ -39,6 +40,7 @@ $api_script = 'deactivate';
header ("Content-type: text/html; charset=utf-8"); header ("Content-type: text/html; charset=utf-8");
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
$filedate = date("Ymd"); $filedate = date("Ymd");
$filetime = date("H:i:s"); $filetime = date("H:i:s");
@@ -141,12 +143,13 @@ if ($match_found > 0)
$pass = preg_replace("/\'|\"|\\\\|;/","",$pass); $pass = preg_replace("/\'|\"|\\\\|;/","",$pass);
} }
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $session_name = preg_replace("/\'|\"|\\\\|;/","",$session_name);
if ($DB) {echo "|$stmt|\n";} $server_ip = preg_replace("/\'|\"|\\\\|;/","",$server_ip);
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link); $auth=0;
$row=mysql_fetch_row($rslt); $auth_message = user_authorization($user,$pass,'',0);
$auth=$row[0]; if ($auth_message == 'GOOD')
{$auth=1;}
$stmt="SELECT count(*) from vicidial_live_agents where user='$user';"; $stmt="SELECT count(*) from vicidial_live_agents where user='$user';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -156,7 +159,7 @@ if ($match_found > 0)
if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) or ($authlive==0)) if( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) or ($authlive==0))
{ {
echo "Invalid Username/Password: |$user|$pass|$auth|$authlive\n"; echo "Invalid Username/Password: |$user|$pass|$auth|$authlive|$auth_message|\n";
exit; exit;
} }
+75 -1
View File
@@ -1,6 +1,6 @@
<?php <?php
# #
# functions.php version 2.6 # functions.php version 2.8
# #
# functions for agent scripts # functions for agent scripts
# #
@@ -15,9 +15,83 @@
# 110730-2336 - Added call_id variable # 110730-2336 - Added call_id variable
# 120213-1709 - Commented out default of READONLY fields since they cannot change # 120213-1709 - Commented out default of READONLY fields since they cannot change
# 130328-0018 - Converted ereg to preg functions # 130328-0018 - Converted ereg to preg functions
# 130603-2208 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
##### BEGIN validate user login credentials, check for failed lock out #####
function user_authorization($user,$pass,$user_option,$user_update)
{
require("dbconnect.php");
$STARTtime = date("U");
$TODAY = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s");
$ip = getenv("REMOTE_ADDR");
$LOCK_over = ($STARTtime - 900); # failed login lockout time is 15 minutes(900 seconds)
$LOCK_trigger_attempts = 10;
$user = preg_replace("/\'|\"|\\\\|;/","",$user);
$pass = preg_replace("/\'|\"|\\\\|;/","",$pass);
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0 and active='Y' and ( (failed_login_count < $LOCK_trigger_attempts) or (UNIX_TIMESTAMP(last_login_date) < $LOCK_over) );";
if ($user_option == 'MGR')
{$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and manager_shift_enforcement_override='1' and active='Y' and ( (failed_login_count < $LOCK_trigger_attempts) or (UNIX_TIMESTAMP(last_login_date) < $LOCK_over) );";}
if ($DB) {echo "|$stmt|\n";}
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05009',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if ($auth < 1)
{
$auth_key='BAD';
$stmt="SELECT failed_login_count,UNIX_TIMESTAMP(last_login_date) from vicidial_users where user='$user';";
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05010',$user,$server_ip,$session_name,$one_mysql_log);}
$cl_user_ct = mysql_num_rows($rslt);
if ($cl_user_ct > 0)
{
$row=mysql_fetch_row($rslt);
$failed_login_count = $row[0];
$last_login_date = $row[1];
if ($failed_login_count < $LOCK_trigger_attempts)
{
$stmt="UPDATE vicidial_users set failed_login_count=(failed_login_count+1),last_ip='$ip' where user='$user';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05011',$user,$server_ip,$session_name,$one_mysql_log);}
}
else
{
if ($LOCK_over > $last_login_date)
{
$stmt="UPDATE vicidial_users set last_login_date=NOW(),failed_login_count=1,last_ip='$ip' where user='$user';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05012',$user,$server_ip,$session_name,$one_mysql_log);}
}
else
{$auth_key='LOCK';}
}
}
}
else
{
if ($user_update > 0)
{
$stmt="UPDATE vicidial_users set last_login_date=NOW(),last_ip='$ip',failed_login_count=0 where user='$user';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05013',$user,$server_ip,$session_name,$one_mysql_log);}
}
$auth_key='GOOD';
}
return $auth_key;
}
##### END validate user login credentials, check for failed lock out #####
##### BEGIN gather values for display of custom list fields for a lead ##### ##### BEGIN gather values for display of custom list fields for a lead #####
function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user) function custom_list_fields_values($lead_id,$list_id,$uniqueid,$user)
{ {
+12 -10
View File
@@ -32,9 +32,11 @@
# 60619-1205 - Added variable filters to close security holes for login form # 60619-1205 - Added variable filters to close security holes for login form
# 90508-0727 - Changed to PHP long tags # 90508-0727 - Changed to PHP long tags
# 130328-0025 - Converted ereg to preg functions # 130328-0025 - Converted ereg to preg functions
# 130603-2215 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
### If you have globals turned off uncomment these lines ### If you have globals turned off uncomment these lines
if (isset($_GET["user"])) {$user=$_GET["user"];} if (isset($_GET["user"])) {$user=$_GET["user"];}
@@ -66,6 +68,8 @@ if (isset($_GET["local_web_callerID_URL_enc"])) {$local_web_callerID_URL = raw
$user=preg_replace("/[^0-9a-zA-Z]/","",$user); $user=preg_replace("/[^0-9a-zA-Z]/","",$user);
$pass=preg_replace("/[^0-9a-zA-Z]/","",$pass); $pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
$session_name = preg_replace("/\'|\"|\\\\|;/","",$session_name);
$server_ip = preg_replace("/\'|\"|\\\\|;/","",$server_ip);
# default optional vars if not set # default optional vars if not set
if (!isset($format)) {$format="text";} if (!isset($format)) {$format="text";}
@@ -79,20 +83,18 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
$DO = '-1'; $DO = '-1';
if ( (preg_match("/^Zap/i",$channel)) and (!preg_match("/-/i",$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;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
$rslt=mysql_query($stmt, $link); if ($auth_message == 'GOOD')
$row=mysql_fetch_row($rslt); {$auth=1;}
$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"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
exit; exit;
} }
else else
{ {
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) ) 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"; echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n";
+11 -8
View File
@@ -1,5 +1,5 @@
<?php <?php
# live_exten_check.php version 2.6 # live_exten_check.php version 2.8
# #
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
@@ -31,9 +31,11 @@
# 60825-1029 - Fixed translation variable issue ChannelA # 60825-1029 - Fixed translation variable issue ChannelA
# 90508-0727 - Changed to PHP long tags # 90508-0727 - Changed to PHP long tags
# 130328-0027 - Converted ereg to preg functions # 130328-0027 - Converted ereg to preg functions
# 130603-2214 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
### If you have globals turned off uncomment these lines ### If you have globals turned off uncomment these lines
if (isset($_GET["user"])) {$user=$_GET["user"];} if (isset($_GET["user"])) {$user=$_GET["user"];}
@@ -57,6 +59,8 @@ if (isset($_GET["favorites_list"])) {$favorites_list=$_GET["favorites_list"];
$user=preg_replace("/[^0-9a-zA-Z]/","",$user); $user=preg_replace("/[^0-9a-zA-Z]/","",$user);
$pass=preg_replace("/[^0-9a-zA-Z]/","",$pass); $pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
$session_name = preg_replace("/\'|\"|\\\\|;/","",$session_name);
$server_ip = preg_replace("/\'|\"|\\\\|;/","",$server_ip);
# default optional vars if not set # default optional vars if not set
if (!isset($format)) {$format="text";} if (!isset($format)) {$format="text";}
@@ -68,16 +72,15 @@ $NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s"); $NOW_TIME = date("Y-m-d H:i:s");
if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
$rslt=mysql_query($stmt, $link); if ($auth_message == 'GOOD')
$row=mysql_fetch_row($rslt); {$auth=1;}
$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"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
exit; exit;
} }
else else
{ {
+21 -45
View File
@@ -1,5 +1,5 @@
<?php <?php
# manager_send.php version 2.6 # manager_send.php version 2.8
# #
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
@@ -114,15 +114,17 @@
# 121120-0848 - Added QM socket-send functionality # 121120-0848 - Added QM socket-send functionality
# 130108-1641 - Change for Asterisk 1.8 compatibility # 130108-1641 - Change for Asterisk 1.8 compatibility
# 130328-0008 - Converted ereg to preg functions # 130328-0008 - Converted ereg to preg functions
# 130603-2205 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
$version = '2.6-61'; $version = '2.8-62';
$build = '130328-0008'; $build = '130603-2205';
$mel=1; # Mysql Error Log enabled = 1 $mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=119; $mysql_log_count=119;
$one_mysql_log=0; $one_mysql_log=0;
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
### These are variable assignments for PHP globals off ### These are variable assignments for PHP globals off
if (isset($_GET["user"])) {$user=$_GET["user"];} if (isset($_GET["user"])) {$user=$_GET["user"];}
@@ -223,7 +225,7 @@ header ("Pragma: no-cache"); // HTTP/1.0
############################################# #############################################
##### START SYSTEM_SETTINGS LOOKUP ##### ##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin FROM system_settings;"; $stmt = "SELECT use_non_latin,allow_sipsak_messages FROM system_settings;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$user,$server_ip,$session_name,$one_mysql_log);}
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
@@ -231,7 +233,8 @@ $qm_conf_ct = mysql_num_rows($rslt);
if ($qm_conf_ct > 0) if ($qm_conf_ct > 0)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$non_latin = $row[0]; $non_latin = $row[0];
$allow_sipsak_messages = $row[1];
} }
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
@@ -248,6 +251,8 @@ else
$pass = preg_replace("/\'|\"|\\\\|;/","",$pass); $pass = preg_replace("/\'|\"|\\\\|;/","",$pass);
} }
$session_name = preg_replace("/\'|\"|\\\\|;/","",$session_name);
$server_ip = preg_replace("/\'|\"|\\\\|;/","",$server_ip);
# default optional vars if not set # default optional vars if not set
if (!isset($ACTION)) {$ACTION="Originate";} if (!isset($ACTION)) {$ACTION="Originate";}
@@ -260,18 +265,15 @@ $NOW_TIME = date("Y-m-d H:i:s");
$NOWnum = date("YmdHis"); $NOWnum = date("YmdHis");
if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} if ($auth_message == 'GOOD')
$rslt=mysql_query($stmt, $link); {$auth=1;}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02002',$user,$server_ip,$session_name,$one_mysql_log);}
$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"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
exit; exit;
} }
else else
{ {
@@ -425,10 +427,13 @@ if ($ACTION=="OriginateVDRelogin")
$CIDdate = date("ymdHis"); $CIDdate = date("ymdHis");
$DS='-'; $DS='-';
$SIPSAK_prefix = 'LIN-'; $SIPSAK_prefix = 'LIN-';
print "<!-- sending login sipsak message: $SIPSAK_prefix$VD_campaign -->\n"; $campaign = preg_replace("/\'|\"|\\\\|;/","",$campaign);
$extension = preg_replace("/\'|\"|\\\\|;/","",$extension);
$phone_ip = preg_replace("/\'|\"|\\\\|;/","",$phone_ip);
print "<!-- sending login sipsak message: $SIPSAK_prefix$campaign -->\n";
passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_prefix$campaign\" -r 5060 -s sip:$extension@$phone_ip > /dev/null"); passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_prefix$campaign\" -r 5060 -s sip:$extension@$phone_ip > /dev/null");
$queryCID = "$SIPSAK_prefix$campaign$DS$CIDdate"; $queryCID = "$SIPSAK_prefix$campaign$DS$CIDdate";
} }
$ACTION="Originate"; $ACTION="Originate";
} }
@@ -2115,14 +2120,6 @@ if ($ACTION=="VolumeControl")
$ENDtime = date("U"); $ENDtime = date("U");
$RUNtime = ($ENDtime - $StarTtime); $RUNtime = ($ENDtime - $StarTtime);
if ($format=='debug') {echo "\n<!-- script runtime: $RUNtime seconds -->";} if ($format=='debug') {echo "\n<!-- script runtime: $RUNtime seconds -->";}
@@ -2131,25 +2128,4 @@ if ($format=='debug') {echo "\n</body>\n</html>\n";}
exit; exit;
##### MySQL Error Logging #####
function mysql_error_logging($NOW_TIME,$link,$mel,$stmt,$query_id,$user,$server_ip,$session_name,$one_mysql_log)
{
$NOW_TIME = date("Y-m-d H:i:s");
# mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'02001',$user,$server_ip,$session_name,$one_mysql_log);
$errno=''; $error='';
if ( ($mel > 0) or ($one_mysql_log > 0) )
{
$errno = mysql_errno($link);
if ( ($errno > 0) or ($mel > 1) or ($one_mysql_log > 0) )
{
$error = mysql_error($link);
$efp = fopen ("./vicidial_mysql_errors.txt", "a");
fwrite ($efp, "$NOW_TIME|manager_send|$query_id|$errno|$error|$stmt|$user|$server_ip|$session_name|\n");
fclose($efp);
}
}
$one_mysql_log=0;
return $errno;
}
?> ?>
+28 -25
View File
@@ -24,9 +24,11 @@
# 60619-1205 - Added variable filters to close security holes for login form # 60619-1205 - Added variable filters to close security holes for login form
# 90508-0727 - Changed to PHP long tags # 90508-0727 - Changed to PHP long tags
# 130328-0024 - Converted ereg to preg functions # 130328-0024 - Converted ereg to preg functions
# 130603-2213 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
### If you have globals turned off uncomment these lines ### If you have globals turned off uncomment these lines
if (isset($_GET["user"])) {$user=$_GET["user"];} if (isset($_GET["user"])) {$user=$_GET["user"];}
@@ -46,6 +48,8 @@ if (isset($_GET["protocol"])) {$protocol=$_GET["protocol"];}
$user=preg_replace("/[^0-9a-zA-Z]/","",$user); $user=preg_replace("/[^0-9a-zA-Z]/","",$user);
$pass=preg_replace("/[^0-9a-zA-Z]/","",$pass); $pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
$session_name = preg_replace("/\'|\"|\\\\|;/","",$session_name);
$server_ip = preg_replace("/\'|\"|\\\\|;/","",$server_ip);
# default optional vars if not set # default optional vars if not set
if (!isset($format)) {$format="text";} if (!isset($format)) {$format="text";}
@@ -58,21 +62,20 @@ $NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s"); $NOW_TIME = date("Y-m-d H:i:s");
if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
$rslt=mysql_query($stmt, $link); if ($auth_message == 'GOOD')
$row=mysql_fetch_row($rslt); {$auth=1;}
$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"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
exit; exit;
} }
else else
{ {
if( (strlen($server_ip)<6) or (!isset($server_ip)) or ( (strlen($session_name)<12) or (!isset($session_name)) ) )
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"; echo "Invalid server_ip: |$server_ip| or Invalid session_name: |$session_name|\n";
exit; exit;
} }
@@ -96,30 +99,30 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
} }
if ($format=='debug') if ($format=='debug')
{ {
echo "<html>\n"; echo "<html>\n";
echo "<head>\n"; echo "<head>\n";
echo "<!-- VERSION: $version BUILD: $build EXTEN: $exten server_ip: $server_ip-->\n"; echo "<!-- VERSION: $version BUILD: $build EXTEN: $exten server_ip: $server_ip-->\n";
echo "<title>Parked Calls Display"; echo "<title>Parked Calls Display";
echo "</title>\n"; echo "</title>\n";
echo "</head>\n"; echo "</head>\n";
echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n"; echo "<BODY BGCOLOR=white marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
} }
$row=''; $rowx=''; $row=''; $rowx='';
$channel_live=1; $channel_live=1;
if ( (strlen($exten)<1) or (strlen($protocol)<3) ) if ( (strlen($exten)<1) or (strlen($protocol)<3) )
{ {
$channel_live=0; $channel_live=0;
echo "Exten $exten is not valid or protocol $protocol is not valid\n"; echo "Exten $exten is not valid or protocol $protocol is not valid\n";
exit; exit;
} }
else else
{ {
##### print parked calls from the parked_channels table ##### print parked calls from the parked_channels table
$stmt="SELECT channel,server_ip,channel_group,extension,parked_by,parked_time from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;"; $stmt="SELECT channel,server_ip,channel_group,extension,parked_by,parked_time from parked_channels where server_ip = '$server_ip' order by parked_time limit $park_limit;";
if ($format=='debug') {echo "\n<!-- $stmt -->";} if ($format=='debug') {echo "\n<!-- $stmt -->";}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$park_calls_count = mysql_num_rows($rslt); $park_calls_count = mysql_num_rows($rslt);
echo "$park_calls_count\n"; echo "$park_calls_count\n";
+11 -10
View File
@@ -9,10 +9,11 @@
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled # 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 # 130123-1923 - Added ability to use user-login-first options.php option
# 130328-0005 - Converted ereg to preg functions # 130328-0005 - Converted ereg to preg functions
# 130603-2212 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
$version = '2.6-5p'; $version = '2.8-6p';
$build = '130328-0005'; $build = '130603-2212';
$mel=1; # Mysql Error Log enabled = 1 $mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=73; $mysql_log_count=73;
$one_mysql_log=0; $one_mysql_log=0;
@@ -172,7 +173,7 @@ echo "<!-- VERSION: $version BUILD: $build -->\n";
echo "<!-- BROWSER: $BROWSER_WIDTH x $BROWSER_HEIGHT $JS_browser_width x $JS_browser_height -->\n"; echo "<!-- BROWSER: $BROWSER_WIDTH x $BROWSER_HEIGHT $JS_browser_width x $JS_browser_height -->\n";
$stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass';"; $stmt="SELECT user_group from vicidial_users where user='$VD_login';";
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'09002',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'09002',$VD_login,$server_ip,$session_name,$one_mysql_log);}
@@ -250,7 +251,7 @@ if ($user_login_first == 1)
{ {
if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) )
{ {
$stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';"; $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'09073',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'09073',$VD_login,$server_ip,$session_name,$one_mysql_log);}
@@ -333,12 +334,10 @@ else
} }
else else
{ {
$stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',1);
$rslt=mysql_query($stmt, $link); if ($auth_message == 'GOOD')
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'09003',$VD_login,$server_ip,$session_name,$one_mysql_log);} {$auth=1;}
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if($auth>0) if($auth>0)
{ {
@@ -384,6 +383,8 @@ else
} }
$VDloginDISPLAY=1; $VDloginDISPLAY=1;
$VDdisplayMESSAGE = "Login incorrect, please try again<br />"; $VDdisplayMESSAGE = "Login incorrect, please try again<br />";
if ($auth_message == 'LOCK')
{$VDdisplayMESSAGE = "Too many login attempts, try again in 15 minutes<br />";}
} }
} }
if ($VDloginDISPLAY) if ($VDloginDISPLAY)
+10 -8
View File
@@ -11,10 +11,11 @@
# 90508-0727 - Changed to PHP long tags # 90508-0727 - Changed to PHP long tags
# 100621-1023 - Added admin_web_directory variable # 100621-1023 - Added admin_web_directory variable
# 130328-0021 - Converted ereg to preg functions # 130328-0021 - Converted ereg to preg functions
# 130603-2211 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
$version = '2.6-7'; $version = '2.8-8';
$build = '130328-0021'; $build = '130603-2211';
$StarTtimE = date("U"); $StarTtimE = date("U");
$NOW_TIME = date("Y-m-d H:i:s"); $NOW_TIME = date("Y-m-d H:i:s");
@@ -86,6 +87,7 @@ if (!isset($phone_pass))
$referrer=preg_replace("/[^0-9a-zA-Z]/","",$referrer); $referrer=preg_replace("/[^0-9a-zA-Z]/","",$referrer);
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
############################################# #############################################
##### START SYSTEM_SETTINGS LOOKUP ##### ##### START SYSTEM_SETTINGS LOOKUP #####
@@ -113,11 +115,11 @@ header ("Pragma: no-cache"); // HTTP/1.0
if ( ($stage == 'login') or ($stage == 'logout') ) if ( ($stage == 'login') or ($stage == 'logout') )
{ {
### see if user/pass exist for this user in vicidial_users table ### see if user/pass exist for this user in vicidial_users table
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $valid_user=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',1);
$rslt=mysql_query($stmt, $link); if ($auth_message == 'GOOD')
$row=mysql_fetch_row($rslt); {$valid_user=1;}
$valid_user=$row[0];
print "<!-- vicidial_users active count for $user: |$valid_user| -->\n"; print "<!-- vicidial_users active count for $user: |$valid_user| -->\n";
if ($valid_user < 1) if ($valid_user < 1)
@@ -162,7 +164,7 @@ if ( ($stage == 'login') or ($stage == 'logout') )
### VALID USER/PASS, CONTINUE ### VALID USER/PASS, CONTINUE
### get name and group for this user ### get name and group for this user
$stmt="SELECT full_name,user_group from vicidial_users where user='$user' and pass='$pass';"; $stmt="SELECT full_name,user_group from vicidial_users where user='$user' and pass='$pass' and active='Y';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
+75 -58
View File
@@ -329,10 +329,12 @@
# 130412-1348 - Added SIP cause code display on failed calls # 130412-1348 - Added SIP cause code display on failed calls
# 130414-2142 - Small fix for multi-server inbound setups and did options in url functions # 130414-2142 - Small fix for multi-server inbound setups and did options in url functions
# 130508-2221 - Cleanup for other language builds # 130508-2221 - Cleanup for other language builds
# 130603-2207 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# 130615-1126 - Added recording_id to dispo url
# #
$version = '2.6-227'; $version = '2.8-229';
$build = '130508-2221'; $build = '130615-1126';
$mel=1; # Mysql Error Log enabled = 1 $mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=533; $mysql_log_count=533;
$one_mysql_log=0; $one_mysql_log=0;
@@ -561,6 +563,8 @@ if (isset($_GET["email_row_id"])) {$email_row_id=$_GET["email_row_id"];}
elseif (isset($_POST["email_row_id"])) {$email_row_id=$_POST["email_row_id"];} elseif (isset($_POST["email_row_id"])) {$email_row_id=$_POST["email_row_id"];}
if (isset($_GET["inbound_email_groups"])) {$inbound_email_groups=$_GET["inbound_email_groups"];} if (isset($_GET["inbound_email_groups"])) {$inbound_email_groups=$_GET["inbound_email_groups"];}
elseif (isset($_POST["inbound_email_groups"])) {$inbound_email_groups=$_POST["inbound_email_groups"];} elseif (isset($_POST["inbound_email_groups"])) {$inbound_email_groups=$_POST["inbound_email_groups"];}
if (isset($_GET["recording_id"])) {$recording_id=$_GET["recording_id"];}
elseif (isset($_POST["recording_id"])) {$recording_id=$_POST["recording_id"];}
header ("Content-type: text/html; charset=utf-8"); header ("Content-type: text/html; charset=utf-8");
@@ -785,17 +789,14 @@ if ($ACTION == 'LogiNCamPaigns')
} }
else else
{ {
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} if ($auth_message == 'GOOD')
$rslt=mysql_query($stmt, $link); {$auth=1;}
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00002',$user,$server_ip,$session_name,$one_mysql_log);}
$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"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
exit; exit;
} }
else else
@@ -854,63 +855,74 @@ if ($ACTION == 'LogiNCamPaigns')
} }
else else
{ {
$stmt="SELECT user_group,user_level,agent_shift_enforcement_override,shift_override_flag from vicidial_users where user='$user' and pass='$pass'"; $stmt="SELECT user_group,user_level,agent_shift_enforcement_override,shift_override_flag from vicidial_users where user='$user';";
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00004',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00004',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt); $cl_user_ct = mysql_num_rows($rslt);
$VU_user_group = $row[0]; if ($cl_user_ct > 0)
$VU_user_level = $row[1];
$VU_agent_shift_enforcement_override = $row[2];
$VU_shift_override_flag = $row[3];
$LOGallowed_campaignsSQL='';
$stmt="SELECT allowed_campaigns,forced_timeclock_login,shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';";
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00005',$user,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt);
$forced_timeclock_login = $row[1];
$shift_enforcement = $row[2];
$LOGgroup_shiftsSQL = preg_replace('/\s\s/','',$row[3]);
$LOGgroup_shiftsSQL = preg_replace('/\s/',"','",$LOGgroup_shiftsSQL);
$LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')";
if ( (!preg_match("/ALL-CAMPAIGNS/i",$row[0])) )
{ {
$LOGallowed_campaignsSQL = preg_replace('/\s-/i','',$row[0]); $row=mysql_fetch_row($rslt);
$LOGallowed_campaignsSQL = preg_replace('/\s/i',"','",$LOGallowed_campaignsSQL); $VU_user_group = $row[0];
$LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')"; $VU_user_level = $row[1];
} $VU_agent_shift_enforcement_override = $row[2];
$VU_shift_override_flag = $row[3];
$show_campaign_list=1; $LOGallowed_campaignsSQL='';
### CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR
if ( (preg_match('/Y/',$forced_timeclock_login)) or ( (preg_match('/ADMIN_EXEMPT/',$forced_timeclock_login)) and ($VU_user_level < 8) ) )
{
$last_agent_event='';
$HHMM = date("Hi");
$HHteod = substr($timeclock_end_of_day,0,2);
$MMteod = substr($timeclock_end_of_day,2,2);
if ($HHMM < $timeclock_end_of_day) $stmt="SELECT allowed_campaigns,forced_timeclock_login,shift_enforcement,group_shifts from vicidial_user_groups where user_group='$VU_user_group';";
{$EoD = mktime($HHteod, $MMteod, 10, date("m"), date("d")-1, date("Y"));}
else
{$EoD = mktime($HHteod, $MMteod, 10, date("m"), date("d"), date("Y"));}
$EoDdate = date("Y-m-d H:i:s", $EoD);
##### grab timeclock logged-in time for each user #####
$stmt="SELECT event from vicidial_timeclock_log where user='$user' and event_epoch >= '$EoD' order by timeclock_id desc limit 1;";
if ($DB>0) {echo "|$stmt|";}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00184',$user,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00005',$user,$server_ip,$session_name,$one_mysql_log);}
$events_to_parse = mysql_num_rows($rslt); $row=mysql_fetch_row($rslt);
if ($events_to_parse > 0) $forced_timeclock_login = $row[1];
$shift_enforcement = $row[2];
$LOGgroup_shiftsSQL = preg_replace('/\s\s/','',$row[3]);
$LOGgroup_shiftsSQL = preg_replace('/\s/',"','",$LOGgroup_shiftsSQL);
$LOGgroup_shiftsSQL = "shift_id IN('$LOGgroup_shiftsSQL')";
if ( (!preg_match("/ALL-CAMPAIGNS/i",$row[0])) )
{ {
$rowx=mysql_fetch_row($rslt); $LOGallowed_campaignsSQL = preg_replace('/\s-/i','',$row[0]);
$last_agent_event = $rowx[0]; $LOGallowed_campaignsSQL = preg_replace('/\s/i',"','",$LOGallowed_campaignsSQL);
$LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')";
} }
if ( (strlen($last_agent_event)<2) or (preg_match('/LOGOUT/',$last_agent_event)) )
{$show_campaign_list=0;} $show_campaign_list=1;
### CHECK TO SEE IF AGENT IS LOGGED IN TO TIMECLOCK, IF NOT, OUTPUT ERROR
if ( (preg_match('/Y/',$forced_timeclock_login)) or ( (preg_match('/ADMIN_EXEMPT/',$forced_timeclock_login)) and ($VU_user_level < 8) ) )
{
$last_agent_event='';
$HHMM = date("Hi");
$HHteod = substr($timeclock_end_of_day,0,2);
$MMteod = substr($timeclock_end_of_day,2,2);
if ($HHMM < $timeclock_end_of_day)
{$EoD = mktime($HHteod, $MMteod, 10, date("m"), date("d")-1, date("Y"));}
else
{$EoD = mktime($HHteod, $MMteod, 10, date("m"), date("d"), date("Y"));}
$EoDdate = date("Y-m-d H:i:s", $EoD);
##### grab timeclock logged-in time for each user #####
$stmt="SELECT event from vicidial_timeclock_log where user='$user' and event_epoch >= '$EoD' order by timeclock_id desc limit 1;";
if ($DB>0) {echo "|$stmt|";}
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'00184',$user,$server_ip,$session_name,$one_mysql_log);}
$events_to_parse = mysql_num_rows($rslt);
if ($events_to_parse > 0)
{
$rowx=mysql_fetch_row($rslt);
$last_agent_event = $rowx[0];
}
if ( (strlen($last_agent_event)<2) or (preg_match('/LOGOUT/',$last_agent_event)) )
{$show_campaign_list=0;}
}
}
else
{
echo "<select size=1 name=VD_campaign id=VD_campaign onFocus=\"login_allowable_campaigns()\">\n";
echo "<option value=\"\">-- USER LOGIN ERROR --</option>\n";
echo "</select>\n";
exit;
} }
} }
@@ -7989,6 +8001,8 @@ if ($ACTION == 'userLOGout')
########################################### ###########################################
if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (preg_match("/SIP/i",$protocol)) ) if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (preg_match("/SIP/i",$protocol)) )
{ {
$extension = preg_replace("/\'|\"|\\\\|;/","",$extension);
$phone_ip = preg_replace("/\'|\"|\\\\|;/","",$phone_ip);
$SIPSAK_message = 'LOGGED OUT'; $SIPSAK_message = 'LOGGED OUT';
passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_message\" -r 5060 -s sip:$extension@$phone_ip > /dev/null"); passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_message\" -r 5060 -s sip:$extension@$phone_ip > /dev/null");
} }
@@ -9455,6 +9469,7 @@ if ($ACTION == 'updateDISPO')
$dispo_call_url = preg_replace('/--A--call_id--B--/i',urlencode(trim($MDnextCID)),$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--user_group--B--/i',urlencode(trim($user_group)),$dispo_call_url); $dispo_call_url = preg_replace('/--A--user_group--B--/i',urlencode(trim($user_group)),$dispo_call_url);
$dispo_call_url = preg_replace('/--A--call_notes--B--/i',"$url_call_notes",$dispo_call_url); $dispo_call_url = preg_replace('/--A--call_notes--B--/i',"$url_call_notes",$dispo_call_url);
$dispo_call_url = preg_replace('/--A--recording_id--B--/i',"$recording_id",$dispo_call_url);
if (strlen($FORMcustom_field_names)>2) if (strlen($FORMcustom_field_names)>2)
{ {
@@ -10094,6 +10109,8 @@ if ($ACTION == 'PauseCodeSubmit')
########################################### ###########################################
if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (preg_match("/SIP/i",$protocol)) ) if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (preg_match("/SIP/i",$protocol)) )
{ {
$extension = preg_replace("/\'|\"|\\\\|;/","",$extension);
$phone_ip = preg_replace("/\'|\"|\\\\|;/","",$phone_ip);
$SIPSAK_prefix = 'BK-'; $SIPSAK_prefix = 'BK-';
passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_prefix$status\" -r 5060 -s sip:$extension@$phone_ip > /dev/null"); passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_prefix$status\" -r 5060 -s sip:$extension@$phone_ip > /dev/null");
} }
+7 -8
View File
@@ -13,6 +13,7 @@
# 121214-2300 - First Build # 121214-2300 - First Build
# 130127-0027 - Better non-latin characters support # 130127-0027 - Better non-latin characters support
# 130328-0007 - Converted ereg to preg functions # 130328-0007 - Converted ereg to preg functions
# 130603-2210 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -130,14 +131,12 @@ if (!isset($format)) {$format="text";}
if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($ACTION)) {$ACTION="refresh";}
if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} if ($auth_message == 'GOOD')
$rslt=mysql_query($stmt, $link); {$auth=1;}
$row=mysql_fetch_row($rslt);
$auth=$row[0];
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and modify_leads='1';"; $stmt="SELECT count(*) from vicidial_users where user='$user' and modify_leads='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
@@ -151,7 +150,7 @@ $LVAactive=$row[0];
$LVAactive=9; $LVAactive=9;
if ( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) or ( ($LVAactive < 1) ) ) if ( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) or ( ($LVAactive < 1) ) )
{ {
echo "Invalid Username/Password: |$user|$pass|\n"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
echo "<form action=./vdc_email_display.php method=POST name=email_display_form id=email_display_form>\n"; echo "<form action=./vdc_email_display.php method=POST name=email_display_form id=email_display_form>\n";
echo "<input type=hidden name=user id=user value=\"$user\">\n"; echo "<input type=hidden name=user id=user value=\"$user\">\n";
echo "</form>\n"; echo "</form>\n";
+9 -10
View File
@@ -18,10 +18,11 @@
# 120315-1729 - Filtere out single quotes and backslashes from custom fields # 120315-1729 - Filtere out single quotes and backslashes from custom fields
# 130328-0012 - Converted ereg to preg functions # 130328-0012 - Converted ereg to preg functions
# 130402-2256 - Added user_group variable # 130402-2256 - Added user_group variable
# 130603-2204 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
$version = '2.6-10'; $version = '2.8-11';
$build = '130402-2256'; $build = '130603-2204';
require("dbconnect.php"); require("dbconnect.php");
require_once("functions.php"); require_once("functions.php");
@@ -212,14 +213,12 @@ if (!isset($format)) {$format="text";}
if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($ACTION)) {$ACTION="refresh";}
if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} if ($auth_message == 'GOOD')
$rslt=mysql_query($stmt, $link); {$auth=1;}
$row=mysql_fetch_row($rslt);
$auth=$row[0];
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and modify_leads='1';"; $stmt="SELECT count(*) from vicidial_users where user='$user' and modify_leads='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
@@ -242,7 +241,7 @@ if ($custom_fields_enabled < 1)
if ( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) or ( ($LVAactive < 1) and ($VUmodify < 1) ) ) if ( (strlen($user)<2) or (strlen($pass)<2) or ($auth==0) or ( ($LVAactive < 1) and ($VUmodify < 1) ) )
{ {
echo "Invalid Username/Password: |$user|$pass|\n"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
echo "<form action=./vdc_form_display.php method=POST name=form_custom_fields id=form_custom_fields>\n"; echo "<form action=./vdc_form_display.php method=POST name=form_custom_fields id=form_custom_fields>\n";
echo "<input type=hidden name=user id=user value=\"$user\">\n"; echo "<input type=hidden name=user id=user value=\"$user\">\n";
echo "</form>\n"; echo "</form>\n";
+9 -14
View File
@@ -19,13 +19,14 @@
# 120227-2017 - Added parsing of IGNORENOSCROLL option in script to force scroll # 120227-2017 - Added parsing of IGNORENOSCROLL option in script to force scroll
# 130328-0013 - Converted ereg to preg functions # 130328-0013 - Converted ereg to preg functions
# 130402-2255 - Added user_group variable # 130402-2255 - Added user_group variable
# 130603-2206 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
$version = '2.6-13'; $version = '2.8-14';
$build = '130402-2255'; $build = '130603-2206';
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];} if (isset($_GET["lead_id"])) {$lead_id=$_GET["lead_id"];}
elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} elseif (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
@@ -251,22 +252,16 @@ if (!isset($format)) {$format="text";}
if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($ACTION)) {$ACTION="refresh";}
if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} if ($auth_message == 'GOOD')
$rslt=mysql_query($stmt, $link); {$auth=1;}
$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"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
exit; exit;
} }
else
{
# do nothing for now
}
if ($format=='debug') if ($format=='debug')
{ {
@@ -15,12 +15,14 @@
# 110208-1239 - First build of script based upon vdc_script_notes.php # 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 # 110221-1252 - Added missing variables, accounted for call notes on manual dial calls
# 130328-0019 - Converted ereg to preg functions # 130328-0019 - Converted ereg to preg functions
# 130603-2201 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
$version = '2.6-3'; $version = '2.8-4';
$build = '130328-0019'; $build = '130603-2201';
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
# Configuration settings- # Configuration settings-
@@ -330,22 +332,16 @@ if (!isset($format)) {$format="text";}
if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($ACTION)) {$ACTION="refresh";}
if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} if ($auth_message == 'GOOD')
$rslt=mysql_query($stmt, $link); {$auth=1;}
$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"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
exit; exit;
} }
else
{
# do nothing for now
}
echo "<HTML>\n"; echo "<HTML>\n";
echo "<head>\n"; echo "<head>\n";
+9 -13
View File
@@ -13,12 +13,14 @@
# 100215-0744 - First build of script # 100215-0744 - First build of script
# 100622-2230 - Added field labels # 100622-2230 - Added field labels
# 130328-0020 - Converted ereg to preg functions # 130328-0020 - Converted ereg to preg functions
# 130603-2203 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
$version = '2.6-3'; $version = '2.8-4';
$build = '130328-0020'; $build = '130603-2203';
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
if (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];} if (isset($_POST["lead_id"])) {$lead_id=$_POST["lead_id"];}
@@ -298,22 +300,16 @@ if (!isset($format)) {$format="text";}
if (!isset($ACTION)) {$ACTION="refresh";} if (!isset($ACTION)) {$ACTION="refresh";}
if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} if ($auth_message == 'GOOD')
$rslt=mysql_query($stmt, $link); {$auth=1;}
$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"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
exit; exit;
} }
else
{
# do nothing for now
}
echo "<HTML>\n"; echo "<HTML>\n";
echo "<head>\n"; echo "<head>\n";
+67 -30
View File
@@ -402,10 +402,12 @@
# 130417-1937 - Changed locked agent choose in-group/closer/territories to auto-close # 130417-1937 - Changed locked agent choose in-group/closer/territories to auto-close
# 130508-2223 - Cleanup for other language builds # 130508-2223 - Cleanup for other language builds
# 130508-2307 - Branched 2.7, trunk becomes 2.8 # 130508-2307 - Branched 2.7, trunk becomes 2.8
# 130603-2209 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# 130615-1125 - Added recording_id to dispo url
# #
$version = '2.8-371c'; $version = '2.8-373c';
$build = '130508-2307'; $build = '130615-1125';
$mel=1; # Mysql Error Log enabled = 1 $mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=79; $mysql_log_count=79;
$one_mysql_log=0; $one_mysql_log=0;
@@ -667,22 +669,32 @@ if ($campaign_login_list > 0)
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
if ($relogin == 'YES') if ($relogin == 'YES')
{ {
$stmt="SELECT user_group from vicidial_users where user='$VD_login' and pass='$VD_pass';"; $stmt="SELECT user_group from vicidial_users where user='$VD_login' and active='Y';";
if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");} if ($non_latin > 0) {$rslt=mysql_query("SET NAMES 'UTF8'");}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01002',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01002',$VD_login,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt); $cl_user_ct = mysql_num_rows($rslt);
$VU_user_group=$row[0]; if ($cl_user_ct > 0)
$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';";
$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 ( (!preg_match("/ALL-CAMPAIGNS/i",$row[0])) )
{ {
$LOGallowed_campaignsSQL = preg_replace('/\s-/i','',$row[0]); $row=mysql_fetch_row($rslt);
$LOGallowed_campaignsSQL = preg_replace('/\s/i',"','",$LOGallowed_campaignsSQL); $VU_user_group=$row[0];
$LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')";
$stmt="SELECT allowed_campaigns from vicidial_user_groups where user_group='$VU_user_group';";
$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 ( (!preg_match("/ALL-CAMPAIGNS/i",$row[0])) )
{
$LOGallowed_campaignsSQL = preg_replace('/\s-/i','',$row[0]);
$LOGallowed_campaignsSQL = preg_replace('/\s/i',"','",$LOGallowed_campaignsSQL);
$LOGallowed_campaignsSQL = "and campaign_id IN('$LOGallowed_campaignsSQL')";
}
}
else
{
echo "<select size=1 name=VD_campaign id=VD_campaign onFocus=\"login_allowable_campaigns()\">\n";
echo "<option value=\"\">-- USER LOGIN ERROR --</option>\n";
echo "</select>\n";
} }
} }
@@ -694,12 +706,13 @@ if ($campaign_login_list > 0)
if (isset($_GET["MGR_pass$loginDATE"])) {$MGR_pass=$_GET["MGR_pass$loginDATE"];} if (isset($_GET["MGR_pass$loginDATE"])) {$MGR_pass=$_GET["MGR_pass$loginDATE"];}
elseif (isset($_POST["MGR_pass$loginDATE"])) {$MGR_pass=$_POST["MGR_pass$loginDATE"];} elseif (isset($_POST["MGR_pass$loginDATE"])) {$MGR_pass=$_POST["MGR_pass$loginDATE"];}
$stmt="SELECT count(*) from vicidial_users where user='$MGR_login' and pass='$MGR_pass' and manager_shift_enforcement_override='1' and active='Y';"; $MGR_login = preg_replace("/\'|\"|\\\\|;/","",$MGR_login);
if ($DB) {echo "|$stmt|\n";} $MGR_pass = preg_replace("/\'|\"|\\\\|;/","",$MGR_pass);
$rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01058',$VD_login,$server_ip,$session_name,$one_mysql_log);} $MGR_auth=0;
$row=mysql_fetch_row($rslt); $auth_message = user_authorization($MGR_login,$MGR_pass,'MGR',0);
$MGR_auth=$row[0]; if ($auth_message == 'GOOD')
{$MGR_auth=1;}
if($MGR_auth>0) if($MGR_auth>0)
{ {
@@ -947,7 +960,7 @@ if ($user_login_first == 1)
{ {
if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) ) if ( (strlen($phone_login)<2) or (strlen($phone_pass)<2) )
{ {
$stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';"; $stmt="SELECT phone_login,phone_pass from vicidial_users where user='$VD_login' and user_level > 0 and active='Y';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01005',$VD_login,$server_ip,$session_name,$one_mysql_log);}
@@ -1041,19 +1054,17 @@ else
} }
else else
{ {
$stmt="SELECT count(*) from vicidial_users where user='$VD_login' and pass='$VD_pass' and user_level > 0 and active='Y';"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($VD_login,$VD_pass,'',1);
$rslt=mysql_query($stmt, $link); if ($auth_message == 'GOOD')
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01006',$VD_login,$server_ip,$session_name,$one_mysql_log);} {$auth=1;}
$row=mysql_fetch_row($rslt);
$auth=$row[0];
if($auth>0) if($auth>0)
{ {
$login=strtoupper($VD_login); $login=strtoupper($VD_login);
$password=strtoupper($VD_pass); $password=strtoupper($VD_pass);
##### grab the full name of the agent ##### grab the full name and other settings of the agent
$stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,agent_call_log_view_override,agent_choose_blended,agent_lead_search_override,preset_contact_search from vicidial_users where user='$VD_login' and pass='$VD_pass'"; $stmt="SELECT full_name,user_level,hotkeys_active,agent_choose_ingroups,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,closer_default_blended,user_group,vicidial_recording_override,alter_custphone_override,alert_enabled,agent_shift_enforcement_override,shift_override_flag,allow_alerts,closer_campaigns,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,agent_call_log_view_override,agent_choose_blended,agent_lead_search_override,preset_contact_search from vicidial_users where user='$VD_login' and pass='$VD_pass' and active='Y';";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);} if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'01007',$VD_login,$server_ip,$session_name,$one_mysql_log);}
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
@@ -1962,7 +1973,10 @@ else
fclose($fp); fclose($fp);
} }
$VDloginDISPLAY=1; $VDloginDISPLAY=1;
$VDdisplayMESSAGE = "Login incorrect, please try again<br />"; $VDdisplayMESSAGE = "Login incorrect, please try again<br />";
if ($auth_message == 'LOCK')
{$VDdisplayMESSAGE = "Too many login attempts, try again in 15 minutes<br />";}
} }
} }
if ($VDloginDISPLAY) if ($VDloginDISPLAY)
@@ -2540,6 +2554,8 @@ else
if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (preg_match("/SIP/i",$protocol)) ) if ( ($enable_sipsak_messages > 0) and ($allow_sipsak_messages > 0) and (preg_match("/SIP/i",$protocol)) )
{ {
$extension = preg_replace("/\'|\"|\\\\|;/","",$extension);
$phone_ip = preg_replace("/\'|\"|\\\\|;/","",$phone_ip);
$SIPSAK_prefix = 'LIN-'; $SIPSAK_prefix = 'LIN-';
echo "<!-- sending login sipsak message: $SIPSAK_prefix$VD_campaign -->\n"; echo "<!-- sending login sipsak message: $SIPSAK_prefix$VD_campaign -->\n";
passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_prefix$VD_campaign\" -r 5060 -s sip:$extension@$phone_ip > /dev/null"); passthru("/usr/local/bin/sipsak -M -O desktop -B \"$SIPSAK_prefix$VD_campaign\" -r 5060 -s sip:$extension@$phone_ip > /dev/null");
@@ -10296,6 +10312,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
customer_3way_hangup_counter=0; customer_3way_hangup_counter=0;
customer_3way_hangup_counter_trigger=0; customer_3way_hangup_counter_trigger=0;
waiting_on_dispo=1; waiting_on_dispo=1;
var VDDCU_recording_id=document.getElementById("RecorDID").innerHTML;
document.getElementById("callchannel").innerHTML = ''; document.getElementById("callchannel").innerHTML = '';
document.vicidial_form.callserverip.value = ''; document.vicidial_form.callserverip.value = '';
document.vicidial_form.xferchannel.value = ''; document.vicidial_form.xferchannel.value = '';
@@ -10341,7 +10358,7 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
} }
if (xmlhttp) if (xmlhttp)
{ {
DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&vtiger_callback_id=" + vtiger_callback_id + "&phone_number=" + document.vicidial_form.phone_number.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&dial_method" + dial_method + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&CallBackLeadStatus=" + CallBackLeadStatus + "&comments=" + encodeURIComponent(CallBackCommenTs) + "&custom_field_names=" + custom_field_names + "&call_notes=" + encodeURIComponent(document.vicidial_form.call_notes_dispo.value) + "&qm_dispo_code=" + DispoQMcsCODE + "&email_enabled=" + email_enabled; DSupdate_query = "server_ip=" + server_ip + "&session_name=" + session_name + "&ACTION=updateDISPO&format=text&user=" + user + "&pass=" + pass + "&dispo_choice=" + DispoChoice + "&lead_id=" + document.vicidial_form.lead_id.value + "&campaign=" + campaign + "&auto_dial_level=" + auto_dial_level + "&agent_log_id=" + agent_log_id + "&CallBackDatETimE=" + CallBackDatETimE + "&list_id=" + document.vicidial_form.list_id.value + "&recipient=" + CallBackrecipient + "&use_internal_dnc=" + use_internal_dnc + "&use_campaign_dnc=" + use_campaign_dnc + "&MDnextCID=" + LasTCID + "&stage=" + group + "&vtiger_callback_id=" + vtiger_callback_id + "&phone_number=" + document.vicidial_form.phone_number.value + "&phone_code=" + document.vicidial_form.phone_code.value + "&dial_method" + dial_method + "&uniqueid=" + document.vicidial_form.uniqueid.value + "&CallBackLeadStatus=" + CallBackLeadStatus + "&comments=" + encodeURIComponent(CallBackCommenTs) + "&custom_field_names=" + custom_field_names + "&call_notes=" + encodeURIComponent(document.vicidial_form.call_notes_dispo.value) + "&qm_dispo_code=" + DispoQMcsCODE + "&email_enabled=" + email_enabled +"&recording_id="+VDDCU_recording_id;
xmlhttp.open('POST', 'vdc_db_query.php'); xmlhttp.open('POST', 'vdc_db_query.php');
xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8'); xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded; charset=UTF-8');
xmlhttp.send(DSupdate_query); xmlhttp.send(DSupdate_query);
@@ -10889,6 +10906,26 @@ function set_length(SLnumber,SLlength_goal,SLdirection)
} }
else else
{ {
// Added to get email counts so inbound emails will come in - this is normally done in CloserSelectContent_select, which is bypassed if agents aren't allowed to select ingroups
var loop_ct = 0;
EMAILgroupCOUNT = 0;
PHONEgroupCOUNT = 0;
incomingEMAILS = 0;
while (loop_ct < INgroupCOUNT)
{
if (VARingroup_handlers[loop_ct]=="EMAIL")
{
incomingEMAILgroups[incomingEMAILS]=VARingroups[loop_ct];
EMAILgroupCOUNT++;
incomingEMAILS++;
}
else
{
PHONEgroupCOUNT++;
}
loop_ct++;
}
VU_agent_choose_ingroups_DV = "MGRLOCK"; VU_agent_choose_ingroups_DV = "MGRLOCK";
var live_CSC_HTML = "Manager has selected groups for you<br />"; var live_CSC_HTML = "Manager has selected groups for you<br />";
document.vicidial_form.CloserSelectList.value = ''; document.vicidial_form.CloserSelectList.value = '';
+10 -7
View File
@@ -1,5 +1,5 @@
<?php <?php
# voicemail_check.php version 2.6 # voicemail_check.php version 2.8
# #
# Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
@@ -24,9 +24,11 @@
# 60619-1204 - Added variable filters to close security holes for login form # 60619-1204 - Added variable filters to close security holes for login form
# 90508-0727 - Changed to PHP long tags # 90508-0727 - Changed to PHP long tags
# 130328-0025 - Converted ereg to preg functions # 130328-0025 - Converted ereg to preg functions
# 130603-2202 - Added login lockout for 15 minutes after 10 failed logins, and other security fixes
# #
require("dbconnect.php"); require("dbconnect.php");
require("functions.php");
### If you have globals turned off uncomment these lines ### If you have globals turned off uncomment these lines
if (isset($_GET["user"])) {$user=$_GET["user"];} if (isset($_GET["user"])) {$user=$_GET["user"];}
@@ -44,6 +46,8 @@ if (isset($_GET["vmail_box"])) {$vmail_box=$_GET["vmail_box"];}
$user=preg_replace("/[^0-9a-zA-Z]/","",$user); $user=preg_replace("/[^0-9a-zA-Z]/","",$user);
$pass=preg_replace("/[^0-9a-zA-Z]/","",$pass); $pass=preg_replace("/[^0-9a-zA-Z]/","",$pass);
$session_name = preg_replace("/\'|\"|\\\\|;/","",$session_name);
$server_ip = preg_replace("/\'|\"|\\\\|;/","",$server_ip);
# default optional vars if not set # default optional vars if not set
if (!isset($format)) {$format="text";} if (!isset($format)) {$format="text";}
@@ -55,15 +59,14 @@ $NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s"); $NOW_TIME = date("Y-m-d H:i:s");
if (!isset($query_date)) {$query_date = $NOW_DATE;} if (!isset($query_date)) {$query_date = $NOW_DATE;}
$stmt="SELECT count(*) from vicidial_users where user='$user' and pass='$pass' and user_level > 0;"; $auth=0;
if ($DB) {echo "|$stmt|\n";} $auth_message = user_authorization($user,$pass,'',0);
$rslt=mysql_query($stmt, $link); if ($auth_message == 'GOOD')
$row=mysql_fetch_row($rslt); {$auth=1;}
$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"; echo "Invalid Username/Password: |$user|$pass|$auth_message|\n";
exit; exit;
} }
else else
@@ -21,6 +21,7 @@
# 111103-2300 - Added user_group restrictions for selecting in-groups # 111103-2300 - Added user_group restrictions for selecting in-groups
# 120224-0910 - Added HTML display option with bar graphs # 120224-0910 - Added HTML display option with bar graphs
# 130414-0104 - Added report logging # 130414-0104 - Added report logging
# 130610-1024 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -47,8 +48,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
if (strlen($shift)<2) {$shift='ALL';} if (strlen($shift)<2) {$shift='ALL';}
@@ -147,7 +148,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -157,7 +158,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -554,7 +555,7 @@ while ($j < $TOTintervals)
$totCALLSdate[$dtt]++; $totCALLSdate[$dtt]++;
if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];} if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];} if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
if (ereg('DROP',$st[$i])) if (preg_match('/DROP/',$st[$i]))
{ {
$totDROPS++; $totDROPS++;
$totDROPSsec = ($totDROPSsec + $ls[$i]); $totDROPSsec = ($totDROPSsec + $ls[$i]);
@@ -1091,9 +1092,9 @@ if ($totQUEUEsec > 0)
else else
{$totQUEUEavgRAW = 0;} {$totQUEUEavgRAW = 0;}
$totQUEUEavg = sprintf("%5s", $totQUEUEavg); $totQUEUEavg = sprintf("%5s", $totQUEUEavg);
while (strlen($totQUEUEavg)>5) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);} while (strlen($totQUEUEavg)>5) {$totQUEUEavg = preg_replace('/.$/', '', $totQUEUEavg);}
$totQUEUEmax = sprintf("%5s", $totQUEUEmax); $totQUEUEmax = sprintf("%5s", $totQUEUEmax);
while (strlen($totQUEUEmax)>5) {$totQUEUEmax = ereg_replace(".$",'',$totQUEUEmax);} while (strlen($totQUEUEmax)>5) {$totQUEUEmax = preg_replace('/.$/', '', $totQUEUEmax);}
$totDROPS = sprintf("%5s", $totDROPS); $totDROPS = sprintf("%5s", $totDROPS);
$totCALLS = sprintf("%5s", $totCALLS); $totCALLS = sprintf("%5s", $totCALLS);
@@ -1188,7 +1189,7 @@ while ($h < $TOTintervals)
else {$Phd120[$h]=0;} else {$Phd120[$h]=0;}
if ($hd121[$h] > 0) {$Phd121[$h] = round( ( ($hd121[$h] / $qrtCALLS[$h]) * 100) );} if ($hd121[$h] > 0) {$Phd121[$h] = round( ( ($hd121[$h] / $qrtCALLS[$h]) * 100) );}
else {$Phd121[$h]=0;} else {$Phd121[$h]=0;}
while (strlen($qrtQUEUEavg[$h])>4) {$qrtQUEUEavg[$h] = ereg_replace(".$",'',$qrtQUEUEavg[$h]);} while (strlen($qrtQUEUEavg[$h])>4) {$qrtQUEUEavg[$h] = preg_replace('/.$/', '', $qrtQUEUEavg[$h]);}
$hd__0[$h] = sprintf("%4s", $hd__0[$h]); $hd__0[$h] = sprintf("%4s", $hd__0[$h]);
$hd_20[$h] = sprintf("%4s", $hd_20[$h]); $hd_20[$h] = sprintf("%4s", $hd_20[$h]);
$hd_40[$h] = sprintf("%4s", $hd_40[$h]); $hd_40[$h] = sprintf("%4s", $hd_40[$h]);
@@ -1245,7 +1246,7 @@ while ($h < $TOTintervals)
} }
$Aavg_hold[$h] = sprintf("%4s", $Aavg_hold[$h]); $Aavg_hold[$h] = sprintf("%4s", $Aavg_hold[$h]);
while (strlen($Aavg_hold[$h])>4) {$Aavg_hold[$h] = ereg_replace("^.",'',$Aavg_hold[$h]);} while (strlen($Aavg_hold[$h])>4) {$Aavg_hold[$h] = preg_replace('/^./', '', $Aavg_hold[$h]);}
$MAIN.="|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n"; $MAIN.="|$HMdisplay[$h]| $qrtCALLS[$h] | $Phd__0[$h] $Phd_20[$h] $Phd_40[$h] $Phd_60[$h] $Phd_80[$h] $Phd100[$h] $Phd120[$h] $Phd121[$h] | | $Aavg_hold[$h] |$qrtQUEUEavg_scale[$h]|\n";
$CSV_text.="\"$HMdisplay[$h]\",\"$qrtCALLS[$h]\",\"$Phd__0[$h]\",\"$Phd_20[$h]\",\"$Phd_40[$h]\",\"$Phd_60[$h]\",\"$Phd_80[$h]\",\"$Phd100[$h]\",\"$Phd120[$h]\",\"$Phd121[$h]\",\"$Aavg_hold[$h]\"\n"; $CSV_text.="\"$HMdisplay[$h]\",\"$qrtCALLS[$h]\",\"$Phd__0[$h]\",\"$Phd_20[$h]\",\"$Phd_40[$h]\",\"$Phd_60[$h]\",\"$Phd_80[$h]\",\"$Phd100[$h]\",\"$Phd120[$h]\",\"$Phd121[$h]\",\"$Aavg_hold[$h]\"\n";
@@ -1271,7 +1272,7 @@ $APhd100 = sprintf("%4s", $APhd100);
$APhd120 = sprintf("%4s", $APhd120); $APhd120 = sprintf("%4s", $APhd120);
$APhd121 = sprintf("%4s", $APhd121); $APhd121 = sprintf("%4s", $APhd121);
while (strlen($totQUEUEavg)>4) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);} while (strlen($totQUEUEavg)>4) {$totQUEUEavg = preg_replace('/.$/', '', $totQUEUEavg);}
$MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n"; $MAIN.="+-------------+-------+-----------------------------------------+ +------+--------------------------------+\n";
$MAIN.="| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n"; $MAIN.="| TOTAL | $ALLcalls | $APhd__0 $APhd_20 $APhd_40 $APhd_60 $APhd_80 $APhd100 $APhd120 $APhd121 | | $totQUEUEavg |\n";
+14 -13
View File
@@ -37,6 +37,7 @@
# 120730-0724 - Small fix for HTML output # 120730-0724 - Small fix for HTML output
# 130124-1719 - Added email report support # 130124-1719 - Added email report support
# 130414-1429 - Added report logging # 130414-1429 - Added report logging
# 130610-1023 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -70,8 +71,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$MT[0]='0'; $MT[0]='0';
if (strlen($shift)<2) {$shift='ALL';} if (strlen($shift)<2) {$shift='ALL';}
@@ -157,7 +158,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -167,7 +168,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -223,14 +224,14 @@ while($i < $group_ct)
} }
$i++; $i++;
} }
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\s\-\-NONE\-\-\s/',$group_string) ) or ($group_ct < 1) )
{ {
$group_SQL = "''"; $group_SQL = "''";
# $group_SQL = "group_id IN('')"; # $group_SQL = "group_id IN('')";
} }
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
# $group_SQL = "group_id IN($group_SQL)"; # $group_SQL = "group_id IN($group_SQL)";
} }
if (strlen($group_SQL)<3) {$group_SQL="''";} if (strlen($group_SQL)<3) {$group_SQL="''";}
@@ -361,7 +362,7 @@ $MAIN.="<SELECT SIZE=5 NAME=group[] multiple>\n";
$o=0; $o=0;
while ($groups_to_print > $o) while ($groups_to_print > $o)
{ {
if (ereg("\|$LISTgroups[$o]\|",$group_string)) if (preg_match("/\|$LISTgroups[$o]\|/",$group_string))
{$MAIN.="<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroup_names[$o]</option>\n";} {$MAIN.="<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroup_names[$o]</option>\n";}
else else
{$MAIN.="<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroup_names[$o]</option>\n";} {$MAIN.="<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroup_names[$o]</option>\n";}
@@ -469,7 +470,7 @@ if ($DID=='Y')
$did_SQL .= "'$row[0]',"; $did_SQL .= "'$row[0]',";
$i++; $i++;
} }
$did_SQL = eregi_replace(",$",'',$did_SQL); $did_SQL = preg_replace('/,$/i', '',$did_SQL);
if (strlen($did_SQL)<3) {$did_SQL="''";} if (strlen($did_SQL)<3) {$did_SQL="''";}
$stmt="select uniqueid from vicidial_did_log where did_id IN($did_SQL);"; $stmt="select uniqueid from vicidial_did_log where did_id IN($did_SQL);";
@@ -483,7 +484,7 @@ if ($DID=='Y')
$unid_SQL .= "'$row[0]',"; $unid_SQL .= "'$row[0]',";
$i++; $i++;
} }
$unid_SQL = eregi_replace(",$",'',$unid_SQL); $unid_SQL = preg_replace('/,$/i', '',$unid_SQL);
if (strlen($unid_SQL)<3) {$unid_SQL="''";} if (strlen($unid_SQL)<3) {$unid_SQL="''";}
if ($DB > 0) if ($DB > 0)
@@ -546,7 +547,7 @@ if ($group_ct > 1)
$DIDunid_SQL .= "'$row[0]',"; $DIDunid_SQL .= "'$row[0]',";
$k++; $k++;
} }
$DIDunid_SQL = eregi_replace(",$",'',$DIDunid_SQL); $DIDunid_SQL = preg_replace('/,$/i', '',$DIDunid_SQL);
if (strlen($DIDunid_SQL)<3) {$DIDunid_SQL="''";} if (strlen($DIDunid_SQL)<3) {$DIDunid_SQL="''";}
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';"; $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id='$group[$i]';";
@@ -1581,7 +1582,7 @@ while ($i < $reasons_to_print)
$REASONcount = sprintf("%10s", $row[0]); $REASONcount = sprintf("%10s", $row[0]);
while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);}
$reason = sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);} $reason = sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);}
# if (ereg("NONE",$reason)) {$reason = 'NO ANSWER ';} # if (preg_match('/NONE/',$reason)) {$reason = 'NO ANSWER ';}
$ASCII_text.="| $reason | $REASONcount |\n"; $ASCII_text.="| $reason | $REASONcount |\n";
$CSV_text3.="\"$reason\",\"$REASONcount\"\n"; $CSV_text3.="\"$reason\",\"$REASONcount\"\n";
@@ -2227,8 +2228,8 @@ while ($j < $calls_to_print)
if ( ($Crem[$j] >= $sec) and ($Crem[$j] < $sec_end) ) if ( ($Crem[$j] >= $sec) and ($Crem[$j] < $sec_end) )
{ {
$Ftotal[$i]++; $Ftotal[$i]++;
if (ereg("DROP",$Cstatus[$j])) {$Fdrop[$i]++;} if (preg_match('/DROP/',$Cstatus[$j])) {$Fdrop[$i]++;}
if (!ereg("DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND|MAXCAL",$Cstatus[$j])) if (!preg_match('/DROP|XDROP|HXFER|QVMAIL|HOLDTO|LIVE|QUEUE|TIMEOT|AFTHRS|NANQUE|INBND|MAXCAL/',$Cstatus[$j]))
{ {
$BDansweredCALLS++; $BDansweredCALLS++;
$Fanswer[$i]++; $Fanswer[$i]++;
@@ -16,6 +16,7 @@
# 111103-2315 - Added user_group restrictions for selecting in-groups # 111103-2315 - Added user_group restrictions for selecting in-groups
# 120224-0910 - Added HTML display option with bar graphs # 120224-0910 - Added HTML display option with bar graphs
# 130414-0107 - Added report logging # 130414-0107 - Added report logging
# 130610-1022 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -58,8 +59,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$MT[0]='0'; $MT[0]='0';
if (strlen($shift)<2) {$shift='ALL';} if (strlen($shift)<2) {$shift='ALL';}
@@ -172,7 +173,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -182,7 +183,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -198,7 +199,7 @@ if (!isset($query_date)) {$query_date = $NOW_DATE;}
if (!isset($end_date)) {$end_date = $NOW_DATE;} if (!isset($end_date)) {$end_date = $NOW_DATE;}
$exclude_rolloverSQL="$whereLOGadmin_viewable_groupsSQL"; $exclude_rolloverSQL="$whereLOGadmin_viewable_groupsSQL";
if (eregi("YES",$exclude_rollover)) if (preg_match("/YES/i",$exclude_rollover))
{$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns) $LOGadmin_viewable_groupsSQL";} {$exclude_rolloverSQL = " where group_id NOT IN(SELECT drop_inbound_group from vicidial_campaigns) $LOGadmin_viewable_groupsSQL";}
$stmt="select group_id,group_name from vicidial_inbound_groups $exclude_rolloverSQL order by group_id;"; $stmt="select group_id,group_name from vicidial_inbound_groups $exclude_rolloverSQL order by group_id;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -231,14 +232,14 @@ while($i < $group_ct)
} }
$i++; $i++;
} }
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\s\-\-NONE\-\-\s/',$group_string) ) or ($group_ct < 1) )
{ {
$group_SQL = "''"; $group_SQL = "''";
# $group_SQL = "group_id IN('')"; # $group_SQL = "group_id IN('')";
} }
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
# $group_SQL = "group_id IN($group_SQL)"; # $group_SQL = "group_id IN($group_SQL)";
} }
if (strlen($group_SQL)<3) {$group_SQL="''";} if (strlen($group_SQL)<3) {$group_SQL="''";}
@@ -349,7 +350,7 @@ if ($bareformat < 1)
$o=0; $o=0;
while ($groups_to_print > $o) while ($groups_to_print > $o)
{ {
if (ereg("\|$LISTgroups[$o]\|",$group_string)) if (preg_match("/\|$LISTgroups[$o]\|/",$group_string))
{$MAIN.="<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroup_names[$o]</option>\n";} {$MAIN.="<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroup_names[$o]</option>\n";}
else else
{$MAIN.="<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroup_names[$o]</option>\n";} {$MAIN.="<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroup_names[$o]</option>\n";}
@@ -560,7 +561,7 @@ else
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$call_date = explode(" ", $row[3]); $call_date = explode(" ", $row[3]);
$call_time = ereg_replace("[^0-9]","",$call_date[1]); $call_time = preg_replace('/[^0-9]/','',$call_date[1]);
$epoch = $row[4]; $epoch = $row[4];
$Cwday = date("w", $epoch); $Cwday = date("w", $epoch);
@@ -593,7 +594,7 @@ else
$talk_sec[$i] = ($talk_sec[$i] + $TEMPtalk); $talk_sec[$i] = ($talk_sec[$i] + $TEMPtalk);
if ($max_queue_seconds[$i] < $row[2]) if ($max_queue_seconds[$i] < $row[2])
{$max_queue_seconds[$i] = $row[2];} {$max_queue_seconds[$i] = $row[2];}
if (eregi("DROP",$row[0])) if (preg_match("/DROP/i",$row[0]))
{$drop_count[$i]++;} {$drop_count[$i]++;}
else else
{$answer_count[$i]++;} {$answer_count[$i]++;}
@@ -604,7 +605,7 @@ else
$Htalk_sec[$Chour] = ($Htalk_sec[$Chour] + $TEMPtalk); $Htalk_sec[$Chour] = ($Htalk_sec[$Chour] + $TEMPtalk);
if ($Hmax_queue_seconds[$Chour] < $row[2]) if ($Hmax_queue_seconds[$Chour] < $row[2])
{$Hmax_queue_seconds[$Chour] = $row[2];} {$Hmax_queue_seconds[$Chour] = $row[2];}
if (eregi("DROP",$row[0])) if (preg_match("/DROP/i",$row[0]))
{$Hdrop_count[$Chour]++;} {$Hdrop_count[$Chour]++;}
else else
{$Hanswer_count[$Chour]++;} {$Hanswer_count[$Chour]++;}
@@ -762,9 +763,9 @@ else
if ($Hanswer_count[$h]>$sub_max_answer) {$sub_max_answer=$Hanswer_count[$h];} if ($Hanswer_count[$h]>$sub_max_answer) {$sub_max_answer=$Hanswer_count[$h];}
if ($Htalk_sec[$h]>$sub_max_talk) {$sub_max_talk=$Htalk_sec[$h];} if ($Htalk_sec[$h]>$sub_max_talk) {$sub_max_talk=$Htalk_sec[$h];}
if ($Htalk_avg[$h]>$sub_max_avgtalk) {$sub_max_avgtalk=$Htalk_avg[$h];} if ($Htalk_avg[$h]>$sub_max_avgtalk) {$sub_max_avgtalk=$Htalk_avg[$h];}
if ($Hqueue_seconds[$h]>$sub_max_maxqueue) {$sub_max_maxqueue=$Hqueue_seconds[$h];} if ($Hqueue_seconds[$h]>$sub_max_queue) {$sub_max_queue=$Hqueue_seconds[$h];}
if ($Hqueue_avg[$h]>$sub_max_avgqueue) {$sub_max_avgqueue=$Hqueue_avg[$h];} if ($Hqueue_avg[$h]>$sub_max_avgqueue) {$sub_max_avgqueue=$Hqueue_avg[$h];}
if ($Hsub_max_queue_seconds[$h]>$sub_max_maxqueue) {$sub_max_maxqueue=$Hmax_queue_seconds[$h];} if ($Hmax_queue_seconds[$h]>$sub_max_maxqueue) {$sub_max_maxqueue=$Hmax_queue_seconds[$h];}
if ($Hdrop_count[$h]>$sub_max_totalabandons) {$sub_max_totalabandons=$Hdrop_count[$h];} if ($Hdrop_count[$h]>$sub_max_totalabandons) {$sub_max_totalabandons=$Hdrop_count[$h];}
$q++; $q++;
@@ -801,6 +802,15 @@ else
else else
{$hTOTqueue_avg = 0;} {$hTOTqueue_avg = 0;}
$gTOTcalls_count+=$hTOTcalls_count;
$gTOTanswer_count+=$hTOTanswer_count;
$gTOTtalk_sec+=$hTOTtalk_sec;
#$gTOTtalk_avg+=$hTOTtalk_avg;
$gTOTqueue_seconds+=$hTOTqueue_seconds;
#$gTOTqueue_avg+=$hTOTqueue_avg;
$gTOTmax_queue_seconds+=$hTOTmax_queue_seconds;
$gTOTdrop_count+=$hTOTdrop_count;
$hTOTtalk_sec = sec_convert($hTOTtalk_sec,'H'); $hTOTtalk_sec = sec_convert($hTOTtalk_sec,'H');
$hTOTtalk_avg = sec_convert($hTOTtalk_avg,'H'); $hTOTtalk_avg = sec_convert($hTOTtalk_avg,'H');
$hTOTqueue_seconds = sec_convert($hTOTqueue_seconds,'H'); $hTOTqueue_seconds = sec_convert($hTOTqueue_seconds,'H');
@@ -861,14 +871,12 @@ else
$SUBoutput .= "+------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n"; $SUBoutput .= "+------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
$SUBoutput .= "|TOTALS| $hTOTcalls_count | $hTOTanswer_count | $hTOTtalk_sec | $hTOTtalk_avg | $hTOTqueue_seconds | $hTOTqueue_avg | $hTOTmax_queue_seconds | $hTOTdrop_count |\n"; $SUBoutput .= "|TOTALS| $hTOTcalls_count | $hTOTanswer_count | $hTOTtalk_sec | $hTOTtalk_avg | $hTOTqueue_seconds | $hTOTqueue_avg | $hTOTmax_queue_seconds | $hTOTdrop_count |\n";
$SUBoutput .= "+------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n"; $SUBoutput .= "+------+--------+--------+-----------+---------+-----------+---------+---------+--------+\n";
$CSV_subreports.="\"TOTALS\",\"$hTOTcalls_count\",\"$hTOTanswer_count\",\"$hTOTtalk_sec\",\"$hTOTtalk_avg\",\"$hTOTqueue_seconds\",\"$hTOTqueue_avg\",\"$hTOTmax_queue_seconds\",\"$hTOTdrop_count\"\n"; $CSV_subreports.="\"TOTALS\",\"$hTOTcalls_count\",\"$hTOTanswer_count\",\"$hTOTtalk_sec\",\"$hTOTtalk_avg\",\"$hTOTqueue_seconds\",\"$hTOTqueue_avg\",\"$hTOTmax_queue_seconds\",\"$hTOTdrop_count\"\n";
# $SUBoutput.=$sub_GRAPH; # $SUBoutput.=$sub_GRAPH;
$i++; $i++;
} }
$rawTOTtalk_sec = $TOTtalk_sec; $rawTOTtalk_sec = $TOTtalk_sec;
$rawTOTtalk_min = round($rawTOTtalk_sec / 60); $rawTOTtalk_min = round($rawTOTtalk_sec / 60);
@@ -881,7 +889,6 @@ else
else else
{$TOTqueue_avg = 0;} {$TOTqueue_avg = 0;}
for ($q=0; $q<count($graph_stats); $q++) { for ($q=0; $q<count($graph_stats); $q++) {
if ($q==0) {$class=" first";} else if (($q+1)==count($graph_stats)) {$class=" last";} else {$class="";} if ($q==0) {$class=" first";} else if (($q+1)==count($graph_stats)) {$class=" last";} else {$class="";}
$CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][1]/$max_calls)."' height='16' />".$graph_stats[$q][1]."</td></tr>"; $CALLS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][1]/$max_calls)."' height='16' />".$graph_stats[$q][1]."</td></tr>";
@@ -893,14 +900,28 @@ else
$MAXQUEUE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][7]/$max_maxqueue)."' height='16' />".sec_convert($graph_stats[$q][7],'H')."</td></tr>"; $MAXQUEUE_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][7]/$max_maxqueue)."' height='16' />".sec_convert($graph_stats[$q][7],'H')."</td></tr>";
$TOTALABANDONS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][8]/$max_totalabandons)."' height='16' />".$graph_stats[$q][8]."</td></tr>"; $TOTALABANDONS_graph.=" <tr><td class='chart_td$class'>".$graph_stats[$q][0]."</td><td nowrap class='chart_td value$class'><img src='images/bar.png' alt='' width='".round(400*$graph_stats[$q][8]/$max_totalabandons)."' height='16' />".$graph_stats[$q][8]."</td></tr>";
} }
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTcalls_count)."</th></tr></table>";
$ANSWER_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTanswer_count)."</th></tr></table>"; if ( ($gTOTanswer_count > 0) and ($gTOTtalk_sec > 0) )
$TALK_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTtalk_sec)."</th></tr></table>"; {$gTOTtalk_avg = round($gTOTtalk_sec / $gTOTanswer_count);}
$AVGTALK_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTtalk_avg)."</th></tr></table>"; else
$QUEUE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTqueue_seconds)."</th></tr></table>"; {$gTOTtalk_avg = 0;}
$AVGQUEUE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTqueue_avg)."</th></tr></table>"; if ( ($gTOTcalls_count > 0) and ($gTOTqueue_seconds > 0) )
$MAXQUEUE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTmax_queue_seconds)."</th></tr></table>"; {$gTOTqueue_avg = round($gTOTqueue_seconds / $gTOTcalls_count);}
$TOTALABANDONS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($hTOTdrop_count)."</th></tr></table>"; else
{$gTOTqueue_avg = 0;}
$gTOTtalk_sec = sec_convert($gTOTtalk_sec,'H');
$gTOTtalk_avg = sec_convert($gTOTtalk_avg,'H');
$gTOTqueue_seconds = sec_convert($gTOTqueue_seconds,'H');
$gTOTqueue_avg = sec_convert($gTOTqueue_avg,'H');
$gTOTmax_queue_seconds = sec_convert($gTOTmax_queue_seconds,'H');
$CALLS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($gTOTcalls_count)."</th></tr></table>";
$ANSWER_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($gTOTanswer_count)."</th></tr></table>";
$TALK_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($gTOTtalk_sec)."</th></tr></table>";
$AVGTALK_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($gTOTtalk_avg)."</th></tr></table>";
$QUEUE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($gTOTqueue_seconds)."</th></tr></table>";
$AVGQUEUE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($gTOTqueue_avg)."</th></tr></table>";
$MAXQUEUE_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($gTOTmax_queue_seconds)."</th></tr></table>";
$TOTALABANDONS_graph.="<tr><th class='thgraph' scope='col'>TOTAL:</th><th class='thgraph' scope='col'>".trim($gTOTdrop_count)."</th></tr></table>";
$JS_onload.="\tDrawGraph('CALLS', '1');\n"; $JS_onload.="\tDrawGraph('CALLS', '1');\n";
$JS_text.="function DrawGraph(graph, th_id) {\n"; $JS_text.="function DrawGraph(graph, th_id) {\n";
$JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n"; $JS_text.=" var CALLS_graph=\"$CALLS_graph\";\n";
+11 -10
View File
@@ -16,6 +16,7 @@
# 111104-1133 - Added user_group restrictions for selecting in-groups # 111104-1133 - Added user_group restrictions for selecting in-groups
# 120224-0910 - Added HTML display option with bar graphs # 120224-0910 - Added HTML display option with bar graphs
# 130414-0113 - Added report logging # 130414-0113 - Added report logging
# 130610-1017 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -45,8 +46,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_PW);
if (strlen($shift)<2) {$shift='ALL';} if (strlen($shift)<2) {$shift='ALL';}
@@ -116,7 +117,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -126,7 +127,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -170,14 +171,14 @@ while($i < $group_ct)
} }
$i++; $i++;
} }
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\s\-\-NONE\-\-\s/',$group_string) ) or ($group_ct < 1) )
{ {
$group_SQL = "''"; $group_SQL = "''";
# $group_SQL = "group_id IN('')"; # $group_SQL = "group_id IN('')";
} }
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
# $group_SQL = "group_id IN($group_SQL)"; # $group_SQL = "group_id IN($group_SQL)";
} }
if (strlen($group_SQL)<3) {$group_SQL="''";} if (strlen($group_SQL)<3) {$group_SQL="''";}
@@ -291,7 +292,7 @@ $MAIN.="<SELECT SIZE=5 NAME=group[] multiple>\n";
$o=0; $o=0;
while ($groups_to_print > $o) while ($groups_to_print > $o)
{ {
if (ereg("\|$groups[$o]\|",$group_string)) if (preg_match("/\|$groups[$o]\|/",$group_string))
{$MAIN.="<option selected value=\"$groups[$o]\">$group_patterns[$o] - $group_names[$o]</option>\n";} {$MAIN.="<option selected value=\"$groups[$o]\">$group_patterns[$o] - $group_names[$o]</option>\n";}
else else
{$MAIN.="<option value=\"$groups[$o]\">$group_patterns[$o] - $group_names[$o]</option>\n";} {$MAIN.="<option value=\"$groups[$o]\">$group_patterns[$o] - $group_names[$o]</option>\n";}
@@ -610,7 +611,7 @@ else
$totCALLS = ($totCALLS + $stat_count); $totCALLS = ($totCALLS + $stat_count);
$stat_pattern = sprintf("%-18s", $stat_pattern); $stat_pattern = sprintf("%-18s", $stat_pattern);
$stat_description = sprintf("%-30s", $stat_description); $stat_description = sprintf("%-30s", $stat_description);
while (strlen($stat_description) > 30) {$stat_description = eregi_replace(".$",'',$stat_description);} while (strlen($stat_description) > 30) {$stat_description = preg_replace('/.$/i', '',$stat_description);}
$stat_route = sprintf("%-10s", $stat_route); $stat_route = sprintf("%-10s", $stat_route);
$stat_count = sprintf("%10s", $stat_count); $stat_count = sprintf("%10s", $stat_count);
@@ -1024,9 +1025,9 @@ else
else else
{$totQUEUEavgRAW = 0;} {$totQUEUEavgRAW = 0;}
$totQUEUEavg = sprintf("%5s", $totQUEUEavg); $totQUEUEavg = sprintf("%5s", $totQUEUEavg);
while (strlen($totQUEUEavg)>5) {$totQUEUEavg = ereg_replace(".$",'',$totQUEUEavg);} while (strlen($totQUEUEavg)>5) {$totQUEUEavg = preg_replace('/.$/', '', $totQUEUEavg);}
$totQUEUEmax = sprintf("%5s", $totQUEUEmax); $totQUEUEmax = sprintf("%5s", $totQUEUEmax);
while (strlen($totQUEUEmax)>5) {$totQUEUEmax = ereg_replace(".$",'',$totQUEUEmax);} while (strlen($totQUEUEmax)>5) {$totQUEUEmax = preg_replace('/.$/', '', $totQUEUEmax);}
$totDROPS = sprintf("%5s", $totDROPS); $totDROPS = sprintf("%5s", $totDROPS);
$totCALLS = sprintf("%5s", $totCALLS); $totCALLS = sprintf("%5s", $totCALLS);
@@ -10,6 +10,7 @@
# #
# 90914-1003 - First build # 90914-1003 - First build
# 130414-0214 - Added report logging # 130414-0214 - Added report logging
# 130610-1016 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -33,8 +34,8 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
if (isset($_GET["DB"])) {$DB=$_GET["DB"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
if (strlen($shift)<2) {$shift='ALL';} if (strlen($shift)<2) {$shift='ALL';}
@@ -200,23 +201,23 @@ while ($i < $records_to_grab)
while ($k < $records_to_grabC) while ($k < $records_to_grabC)
{ {
$stmt="SELECT length_in_sec from call_log where extension='$phone_number[$k]'"; $stmt="SELECT length_in_sec from call_log where extension='$phone_number[$k]'";
if (eregi("MANUAL_OVERRIDE",$call_type[$k])) if (preg_match("/MANUAL_OVERRIDE/i",$call_type[$k]))
{$stmt="SELECT length_in_sec from call_log where extension='$phone_number[$k]'";} {$stmt="SELECT length_in_sec from call_log where extension='$phone_number[$k]'";}
if (eregi("XFER_OVERRIDE",$call_type[$k])) if (preg_match("/XFER_OVERRIDE/i",$call_type[$k]))
{ {
$number_dialed[$k] = eregi_replace("Local/",'',$number_dialed[$k]); $number_dialed[$k] = preg_replace('/Local\//i', '',$number_dialed[$k]);
$number_dialed[$k] = eregi_replace("@default",'',$number_dialed[$k]); $number_dialed[$k] = preg_replace('/\@default/i', '',$number_dialed[$k]);
$stmt="SELECT length_in_sec from call_log where extension='$number_dialed[$k]'"; $stmt="SELECT length_in_sec from call_log where extension='$number_dialed[$k]'";
} }
if (eregi("XFER_3WAY",$call_type[$k])) if (preg_match("/XFER_3WAY/i",$call_type[$k]))
{ {
$number_dialed[$k] = eregi_replace("Local/",'',$number_dialed[$k]); $number_dialed[$k] = preg_replace('/Local\//i', '',$number_dialed[$k]);
$number_dialed[$k] = eregi_replace("@default",'',$number_dialed[$k]); $number_dialed[$k] = preg_replace('/\@default/i', '',$number_dialed[$k]);
$stmt="SELECT length_in_sec from call_log where extension='$number_dialed[$k]'"; $stmt="SELECT length_in_sec from call_log where extension='$number_dialed[$k]'";
} }
if (eregi("MANUAL_DIALNOW",$call_type[$k])) if (preg_match("/MANUAL_DIALNOW/i",$call_type[$k]))
{$stmt="SELECT length_in_sec from call_log where extension='$phone_number[$k]'";} {$stmt="SELECT length_in_sec from call_log where extension='$phone_number[$k]'";}
if (eregi("MANUAL_DIALFAST",$call_type[$k])) if (preg_match("/MANUAL_DIALFAST/i",$call_type[$k]))
{$stmt="SELECT length_in_sec from call_log where extension='$phone_number[$k]'";} {$stmt="SELECT length_in_sec from call_log where extension='$phone_number[$k]'";}
$stmt .= " and start_epoch >= $call_dateS[$k] and start_epoch <= $call_dateE[$k];"; $stmt .= " and start_epoch >= $call_dateS[$k] and start_epoch <= $call_dateE[$k];";
+3 -2
View File
@@ -10,6 +10,7 @@
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 120113-2022 - Added new columns for sent to queue and agent # 120113-2022 - Added new columns for sent to queue and agent
# 130414-0257 - Added report logging # 130414-0257 - Added report logging
# 130610-1007 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -58,8 +59,8 @@ if ($hourly_breakdown) {
$checked=""; $checked="";
} }
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
############################################# #############################################
##### START SYSTEM_SETTINGS LOOKUP ##### ##### START SYSTEM_SETTINGS LOOKUP #####
+13 -12
View File
@@ -21,6 +21,7 @@
# 111103-2315 - Added user_group restrictions for selecting in-groups # 111103-2315 - Added user_group restrictions for selecting in-groups
# 120224-0910 - Added HTML display option with bar graphs # 120224-0910 - Added HTML display option with bar graphs
# 130114-0115 - Added report logging # 130114-0115 - Added report logging
# 130610-1004 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -51,8 +52,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
if (strlen($shift)<2) {$shift='ALL';} if (strlen($shift)<2) {$shift='ALL';}
if (strlen($type)<2) {$type='inbound';} if (strlen($type)<2) {$type='inbound';}
@@ -149,7 +150,7 @@ $LOGadmin_viewable_call_times = $row[3];
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -159,7 +160,7 @@ if ( (!eregi("-ALL",$LOGallowed_campaigns)) )
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -169,7 +170,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -229,14 +230,14 @@ while($i < $group_ct)
$groupQS .= "&group[]=$group[$i]"; $groupQS .= "&group[]=$group[$i]";
$i++; $i++;
} }
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\s\-\-NONE\-\-\s/',$group_string) ) or ($group_ct < 1) )
{ {
$group_SQL = "''"; $group_SQL = "''";
# $group_SQL = "group_id IN('')"; # $group_SQL = "group_id IN('')";
} }
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
# $group_SQL = "group_id IN($group_SQL)"; # $group_SQL = "group_id IN($group_SQL)";
} }
if (strlen($group_SQL)<3) {$group_SQL="''";} if (strlen($group_SQL)<3) {$group_SQL="''";}
@@ -383,7 +384,7 @@ if ($type == 'inbound')
$o=0; $o=0;
while ($groups_to_print > $o) while ($groups_to_print > $o)
{ {
if (ereg("\|$LISTgroups[$o]\|",$group_string)) if (preg_match("/\|$LISTgroups[$o]\|/",$group_string))
{$MAIN.="<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroups_names[$o]</option>\n";} {$MAIN.="<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroups_names[$o]</option>\n";}
else else
{$MAIN.="<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroups_names[$o]</option>\n";} {$MAIN.="<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroups_names[$o]</option>\n";}
@@ -406,7 +407,7 @@ else
$o=0; $o=0;
while ($groups_to_print > $o) while ($groups_to_print > $o)
{ {
if (ereg("\|$LISTgroups[$o]\|",$group_string)) if (preg_match("/\|$LISTgroups[$o]\|/",$group_string))
{$MAIN.="<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroups_names[$o]</option>\n";} {$MAIN.="<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroups_names[$o]</option>\n";}
else else
{$MAIN.="<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroups_names[$o]</option>\n";} {$MAIN.="<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroups_names[$o]</option>\n";}
@@ -535,7 +536,7 @@ else
{$NOCALLERIDcalls++;} {$NOCALLERIDcalls++;}
else else
{ {
if (!ereg("_$phone_ext[$p]_",$unique_callerIDs)) if (!preg_match("/_$phone_ext[$p]_/",$unique_callerIDs))
{ {
$unique_callerIDs .= "_$phone_ext[$p]_"; $unique_callerIDs .= "_$phone_ext[$p]_";
$UNIQUEcallers++; $UNIQUEcallers++;
@@ -685,7 +686,7 @@ else
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$vcl_statuses[$w] = $row[0]; $vcl_statuses[$w] = $row[0];
if ( (ereg("DROP",$vcl_statuses[$w])) or (ereg("XDROP",$vcl_statuses[$w])) ) if ( (preg_match('/DROP/',$vcl_statuses[$w])) or (preg_match('/XDROP/',$vcl_statuses[$w])) )
{$FLOWdrop[$s]++;} {$FLOWdrop[$s]++;}
$FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]); $FLOWclose_time[$s] = ($FLOWclose_time[$s] + $row[1]);
$FLOWtotal[$s]++; $FLOWtotal[$s]++;
@@ -711,7 +712,7 @@ else
$FLOWtotal[$s] = sprintf("%6s", $FLOWtotal[$s]); $FLOWtotal[$s] = sprintf("%6s", $FLOWtotal[$s]);
$FLOWdrop[$s] = sprintf("%6s", $FLOWdrop[$s]); $FLOWdrop[$s] = sprintf("%6s", $FLOWdrop[$s]);
$FLOWdropPCT[$s] = sprintf("%6s", $FLOWdropPCT[$s]); $FLOWdropPCT[$s] = sprintf("%6s", $FLOWdropPCT[$s]);
$FLOWsummary[1] = ereg_replace('----------',' / ',$FLOWsummary[1]); $FLOWsummary[1] = preg_replace('/\-\-\-\-\-\-\-\-\-\-/', ' / ', $FLOWsummary[1]);
$FLOWtotal_time[$s] = ($FLOWivr_time[$s] + $FLOWclose_time[$s]); $FLOWtotal_time[$s] = ($FLOWivr_time[$s] + $FLOWclose_time[$s]);
$avgFLOWivr_time[$s] = ($FLOWivr_time[$s] / $FLOWsummary[0]); $avgFLOWivr_time[$s] = ($FLOWivr_time[$s] / $FLOWsummary[0]);
@@ -13,6 +13,8 @@
# 120524-1754 - Fixed status categories issue # 120524-1754 - Fixed status categories issue
# 130221-1928 - small change to remove nested SQL query # 130221-1928 - small change to remove nested SQL query
# 130414-0127 - Added report logging # 130414-0127 - Added report logging
# 130424-2039 - Added lines for new status categories of scheduled callbacks and completed
# 130610-1001 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -38,8 +40,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$report_name = 'Lists Campaign Statuses Report'; $report_name = 'Lists Campaign Statuses Report';
$db_source = 'M'; $db_source = 'M';
@@ -150,7 +152,7 @@ while($i < $group_ct)
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -169,7 +171,7 @@ while ($i < $campaigns_to_print)
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$groups[$i] = $row[0]; $groups[$i] = $row[0];
$group_names[$i] = $row[1]; $group_names[$i] = $row[1];
if (ereg("-ALL",$group_string) ) if (preg_match('/\-ALL/',$group_string) )
{$group[$i] = $groups[$i];} {$group[$i] = $groups[$i];}
$i++; $i++;
} }
@@ -190,13 +192,13 @@ while($i < $group_ct)
} }
if (strlen($group_drop_SQL) < 2) if (strlen($group_drop_SQL) < 2)
{$group_drop_SQL = "''";} {$group_drop_SQL = "''";}
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) or (strlen($group_string) < 2) ) if ( (preg_match('/\-\-ALL\-\-/',$group_string) ) or ($group_ct < 1) or (strlen($group_string) < 2) )
{ {
$group_SQL = "$LOGallowed_campaignsSQL"; $group_SQL = "$LOGallowed_campaignsSQL";
} }
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
$both_group_SQLand = "and ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )"; $both_group_SQLand = "and ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )";
$both_group_SQL = "where ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )"; $both_group_SQL = "where ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )";
$group_SQLand = "and campaign_id IN($group_SQL)"; $group_SQLand = "and campaign_id IN($group_SQL)";
@@ -250,7 +252,7 @@ $dnc_statuses='';
$customer_contact_statuses=''; $customer_contact_statuses='';
$not_interested_statuses=''; $not_interested_statuses='';
$unworkable_statuses=''; $unworkable_statuses='';
$stmt="select status,human_answered,sale,dnc,customer_contact,not_interested,unworkable,status_name from vicidial_statuses;"; $stmt="select status,human_answered,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed,status_name from vicidial_statuses;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";} if ($DB) {$MAIN.="$stmt\n";}
$statha_to_print = mysql_num_rows($rslt); $statha_to_print = mysql_num_rows($rslt);
@@ -259,16 +261,18 @@ while ($i < $statha_to_print)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$temp_status = $row[0]; $temp_status = $row[0];
$statname_list["$temp_status"] = "$row[7]"; $statname_list["$temp_status"] = "$row[9]";
if ($row[1]=='Y') {$human_answered_statuses .= "'$temp_status',";} if ($row[1]=='Y') {$human_answered_statuses .= "'$temp_status',";}
if ($row[2]=='Y') {$sale_statuses .= "'$temp_status',";} if ($row[2]=='Y') {$sale_statuses .= "'$temp_status',";}
if ($row[3]=='Y') {$dnc_statuses .= "'$temp_status',";} if ($row[3]=='Y') {$dnc_statuses .= "'$temp_status',";}
if ($row[4]=='Y') {$customer_contact_statuses .= "'$temp_status',";} if ($row[4]=='Y') {$customer_contact_statuses .= "'$temp_status',";}
if ($row[5]=='Y') {$not_interested_statuses .= "'$temp_status',";} if ($row[5]=='Y') {$not_interested_statuses .= "'$temp_status',";}
if ($row[6]=='Y') {$unworkable_statuses .= "'$temp_status',";} if ($row[6]=='Y') {$unworkable_statuses .= "'$temp_status',";}
if ($row[7]=='Y') {$scheduled_callback_statuses .= "'$temp_status',";}
if ($row[8]=='Y') {$completed_statuses .= "'$temp_status',";}
$i++; $i++;
} }
$stmt="select status,human_answered,sale,dnc,customer_contact,not_interested,unworkable,status_name from vicidial_campaign_statuses where selectable IN('Y','N') $group_SQLand;"; $stmt="select status,human_answered,sale,dnc,customer_contact,not_interested,unworkable,scheduled_callback,completed,status_name from vicidial_campaign_statuses where selectable IN('Y','N') $group_SQLand;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";} if ($DB) {$MAIN.="$stmt\n";}
$statha_to_print = mysql_num_rows($rslt); $statha_to_print = mysql_num_rows($rslt);
@@ -277,13 +281,15 @@ while ($i < $statha_to_print)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$temp_status = $row[0]; $temp_status = $row[0];
$statname_list["$temp_status"] = "$row[7]"; $statname_list["$temp_status"] = "$row[9]";
if ( ($row[1]=='Y') and (!preg_match("/'$temp_status'/",$human_answered_statuses)) ) {$human_answered_statuses .= "'$temp_status',";} if ( ($row[1]=='Y') and (!preg_match("/'$temp_status'/",$human_answered_statuses)) ) {$human_answered_statuses .= "'$temp_status',";}
if ($row[2]=='Y') {$sale_statuses .= "'$temp_status',";} if ($row[2]=='Y') {$sale_statuses .= "'$temp_status',";}
if ($row[3]=='Y') {$dnc_statuses .= "'$temp_status',";} if ($row[3]=='Y') {$dnc_statuses .= "'$temp_status',";}
if ($row[4]=='Y') {$customer_contact_statuses .= "'$temp_status',";} if ($row[4]=='Y') {$customer_contact_statuses .= "'$temp_status',";}
if ($row[5]=='Y') {$not_interested_statuses .= "'$temp_status',";} if ($row[5]=='Y') {$not_interested_statuses .= "'$temp_status',";}
if ($row[6]=='Y') {$unworkable_statuses .= "'$temp_status',";} if ($row[6]=='Y') {$unworkable_statuses .= "'$temp_status',";}
if ($row[7]=='Y') {$scheduled_callback_statuses .= "'$temp_status',";}
if ($row[8]=='Y') {$completed_statuses .= "'$temp_status',";}
$i++; $i++;
} }
if (strlen($human_answered_statuses)>2) {$human_answered_statuses = substr("$human_answered_statuses", 0, -1);} if (strlen($human_answered_statuses)>2) {$human_answered_statuses = substr("$human_answered_statuses", 0, -1);}
@@ -298,6 +304,10 @@ if (strlen($not_interested_statuses)>2) {$not_interested_statuses = substr("$no
else {$not_interested_statuses="''";} else {$not_interested_statuses="''";}
if (strlen($unworkable_statuses)>2) {$unworkable_statuses = substr("$unworkable_statuses", 0, -1);} if (strlen($unworkable_statuses)>2) {$unworkable_statuses = substr("$unworkable_statuses", 0, -1);}
else {$unworkable_statuses="''";} else {$unworkable_statuses="''";}
if (strlen($scheduled_callback_statuses)>2) {$scheduled_callback_statuses = substr("$scheduled_callback_statuses", 0, -1);}
else {$scheduled_callback_statuses="''";}
if (strlen($completed_statuses)>2) {$completed_statuses = substr("$completed_statuses", 0, -1);}
else {$completed_statuses="''";}
$HEADER.="<HTML>\n"; $HEADER.="<HTML>\n";
$HEADER.="<HEAD>\n"; $HEADER.="<HEAD>\n";
@@ -324,14 +334,14 @@ $MAIN.="<INPUT TYPE=HIDDEN NAME=DB VALUE=\"$DB\">\n";
$MAIN.="</TD><TD VALIGN=TOP> Campaigns:<BR>"; $MAIN.="</TD><TD VALIGN=TOP> Campaigns:<BR>";
$MAIN.="<SELECT SIZE=5 NAME=group[] multiple>\n"; $MAIN.="<SELECT SIZE=5 NAME=group[] multiple>\n";
if (eregi("--ALL--",$group_string)) if (preg_match('/\-\-ALL\-\-/',$group_string))
{$MAIN.="<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";} {$MAIN.="<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";}
else else
{$MAIN.="<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";} {$MAIN.="<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";}
$o=0; $o=0;
while ($campaigns_to_print > $o) while ($campaigns_to_print > $o)
{ {
if (eregi("$groups[$o]\|",$group_string)) {$MAIN.="<option selected value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";} if (preg_match("/$groups[$o]\|/i",$group_string)) {$MAIN.="<option selected value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";}
else {$MAIN.="<option value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";} else {$MAIN.="<option value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";}
$o++; $o++;
} }
@@ -489,6 +499,10 @@ else
$NI_percent=0; $NI_percent=0;
$UW_count=0; $UW_count=0;
$UW_percent=0; $UW_percent=0;
$SC_count=0;
$SC_percent=0;
$COMP_count=0;
$COMP_percent=0;
$max_calls=1; $graph_stats=array(); $max_calls=1; $graph_stats=array();
$GRAPH.="</PRE><table cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"white\" summary=\"DID Summary\" class=\"horizontalgraph\">\n"; $GRAPH.="</PRE><table cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"white\" summary=\"DID Summary\" class=\"horizontalgraph\">\n";
@@ -588,6 +602,36 @@ else
$UW_percent = ( ($UW_count / $TOTALleads) * 100); $UW_percent = ( ($UW_count / $TOTALleads) * 100);
} }
} }
$stmt="select count(*) from vicidial_list where status IN($scheduled_callback_statuses) and list_id IN($list_id_SQL);";
$rslt=mysql_query($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$SC_results = mysql_num_rows($rslt);
if ($SC_results > 0)
{
$row=mysql_fetch_row($rslt);
$SC_count = $row[0];
$flag_count+=$row[0];
if ($SC_count > 0)
{
if ($SC_count>$max_calls) {$max_calls=$SC_count;}
$SC_percent = ( ($SC_count / $TOTALleads) * 100);
}
}
$stmt="select count(*) from vicidial_list where status IN($completed_statuses) and list_id IN($list_id_SQL);";
$rslt=mysql_query($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$COMP_results = mysql_num_rows($rslt);
if ($COMP_results > 0)
{
$row=mysql_fetch_row($rslt);
$COMP_count = $row[0];
$flag_count+=$row[0];
if ($COMP_count > 0)
{
if ($COMP_count>$max_calls) {$max_calls=$COMP_count;}
$COMP_percent = ( ($COMP_count / $TOTALleads) * 100);
}
}
$HA_percent = sprintf("%6.2f", "$HA_percent"); while(strlen($HA_percent)>6) {$HA_percent = substr("$HA_percent", 0, -1);} $HA_percent = sprintf("%6.2f", "$HA_percent"); while(strlen($HA_percent)>6) {$HA_percent = substr("$HA_percent", 0, -1);}
$SALE_percent = sprintf("%6.2f", "$SALE_percent"); while(strlen($SALE_percent)>6) {$SALE_percent = substr("$SALE_percent", 0, -1);} $SALE_percent = sprintf("%6.2f", "$SALE_percent"); while(strlen($SALE_percent)>6) {$SALE_percent = substr("$SALE_percent", 0, -1);}
@@ -595,6 +639,8 @@ else
$CC_percent = sprintf("%6.2f", "$CC_percent"); while(strlen($CC_percent)>6) {$CC_percent = substr("$CC_percent", 0, -1);} $CC_percent = sprintf("%6.2f", "$CC_percent"); while(strlen($CC_percent)>6) {$CC_percent = substr("$CC_percent", 0, -1);}
$NI_percent = sprintf("%6.2f", "$NI_percent"); while(strlen($NI_percent)>6) {$NI_percent = substr("$NI_percent", 0, -1);} $NI_percent = sprintf("%6.2f", "$NI_percent"); while(strlen($NI_percent)>6) {$NI_percent = substr("$NI_percent", 0, -1);}
$UW_percent = sprintf("%6.2f", "$UW_percent"); while(strlen($UW_percent)>6) {$UW_percent = substr("$UW_percent", 0, -1);} $UW_percent = sprintf("%6.2f", "$UW_percent"); while(strlen($UW_percent)>6) {$UW_percent = substr("$UW_percent", 0, -1);}
$SC_percent = sprintf("%6.2f", "$SC_percent"); while(strlen($SC_percent)>6) {$SC_percent = substr("$SC_percent", 0, -1);}
$COMP_percent = sprintf("%6.2f", "$COMP_percent"); while(strlen($COMP_percent)>6) {$COMP_percent = substr("$COMP_percent", 0, -1);}
$HA_count = sprintf("%10s", "$HA_count"); while(strlen($HA_count)>10) {$HA_count = substr("$HA_count", 0, -1);} $HA_count = sprintf("%10s", "$HA_count"); while(strlen($HA_count)>10) {$HA_count = substr("$HA_count", 0, -1);}
$SALE_count = sprintf("%10s", "$SALE_count"); while(strlen($SALE_count)>10) {$SALE_count = substr("$SALE_count", 0, -1);} $SALE_count = sprintf("%10s", "$SALE_count"); while(strlen($SALE_count)>10) {$SALE_count = substr("$SALE_count", 0, -1);}
@@ -602,6 +648,8 @@ else
$CC_count = sprintf("%10s", "$CC_count"); while(strlen($CC_count)>10) {$CC_count = substr("$CC_count", 0, -1);} $CC_count = sprintf("%10s", "$CC_count"); while(strlen($CC_count)>10) {$CC_count = substr("$CC_count", 0, -1);}
$NI_count = sprintf("%10s", "$NI_count"); while(strlen($NI_count)>10) {$NI_count = substr("$NI_count", 0, -1);} $NI_count = sprintf("%10s", "$NI_count"); while(strlen($NI_count)>10) {$NI_count = substr("$NI_count", 0, -1);}
$UW_count = sprintf("%10s", "$UW_count"); while(strlen($UW_count)>10) {$UW_count = substr("$UW_count", 0, -1);} $UW_count = sprintf("%10s", "$UW_count"); while(strlen($UW_count)>10) {$UW_count = substr("$UW_count", 0, -1);}
$SC_count = sprintf("%10s", "$SC_count"); while(strlen($SC_count)>10) {$SC_count = substr("$SC_count", 0, -1);}
$COMP_count = sprintf("%10s", "$COMP_count"); while(strlen($COMP_count)>10) {$COMP_count = substr("$COMP_count", 0, -1);}
$OUToutput .= "\n"; $OUToutput .= "\n";
$OUToutput .= "\n"; $OUToutput .= "\n";
@@ -613,6 +661,8 @@ else
$OUToutput .= "| Customer Contact | $CC_count | $CC_percent% |\n"; $OUToutput .= "| Customer Contact | $CC_count | $CC_percent% |\n";
$OUToutput .= "| Not Interested | $NI_count | $NI_percent% |\n"; $OUToutput .= "| Not Interested | $NI_count | $NI_percent% |\n";
$OUToutput .= "| Unworkable | $UW_count | $UW_percent% |\n"; $OUToutput .= "| Unworkable | $UW_count | $UW_percent% |\n";
$OUToutput .= "| Sched Callbacks | $SC_count | $SC_percent% |\n";
$OUToutput .= "| Completed | $COMP_count | $COMP_percent% |\n";
$OUToutput .= "+------------------+------------+----------+\n"; $OUToutput .= "+------------------+------------+----------+\n";
$OUToutput .= "\n"; $OUToutput .= "\n";
@@ -623,6 +673,8 @@ else
$CSV_text2 .= "\"Customer Contact\",\"$CC_count\",\"$CC_percent%\"\n"; $CSV_text2 .= "\"Customer Contact\",\"$CC_count\",\"$CC_percent%\"\n";
$CSV_text2 .= "\"Not Interested\",\"$NI_count\",\"$NI_percent%\"\n"; $CSV_text2 .= "\"Not Interested\",\"$NI_count\",\"$NI_percent%\"\n";
$CSV_text2 .= "\"Unworkable\",\"$UW_count\",\"$UW_percent%\"\n"; $CSV_text2 .= "\"Unworkable\",\"$UW_count\",\"$UW_percent%\"\n";
$CSV_text2 .= "\"Scheduled Callbacks\",\"$SC_count\",\"$SC_percent%\"\n";
$CSV_text2 .= "\"Completed\",\"$COMP_count\",\"$COMP_percent%\"\n";
$GRAPH.=" <tr>\n"; $GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td first\">Human Answer</td>\n"; $GRAPH.=" <td class=\"chart_td first\">Human Answer</td>\n";
@@ -645,8 +697,16 @@ else
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$NI_count/$max_calls)."\" height=\"16\" />".$NI_count." ($NI_percent%)</td>\n"; $GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$NI_count/$max_calls)."\" height=\"16\" />".$NI_count." ($NI_percent%)</td>\n";
$GRAPH.=" </tr>\n"; $GRAPH.=" </tr>\n";
$GRAPH.=" <tr>\n"; $GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td last\">Unworkable</td>\n"; $GRAPH.=" <td class=\"chart_td\">Unworkable</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value last\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$UW_count/$max_calls)."\" height=\"16\" />".$UW_count." ($UW_percent%)</td>\n"; $GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$UW_count/$max_calls)."\" height=\"16\" />".$UW_count." ($UW_percent%)</td>\n";
$GRAPH.=" </tr>\n";
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td\">Scheduled Callbacks</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$SC_count/$max_calls)."\" height=\"16\" />".$SC_count." ($SC_percent%)</td>\n";
$GRAPH.=" </tr>\n";
$GRAPH.=" <tr>\n";
$GRAPH.=" <td class=\"chart_td last\">Completed</td>\n";
$GRAPH.=" <td nowrap class=\"chart_td value last\"><img src=\"images/bar.png\" alt=\"\" width=\"".round(400*$COMP_count/$max_calls)."\" height=\"16\" />".$COMP_count." ($COMP_percent%)</td>\n";
$GRAPH.=" </tr>\n"; $GRAPH.=" </tr>\n";
$GRAPH.=" <tr>\n"; $GRAPH.=" <tr>\n";
$GRAPH.=" <th class=\"thgraph\" scope=\"col\">TOTAL:</th>\n"; $GRAPH.=" <th class=\"thgraph\" scope=\"col\">TOTAL:</th>\n";
@@ -770,6 +830,10 @@ else
$NI_percent=0; $NI_percent=0;
$UW_count=0; $UW_count=0;
$UW_percent=0; $UW_percent=0;
$SC_count=0;
$SC_percent=0;
$COMP_count=0;
$COMP_percent=0;
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($human_answered_statuses);"; $stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($human_answered_statuses);";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -855,6 +919,34 @@ else
} }
} }
if ($UW_count>$max_flags) {$max_flags=$UW_count;} if ($UW_count>$max_flags) {$max_flags=$UW_count;}
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($scheduled_callback_statuses);";
$rslt=mysql_query($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$SC_results = mysql_num_rows($rslt);
if ($SC_results > 0)
{
$row=mysql_fetch_row($rslt);
$SC_count = $row[0];
if ($SC_count > 0)
{
$SC_percent = ( ($SC_count / $LISTIDcalls[$i]) * 100);
}
}
if ($SC_count>$max_flags) {$max_flags=$SC_count;}
$stmt="select count(*) from vicidial_list where list_id='$LISTIDlists[$i]' and status IN($completed_statuses);";
$rslt=mysql_query($stmt, $link);
if ($DB) {$MAIN.="$stmt\n";}
$COMP_results = mysql_num_rows($rslt);
if ($COMP_results > 0)
{
$row=mysql_fetch_row($rslt);
$COMP_count = $row[0];
if ($COMP_count > 0)
{
$COMP_percent = ( ($COMP_count / $LISTIDcalls[$i]) * 100);
}
}
if ($COMP_count>$max_flags) {$max_flags=$COMP_count;}
$HA_percent = sprintf("%6.2f", "$HA_percent"); while(strlen($HA_percent)>6) {$HA_percent = substr("$HA_percent", 0, -1);} $HA_percent = sprintf("%6.2f", "$HA_percent"); while(strlen($HA_percent)>6) {$HA_percent = substr("$HA_percent", 0, -1);}
$SALE_percent = sprintf("%6.2f", "$SALE_percent"); while(strlen($SALE_percent)>6) {$SALE_percent = substr("$SALE_percent", 0, -1);} $SALE_percent = sprintf("%6.2f", "$SALE_percent"); while(strlen($SALE_percent)>6) {$SALE_percent = substr("$SALE_percent", 0, -1);}
@@ -862,6 +954,8 @@ else
$CC_percent = sprintf("%6.2f", "$CC_percent"); while(strlen($CC_percent)>6) {$CC_percent = substr("$CC_percent", 0, -1);} $CC_percent = sprintf("%6.2f", "$CC_percent"); while(strlen($CC_percent)>6) {$CC_percent = substr("$CC_percent", 0, -1);}
$NI_percent = sprintf("%6.2f", "$NI_percent"); while(strlen($NI_percent)>6) {$NI_percent = substr("$NI_percent", 0, -1);} $NI_percent = sprintf("%6.2f", "$NI_percent"); while(strlen($NI_percent)>6) {$NI_percent = substr("$NI_percent", 0, -1);}
$UW_percent = sprintf("%6.2f", "$UW_percent"); while(strlen($UW_percent)>6) {$UW_percent = substr("$UW_percent", 0, -1);} $UW_percent = sprintf("%6.2f", "$UW_percent"); while(strlen($UW_percent)>6) {$UW_percent = substr("$UW_percent", 0, -1);}
$SC_percent = sprintf("%6.2f", "$SC_percent"); while(strlen($SC_percent)>6) {$SC_percent = substr("$SC_percent", 0, -1);}
$COMP_percent = sprintf("%6.2f", "$COMP_percent"); while(strlen($COMP_percent)>6) {$COMP_percent = substr("$COMP_percent", 0, -1);}
$HA_count = sprintf("%9s", "$HA_count"); while(strlen($HA_count)>9) {$HA_count = substr("$HA_count", 0, -1);} $HA_count = sprintf("%9s", "$HA_count"); while(strlen($HA_count)>9) {$HA_count = substr("$HA_count", 0, -1);}
$SALE_count = sprintf("%9s", "$SALE_count"); while(strlen($SALE_count)>9) {$SALE_count = substr("$SALE_count", 0, -1);} $SALE_count = sprintf("%9s", "$SALE_count"); while(strlen($SALE_count)>9) {$SALE_count = substr("$SALE_count", 0, -1);}
@@ -869,6 +963,8 @@ else
$CC_count = sprintf("%9s", "$CC_count"); while(strlen($CC_count)>9) {$CC_count = substr("$CC_count", 0, -1);} $CC_count = sprintf("%9s", "$CC_count"); while(strlen($CC_count)>9) {$CC_count = substr("$CC_count", 0, -1);}
$NI_count = sprintf("%9s", "$NI_count"); while(strlen($NI_count)>9) {$NI_count = substr("$NI_count", 0, -1);} $NI_count = sprintf("%9s", "$NI_count"); while(strlen($NI_count)>9) {$NI_count = substr("$NI_count", 0, -1);}
$UW_count = sprintf("%9s", "$UW_count"); while(strlen($UW_count)>9) {$UW_count = substr("$UW_count", 0, -1);} $UW_count = sprintf("%9s", "$UW_count"); while(strlen($UW_count)>9) {$UW_count = substr("$UW_count", 0, -1);}
$SC_count = sprintf("%9s", "$SC_count"); while(strlen($SC_count)>9) {$SC_count = substr("$SC_count", 0, -1);}
$COMP_count = sprintf("%9s", "$COMP_count"); while(strlen($COMP_count)>9) {$COMP_count = substr("$COMP_count", 0, -1);}
$OUToutput .= "| STATUS FLAGS BREAKDOWN: (and % of total leads in the list) |\n"; $OUToutput .= "| STATUS FLAGS BREAKDOWN: (and % of total leads in the list) |\n";
$OUToutput .= "| Human Answer: $HA_count $HA_percent% |\n"; $OUToutput .= "| Human Answer: $HA_count $HA_percent% |\n";
@@ -877,6 +973,8 @@ else
$OUToutput .= "| Customer Contact: $CC_count $CC_percent% |\n"; $OUToutput .= "| Customer Contact: $CC_count $CC_percent% |\n";
$OUToutput .= "| Not Interested: $NI_count $NI_percent% |\n"; $OUToutput .= "| Not Interested: $NI_count $NI_percent% |\n";
$OUToutput .= "| Unworkable: $UW_count $UW_percent% |\n"; $OUToutput .= "| Unworkable: $UW_count $UW_percent% |\n";
$OUToutput .= "| Sched Callbacks: $SC_count $SC_percent% |\n";
$OUToutput .= "| Completed: $COMP_count $COMP_percent% |\n";
$OUToutput .= "+----+--------------------------------------------+------------+\n"; $OUToutput .= "+----+--------------------------------------------+------------+\n";
$OUToutput .= " | STATUS BREAKDOWN: | COUNT |\n"; $OUToutput .= " | STATUS BREAKDOWN: | COUNT |\n";
$OUToutput .= " +--------+-----------------------------------+------------+\n"; $OUToutput .= " +--------+-----------------------------------+------------+\n";
@@ -886,7 +984,9 @@ else
$FLAGS_graph.=" <tr><td class='chart_td'>DNC</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(400*$DNC_count/$max_flags)."' height='16' />$DNC_count ($DNC_percent%)</td></tr>"; $FLAGS_graph.=" <tr><td class='chart_td'>DNC</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(400*$DNC_count/$max_flags)."' height='16' />$DNC_count ($DNC_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>CUSTOMER CONTACT</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(400*$CC_count/$max_flags)."' height='16' />$CC_count ($CC_percent%)</td></tr>"; $FLAGS_graph.=" <tr><td class='chart_td'>CUSTOMER CONTACT</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(400*$CC_count/$max_flags)."' height='16' />$CC_count ($CC_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>NOT INTERESTED</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(400*$NI_count/$max_flags)."' height='16' />$NI_count ($NI_percent%)</td></tr>"; $FLAGS_graph.=" <tr><td class='chart_td'>NOT INTERESTED</td><td nowrap class='chart_td value'><img src='images/bar.png' alt='' width='".round(400*$NI_count/$max_flags)."' height='16' />$NI_count ($NI_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td last'>UNWORKABLE</td><td nowrap class='chart_td value last><img src='images/bar.png' alt='' width='".round(400*$UW_count/$max_flags)."' height='16' />$UW_count ($UW_percent%)</td></tr>"; $FLAGS_graph.=" <tr><td class='chart_td'>UNWORKABLE</td><td nowrap class='chart_td value last><img src='images/bar.png' alt='' width='".round(400*$UW_count/$max_flags)."' height='16' />$UW_count ($UW_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td'>SCHEDULED CALLBACKS</td><td nowrap class='chart_td value last><img src='images/bar.png' alt='' width='".round(400*$SC_count/$max_flags)."' height='16' />$SC_count ($SC_percent%)</td></tr>";
$FLAGS_graph.=" <tr><td class='chart_td last'>COMPLETED</td><td nowrap class='chart_td value last><img src='images/bar.png' alt='' width='".round(400*$COMP_count/$max_flags)."' height='16' />$COMP_count ($COMP_percent%)</td></tr>";
$CSV_text4.="\"STATUS FLAGS BREAKDOWN:\",\"(and % of total leads in the list)\"\n"; $CSV_text4.="\"STATUS FLAGS BREAKDOWN:\",\"(and % of total leads in the list)\"\n";
$CSV_text4.="\"Human Answer:\",\"$HA_count\",\"$HA_percent%\"\n"; $CSV_text4.="\"Human Answer:\",\"$HA_count\",\"$HA_percent%\"\n";
@@ -895,6 +995,8 @@ else
$CSV_text4.="\"Customer Contact:\",\"$CC_count\",\"$CC_percent%\"\n"; $CSV_text4.="\"Customer Contact:\",\"$CC_count\",\"$CC_percent%\"\n";
$CSV_text4.="\"Not Interested:\",\"$NI_count\",\"$NI_percent%\"\n"; $CSV_text4.="\"Not Interested:\",\"$NI_count\",\"$NI_percent%\"\n";
$CSV_text4.="\"Unworkable:\",\"$UW_count\",\"$UW_percent%\"\n\n"; $CSV_text4.="\"Unworkable:\",\"$UW_count\",\"$UW_percent%\"\n\n";
$CSV_text4.="\"Scheduled Callbacks:\",\"$SC_count\",\"$SC_percent%\"\n\n";
$CSV_text4.="\"Completed:\",\"$COMP_count\",\"$COMP_percent%\"\n\n";
$CSV_text4.="\"STATUS BREAKDOWN:\",\"\",\"COUNT\"\n"; $CSV_text4.="\"STATUS BREAKDOWN:\",\"\",\"COUNT\"\n";
$stmt="select status,count(*) from vicidial_list where list_id='$LISTIDlists[$i]' group by status order by status;"; $stmt="select status,count(*) from vicidial_list where list_id='$LISTIDlists[$i]' group by status order by status;";
@@ -11,6 +11,7 @@
# 100802-2347 - Added User Group Allowed Reports option validation # 100802-2347 - Added User Group Allowed Reports option validation
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
# 130414-0201 - Added report logging # 130414-0201 - Added report logging
# 130610-1003 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -32,8 +33,8 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
if (isset($_GET["DB"])) {$DB=$_GET["DB"];} if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];} elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
if (strlen($shift)<2) {$shift='ALL';} if (strlen($shift)<2) {$shift='ALL';}
@@ -16,6 +16,7 @@
# 111104-1205 - Added user_group and calltime restrictions # 111104-1205 - Added user_group and calltime restrictions
# 120224-0910 - Added HTML display option with bar graphs # 120224-0910 - Added HTML display option with bar graphs
# 130414-0119 - Added report logging # 130414-0119 - Added report logging
# 130610-1000 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -56,8 +57,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$MT[0]='0'; $MT[0]='0';
if (strlen($shift)<2) {$shift='ALL';} if (strlen($shift)<2) {$shift='ALL';}
@@ -165,10 +166,10 @@ if ($records_to_print > 0)
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$LOGallowed_reports = $row[1]; $LOGallowed_reports = $row[1];
$LOGadmin_viewable_call_times = $row[2]; $LOGadmin_viewable_call_times = $row[2];
if ( (!eregi("ALL-CAMPAIGNS",$row[0])) ) if ( (!preg_match("/ALL-CAMPAIGNS/i",$row[0])) )
{ {
$rawLOGallowed_campaignsSQL = eregi_replace(' -','',$row[0]); $rawLOGallowed_campaignsSQL = preg_replace('/\s\-/i', '',$row[0]);
$rawLOGallowed_campaignsSQL = eregi_replace(' ',"','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace('/\s/i', '\',\'',$rawLOGallowed_campaignsSQL);
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')"; $LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')"; $whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
} }
@@ -186,7 +187,7 @@ else
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -220,7 +221,7 @@ while ($i < $campaigns_to_print)
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$groups[$i] = $row[0]; $groups[$i] = $row[0];
$group_names[$i] = $row[1]; $group_names[$i] = $row[1];
if (eregi('--ALL--',$group_string)) if (preg_match('/\-\-ALL\-\-/i',$group_string))
{$group[$i] = $row[0];} {$group[$i] = $row[0];}
$i++; $i++;
} }
@@ -245,7 +246,7 @@ while($i < $group_ct)
$groupQS .= "&group[]=$group[$i]"; $groupQS .= "&group[]=$group[$i]";
} }
if (eregi("YES",$include_rollover)) if (preg_match("/YES/i",$include_rollover))
{ {
$stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';"; $stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -262,15 +263,15 @@ while($i < $group_ct)
$i++; $i++;
} }
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$group_string) ) or ($group_ct < 1) )
{ {
$group_SQL = ""; $group_SQL = "";
$group_drop_SQL = ""; $group_drop_SQL = "";
} }
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
$group_drop_SQL = eregi_replace(",$",'',$group_drop_SQL); $group_drop_SQL = preg_replace('/,$/i', '',$group_drop_SQL);
$both_group_SQLand = "and ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )"; $both_group_SQLand = "and ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )";
$both_group_SQL = "where ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )"; $both_group_SQL = "where ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )";
$group_SQLand = "and campaign_id IN($group_SQL)"; $group_SQLand = "and campaign_id IN($group_SQL)";
@@ -452,14 +453,14 @@ if ($bareformat < 1)
$MAIN.="</TD><TD VALIGN=TOP ROWSPAN=2> Campaigns:<BR>"; $MAIN.="</TD><TD VALIGN=TOP ROWSPAN=2> Campaigns:<BR>";
$MAIN.="<SELECT SIZE=5 NAME=group[] multiple>\n"; $MAIN.="<SELECT SIZE=5 NAME=group[] multiple>\n";
if (eregi("--ALL--",$group_string)) if (preg_match('/\-\-ALL\-\-/',$group_string))
{$MAIN.="<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";} {$MAIN.="<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";}
else else
{$MAIN.="<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";} {$MAIN.="<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";}
$o=0; $o=0;
while ($campaigns_to_print > $o) while ($campaigns_to_print > $o)
{ {
if (eregi("$groups[$o]\|",$group_string)) {$MAIN.="<option selected value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";} if (preg_match("/$groups[$o]\|/i",$group_string)) {$MAIN.="<option selected value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";}
else {$MAIN.="<option value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";} else {$MAIN.="<option value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";}
$o++; $o++;
} }
@@ -732,7 +733,7 @@ else
} }
$group_drop[$i]=''; $group_drop[$i]='';
if (eregi("YES",$include_rollover)) if (preg_match("/YES/i",$include_rollover))
{ {
##### Gather inbound calls from drop inbound group if selected ##### Gather inbound calls from drop inbound group if selected
$stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';"; $stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';";
@@ -859,7 +860,7 @@ else
while ($p < $s) while ($p < $s)
{ {
$call_date = explode(" ", $ATcall_date[$p]); $call_date = explode(" ", $ATcall_date[$p]);
$call_time = ereg_replace("[^0-9]","",$call_date[1]); $call_time = preg_replace('/[^0-9]/','',$call_date[1]);
$epoch = $ATepoch[$p]; $epoch = $ATepoch[$p];
$Cwday = date("w", $epoch); $Cwday = date("w", $epoch);
@@ -933,7 +934,7 @@ else
while ($p < $u) while ($p < $u)
{ {
$call_date = explode(" ", $CPcall_date[$p]); $call_date = explode(" ", $CPcall_date[$p]);
$call_time = ereg_replace("[^0-9]","",$call_date[1]); $call_time = preg_replace('/[^0-9]/','',$call_date[1]);
$epoch = $CPepoch[$p]; $epoch = $CPepoch[$p];
$Cwday = date("w", $epoch); $Cwday = date("w", $epoch);
@@ -986,7 +987,7 @@ else
$Htalk_sec[$Chour] = ($Htalk_sec[$Chour] + $TEMPtalk); $Htalk_sec[$Chour] = ($Htalk_sec[$Chour] + $TEMPtalk);
$Hcalls_count[$Chour]++; $Hcalls_count[$Chour]++;
if (eregi("DROP",$CPstatus[$p])) if (preg_match("/DROP/i",$CPstatus[$p]))
{ {
if ($CPin_out[$p] == 'OUT') if ($CPin_out[$p] == 'OUT')
{ {
@@ -1001,7 +1002,7 @@ else
$answer_count[$i]++; $answer_count[$i]++;
$Hanswer_count[$Chour]++; $Hanswer_count[$Chour]++;
} }
if (eregi("\|$CPstatus[$p]\|",'|NA|NEW|QUEUE|INCALL|DROP|XDROP|AA|AM|AL|AFAX|AB|ADC|DNCL|DNCC|PU|PM|SVYEXT|SVYHU|SVYVM|SVYREC|QVMAIL|')) if (preg_match("/\|$CPstatus[$p]\|/i",'|NA|NEW|QUEUE|INCALL|DROP|XDROP|AA|AM|AL|AFAX|AB|ADC|DNCL|DNCC|PU|PM|SVYEXT|SVYHU|SVYVM|SVYREC|QVMAIL|'))
{ {
$system_count[$i]++; $system_count[$i]++;
$Hsystem_count[$Chour]++; $Hsystem_count[$Chour]++;
+26 -25
View File
@@ -33,6 +33,7 @@
# 101207-1634 - Changed limits on seconds to 65000 from 36000 in vicidial_agent_log # 101207-1634 - Changed limits on seconds to 65000 from 36000 in vicidial_agent_log
# 120224-0910 - Added HTML display option with bar graphs # 120224-0910 - Added HTML display option with bar graphs
# 130414-0117 - Added report logging # 130414-0117 - Added report logging
# 130610-0956 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -76,8 +77,8 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
if (strlen($shift)<2) {$shift='ALL';} if (strlen($shift)<2) {$shift='ALL';}
if (strlen($bottom_graph)<2) {$bottom_graph='NO';} if (strlen($bottom_graph)<2) {$bottom_graph='NO';}
@@ -206,7 +207,7 @@ while($i < $group_ct)
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -225,7 +226,7 @@ while ($i < $campaigns_to_print)
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$groups[$i] = $row[0]; $groups[$i] = $row[0];
$group_names[$i] = $row[1]; $group_names[$i] = $row[1];
if (ereg("-ALL",$group_string) ) if (preg_match('/\-ALL/',$group_string) )
{$group[$i] = $groups[$i];} {$group[$i] = $groups[$i];}
$i++; $i++;
} }
@@ -243,7 +244,7 @@ while($i < $group_ct)
$groupQS .= "&group[]=$group[$i]"; $groupQS .= "&group[]=$group[$i]";
} }
if (eregi("YES",$include_rollover)) if (preg_match("/YES/i",$include_rollover))
{ {
$stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';"; $stmt="select drop_inbound_group from vicidial_campaigns where campaign_id='$group[$i]' $LOGallowed_campaignsSQL and drop_inbound_group NOT LIKE \"%NONE%\" and drop_inbound_group is NOT NULL and drop_inbound_group != '';";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -262,15 +263,15 @@ while($i < $group_ct)
} }
if (strlen($group_drop_SQL) < 2) if (strlen($group_drop_SQL) < 2)
{$group_drop_SQL = "''";} {$group_drop_SQL = "''";}
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) or (strlen($group_string) < 2) ) if ( (preg_match('/\-\-ALL\-\-/',$group_string) ) or ($group_ct < 1) or (strlen($group_string) < 2) )
{ {
$group_SQL = "$LOGallowed_campaignsSQL"; $group_SQL = "$LOGallowed_campaignsSQL";
$group_drop_SQL = ""; $group_drop_SQL = "";
} }
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
$group_drop_SQL = eregi_replace(",$",'',$group_drop_SQL); $group_drop_SQL = preg_replace('/,$/i', '',$group_drop_SQL);
$both_group_SQLand = "and ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )"; $both_group_SQLand = "and ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )";
$both_group_SQL = "where ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )"; $both_group_SQL = "where ( (campaign_id IN($group_drop_SQL)) or (campaign_id IN($group_SQL)) )";
$group_SQLand = "and campaign_id IN($group_SQL)"; $group_SQLand = "and campaign_id IN($group_SQL)";
@@ -389,14 +390,14 @@ o_cal.a_tpl.yearscroll = false;
echo "</TD><TD VALIGN=TOP> Campaigns:<BR>"; echo "</TD><TD VALIGN=TOP> Campaigns:<BR>";
echo "<SELECT SIZE=5 NAME=group[] multiple>\n"; echo "<SELECT SIZE=5 NAME=group[] multiple>\n";
if (eregi("--ALL--",$group_string)) if (preg_match('/\-\-ALL\-\-/',$group_string))
{echo "<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";} {echo "<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";}
else else
{echo "<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";} {echo "<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";}
$o=0; $o=0;
while ($campaigns_to_print > $o) while ($campaigns_to_print > $o)
{ {
if (eregi("$groups[$o]\|",$group_string)) {echo "<option selected value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";} if (preg_match("/$groups[$o]\|/i",$group_string)) {echo "<option selected value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";}
else {echo "<option value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";} else {echo "<option value=\"$groups[$o]\">$groups[$o] - $group_names[$o]</option>\n";}
$o++; $o++;
} }
@@ -500,7 +501,7 @@ else
$TOTALcallsRAW = $row[0]; $TOTALcallsRAW = $row[0];
$TOTALsec = $row[1]; $TOTALsec = $row[1];
$inTOTALcallsRAW=0; $inTOTALcallsRAW=0;
if (eregi("YES",$include_rollover)) if (preg_match("/YES/i",$include_rollover))
{ {
$length_in_secZ=0; $length_in_secZ=0;
$queue_secondsZ=0; $queue_secondsZ=0;
@@ -544,7 +545,7 @@ else
$OUToutput .= "Total Calls placed from this Campaign: $TOTALcalls\n"; $OUToutput .= "Total Calls placed from this Campaign: $TOTALcalls\n";
$OUToutput .= "Average Call Length for all Calls in seconds: $average_call_seconds\n"; $OUToutput .= "Average Call Length for all Calls in seconds: $average_call_seconds\n";
if (eregi("YES",$include_rollover)) if (preg_match("/YES/i",$include_rollover))
{$OUToutput .= "Calls that went to rollover In-Group: $inTOTALcalls\n";} {$OUToutput .= "Calls that went to rollover In-Group: $inTOTALcalls\n";}
@@ -558,7 +559,7 @@ else
$CIcallsRAW = $row[0]; $CIcallsRAW = $row[0];
$CIsec = $row[1]; $CIsec = $row[1];
if (eregi("YES",$include_rollover)) if (preg_match("/YES/i",$include_rollover))
{ {
$length_in_secZ=0; $length_in_secZ=0;
$queue_secondsZ=0; $queue_secondsZ=0;
@@ -659,7 +660,7 @@ else
$q++; $q++;
$p++; $p++;
} }
$camp_ANS_STAT_SQL = eregi_replace(",$",'',$camp_ANS_STAT_SQL); $camp_ANS_STAT_SQL = preg_replace('/,$/i', '',$camp_ANS_STAT_SQL);
$stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand and status IN($camp_ANS_STAT_SQL);"; $stmt="select count(*) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $group_SQLand and status IN($camp_ANS_STAT_SQL);";
@@ -696,7 +697,7 @@ else
$OUToutput .= "Total Outbound DROP Calls: $DROPcalls $DROPpercent%\n"; $OUToutput .= "Total Outbound DROP Calls: $DROPcalls $DROPpercent%\n";
$OUToutput .= "Percent of DROP Calls taken out of Answers: $DROPcalls / $ANSWERcalls $DROPANSWERpercent%\n"; $OUToutput .= "Percent of DROP Calls taken out of Answers: $DROPcalls / $ANSWERcalls $DROPANSWERpercent%\n";
if (eregi("YES",$include_rollover)) if (preg_match("/YES/i",$include_rollover))
{ {
if ( ($DROPcalls < 1) or ($CIcallsRAW < 1) ) if ( ($DROPcalls < 1) or ($CIcallsRAW < 1) )
{$inDROPANSWERpercent = '0';} {$inDROPANSWERpercent = '0';}
@@ -724,7 +725,7 @@ else
$closer_campaignsSQL .= "'$closer_campaigns',"; $closer_campaignsSQL .= "'$closer_campaigns',";
$c++; $c++;
} }
$closer_campaignsSQL = eregi_replace(",$",'',$closer_campaignsSQL); $closer_campaignsSQL = preg_replace('/,$/i', '',$closer_campaignsSQL);
$stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($closer_campaignsSQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE');"; $stmt="select count(*) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and campaign_id IN($closer_campaignsSQL) and status NOT IN('DROP','XDROP','HXFER','QVMAIL','HOLDTO','LIVE','QUEUE');";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -826,8 +827,8 @@ else
$REASONcount = sprintf("%10s", $row[0]);while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);} $REASONcount = sprintf("%10s", $row[0]);while(strlen($REASONcount)>10) {$REASONcount = substr("$REASONcount", 0, -1);}
$reason = sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);} $reason = sprintf("%-20s", $row[1]);while(strlen($reason)>20) {$reason = substr("$reason", 0, -1);}
if (ereg("NONE",$reason)) {$reason = 'NO ANSWER ';} if (preg_match('/NONE/',$reason)) {$reason = 'NO ANSWER ';}
if (ereg("CALLER",$reason)) {$reason = 'CUSTOMER ';} if (preg_match('/CALLER/',$reason)) {$reason = 'CUSTOMER ';}
$ASCII_text .= "| $reason | $REASONcount |\n"; $ASCII_text .= "| $reason | $REASONcount |\n";
@@ -892,7 +893,7 @@ else
$campaignSQL = "$group_SQLand"; $campaignSQL = "$group_SQLand";
if (eregi("YES",$include_rollover)) if (preg_match("/YES/i",$include_rollover))
{$campaignSQL = "$both_group_SQLand";} {$campaignSQL = "$both_group_SQLand";}
## Pull the count of agent seconds for the total tally ## Pull the count of agent seconds for the total tally
$stmt="SELECT sum(pause_sec + wait_sec + talk_sec + dispo_sec) from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' $campaignSQL and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000;"; $stmt="SELECT sum(pause_sec + wait_sec + talk_sec + dispo_sec) from vicidial_agent_log where event_time >= '$query_date_BEGIN' and event_time <= '$query_date_END' $campaignSQL and pause_sec<65000 and wait_sec<65000 and talk_sec<65000 and dispo_sec<65000;";
@@ -908,7 +909,7 @@ else
## get counts and time totals for all statuses in this campaign ## get counts and time totals for all statuses in this campaign
$rollover_exclude_dropSQL=''; $rollover_exclude_dropSQL='';
if (eregi("YES",$include_rollover)) if (preg_match("/YES/i",$include_rollover))
{$rollover_exclude_dropSQL = "and status NOT IN('DROP')";} {$rollover_exclude_dropSQL = "and status NOT IN('DROP')";}
$stmt="select count(*),status,sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $rollover_exclude_dropSQL $group_SQLand group by status;"; $stmt="select count(*),status,sum(length_in_sec) from vicidial_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' $rollover_exclude_dropSQL $group_SQLand group by status;";
@@ -926,13 +927,13 @@ else
$statusSQL .= "'$row[1]',"; $statusSQL .= "'$row[1]',";
$i++; $i++;
} }
if (eregi("YES",$include_rollover)) if (preg_match("/YES/i",$include_rollover))
{ {
if (strlen($statusSQL) < 2) if (strlen($statusSQL) < 2)
{$statusSQL = "''";} {$statusSQL = "''";}
else else
{ {
$statusSQL = eregi_replace(",$",'',$statusSQL); $statusSQL = preg_replace('/,$/i', '',$statusSQL);
} }
$stmt="select distinct status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN($statusSQL) $group_drop_SQLand;"; $stmt="select distinct status from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status NOT IN($statusSQL) $group_drop_SQLand;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -958,7 +959,7 @@ else
$RAWstatus = $RAWstatusARY[$i]; $RAWstatus = $RAWstatusARY[$i];
$RAWhours = $RAWhoursARY[$i]; $RAWhours = $RAWhoursARY[$i];
if (eregi("YES",$include_rollover)) if (preg_match("/YES/i",$include_rollover))
{ {
$stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status='$RAWstatus' $group_drop_SQLand;"; $stmt="select count(*),sum(length_in_sec) from vicidial_closer_log where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and status='$RAWstatus' $group_drop_SQLand;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -1415,7 +1416,7 @@ else
{ {
$full_name = sprintf("%-45s", $RAWfull_name[$i]); while(mb_strlen($full_name,'utf-8')>15) {$full_name = mb_substr("$full_name", 0, -1,'utf-8');} $full_name = sprintf("%-45s", $RAWfull_name[$i]); while(mb_strlen($full_name,'utf-8')>15) {$full_name = mb_substr("$full_name", 0, -1,'utf-8');}
} }
if (eregi("YES",$include_rollover)) if (preg_match("/YES/i",$include_rollover))
{ {
$length_in_secZ=0; $length_in_secZ=0;
$queue_secondsZ=0; $queue_secondsZ=0;
@@ -1550,7 +1551,7 @@ else
$tempTALK = ($tempTALK + $row[2]); $tempTALK = ($tempTALK + $row[2]);
$w++; $w++;
} }
if (eregi("YES",$include_rollover)) if (preg_match("/YES/i",$include_rollover))
{ {
$stmt="select campaign_id,phone_number,length_in_sec,queue_seconds,agent_alert_delay from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id $group_drop_SQLand;"; $stmt="select campaign_id,phone_number,length_in_sec,queue_seconds,agent_alert_delay from vicidial_closer_log,vicidial_inbound_groups where call_date >= '$query_date_BEGIN' and call_date <= '$query_date_END' and group_id=campaign_id $group_drop_SQLand;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -17,6 +17,7 @@
# 120210-1218 - Added vendor_lead_code to output # 120210-1218 - Added vendor_lead_code to output
# 120221-0059 - Added User Group restriction settings # 120221-0059 - Added User Group restriction settings
# 130414-0159 - Added report logging # 130414-0159 - Added report logging
# 130610-0955 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -37,8 +38,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_campaigns='1';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and modify_campaigns='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -100,7 +101,7 @@ $LOGadmin_viewable_call_times = $row[3];
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -8,6 +8,7 @@
# CHANGES # CHANGES
# 100320-2102 - First Build # 100320-2102 - First Build
# 130414-0222 - Added report logging # 130414-0222 - Added report logging
# 130610-0954 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -28,8 +29,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -1,11 +1,13 @@
<?php <?php
# AST_admin_template_maker.php - version 2.4 # AST_admin_template_maker.php - version 2.4
# #
# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
# #
# CHANGES # CHANGES
# 120402-2132 - First Build # 120402-2132 - First Build
# 120529-1427 - Filename filter fix # 120529-1427 - Filename filter fix
# 130514-2127 - Bug fix on Chrome/IE browsers
# 130610-1102 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -81,14 +83,14 @@ if ($qm_conf_ct > 0)
if ($non_latin < 1) if ($non_latin < 1)
{ {
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$list_id_override = ereg_replace("[^0-9]","",$list_id_override); $list_id_override = preg_replace('/[^0-9]/','',$list_id_override);
} }
else else
{ {
$PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW);
$PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
} }
$STARTtime = date("U"); $STARTtime = date("U");
@@ -166,7 +168,7 @@ $LOGadmin_viewable_call_times = $row[3];
$camp_lists=''; $camp_lists='';
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if (!eregi("-ALL",$LOGallowed_campaigns)) if (!preg_match('/\-ALL/i', $LOGallowed_campaigns))
{ {
echo "<BR/>**$LOGallowed_campaigns**"; echo "<BR/>**$LOGallowed_campaigns**";
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
@@ -180,10 +182,10 @@ $regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
$script_name = getenv("SCRIPT_NAME"); $script_name = getenv("SCRIPT_NAME");
$server_name = getenv("SERVER_NAME"); $server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT"); $server_port = getenv("SERVER_PORT");
if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';} else {$HTTPprotocol = 'http://';}
$admDIR = "$HTTPprotocol$server_name$script_name"; $admDIR = "$HTTPprotocol$server_name$script_name";
$admDIR = eregi_replace('AST_admin_template_maker.php','',$admDIR); $admDIR = preg_replace('/AST_admin_template_maker\.php/i', '',$admDIR);
$admDIR = "/vicidial/"; $admDIR = "/vicidial/";
$admSCR = 'admin.php'; $admSCR = 'admin.php';
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; $NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
@@ -293,7 +295,7 @@ function macfontfix($fontsize)
{ {
$browser = getenv("HTTP_USER_AGENT"); $browser = getenv("HTTP_USER_AGENT");
$pctype = explode("(", $browser); $pctype = explode("(", $browser);
if (ereg("Mac",$pctype[1])) if (preg_match('/Mac/',$pctype[1]))
{ {
/* Browser is a Mac. If not Netscape 6, raise fonts */ /* Browser is a Mac. If not Netscape 6, raise fonts */
$blownbrowser = explode('/', $browser); $blownbrowser = explode('/', $browser);
@@ -17,6 +17,7 @@
# 111104-1302 - Added user_group restrictions for selecting in-groups # 111104-1302 - Added user_group restrictions for selecting in-groups
# 120224-0910 - Added HTML display option with bar graphs # 120224-0910 - Added HTML display option with bar graphs
# 130414-0143 - Added report logging # 130414-0143 - Added report logging
# 130610-1037 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -73,8 +74,8 @@ if ($qm_conf_ct > 0)
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -151,7 +152,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -163,7 +164,7 @@ $regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$vuLOGadmin_viewable_groupsSQL=''; $vuLOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -174,7 +175,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -208,7 +209,7 @@ while ($i < $campaigns_to_print)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$groups[$i] =$row[0]; $groups[$i] =$row[0];
if (ereg("-ALL",$group_string) ) if (preg_match('/\-ALL/',$group_string) )
{$group[$i] = $groups[$i];} {$group[$i] = $groups[$i];}
$i++; $i++;
} }
@@ -226,11 +227,11 @@ while($i < $group_ct)
} }
$i++; $i++;
} }
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$group_string) ) or ($group_ct < 1) )
{$group_SQL = "";} {$group_SQL = "";}
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
$group_SQL = "and campaign_id IN($group_SQL)"; $group_SQL = "and campaign_id IN($group_SQL)";
} }
@@ -372,7 +373,7 @@ else
$date[$i] = $row[0]; $date[$i] = $row[0];
$calls[$i] = $row[1]; $calls[$i] = $row[1];
$status[$i] = $row[2]; $status[$i] = $row[2];
if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) ) if ( (!preg_match("/\-$status[$i]\-/i", $statuses)) and (strlen($status[$i])>0) )
{ {
$statusesTXT = sprintf("%8s", $status[$i]); $statusesTXT = sprintf("%8s", $status[$i]);
$statusesHEAD .= "----------+"; $statusesHEAD .= "----------+";
@@ -382,7 +383,7 @@ else
$statusesARY[$j] = $status[$i]; $statusesARY[$j] = $status[$i];
$j++; $j++;
} }
if (!eregi("-$date[$i]-", $dates)) if (!preg_match("/\-$date[$i]\-/i", $dates))
{ {
$dates .= "$date[$i]-"; $dates .= "$date[$i]-";
$datesARY[$k] = $date[$i]; $datesARY[$k] = $date[$i];
@@ -450,16 +451,16 @@ else
$i=0; $status_found=0; $i=0; $status_found=0;
while ($i < $rows_to_print) while ($i < $rows_to_print)
{ {
# if ( (eregi("$date[$i]", $Sdate)) and ($Sstatus=="$status[$i]") ) # if ( (preg_match("/$date[$i]/i", $Sdate)) and ($Sstatus=="$status[$i]") )
if ( ($Sdate=="$date[$i]") and ($Sstatus=="$status[$i]") ) if ( ($Sdate=="$date[$i]") and ($Sstatus=="$status[$i]") )
{ {
$Scalls = ($Scalls + $calls[$i]); $Scalls = ($Scalls + $calls[$i]);
if (eregi("\|$status[$i]\|",$customer_interactive_statuses)) if (preg_match("/\|$status[$i]\|/i",$customer_interactive_statuses))
{ {
$CIScount = ($CIScount + $calls[$i]); $CIScount = ($CIScount + $calls[$i]);
$CIScountTOT = ($CIScountTOT + $calls[$i]); $CIScountTOT = ($CIScountTOT + $calls[$i]);
} }
if (eregi("DNC", $status[$i])) if (preg_match("/DNC/i", $status[$i]))
{ {
$DNCcount = ($DNCcount + $calls[$i]); $DNCcount = ($DNCcount + $calls[$i]);
$DNCcountTOT = ($DNCcountTOT + $calls[$i]); $DNCcountTOT = ($DNCcountTOT + $calls[$i]);
@@ -552,7 +553,7 @@ else
$TOPsort[$m] = '' . sprintf("%08s", $RAWdncPCT) . '-----' . $m . '-----' . sprintf("%020s", $RAWdate); $TOPsort[$m] = '' . sprintf("%08s", $RAWdncPCT) . '-----' . $m . '-----' . sprintf("%020s", $RAWdate);
$TOPsortTALLY[$m]=$RAWdncPCT; $TOPsortTALLY[$m]=$RAWdncPCT;
} }
if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) if (!preg_match('/ID|TIME|LEADS|CI|DNCCI/',$stage))
{ {
if ($file_download < 1) if ($file_download < 1)
{$ASCII_text.="$Toutput";} {$ASCII_text.="$Toutput";}
@@ -570,11 +571,11 @@ else
### BEGIN sort through output to display properly ### ### BEGIN sort through output to display properly ###
if (ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) if (preg_match('/ID|TIME|LEADS|CI|DNCCI/',$stage))
{ {
if (ereg("ID",$stage)) if (preg_match('/ID/',$stage))
{sort($TOPsort, SORT_NUMERIC);} {sort($TOPsort, SORT_NUMERIC);}
if (ereg("TIME|LEADS|CI|DNCCI",$stage)) if (preg_match('/TIME|LEADS|CI|DNCCI/',$stage))
{rsort($TOPsort, SORT_NUMERIC);} {rsort($TOPsort, SORT_NUMERIC);}
$m=0; $m=0;
@@ -811,14 +812,14 @@ o_cal.a_tpl.yearscroll = false;
echo "</TD><TD VALIGN=TOP> Campaigns:<BR>"; echo "</TD><TD VALIGN=TOP> Campaigns:<BR>";
echo "<SELECT SIZE=5 NAME=group[] multiple>\n"; echo "<SELECT SIZE=5 NAME=group[] multiple>\n";
if (eregi("--ALL--",$group_string)) if (preg_match('/\-\-ALL\-\-/',$group_string))
{echo "<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";} {echo "<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";}
else else
{echo "<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";} {echo "<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";}
$o=0; $o=0;
while ($campaigns_to_print > $o) while ($campaigns_to_print > $o)
{ {
if (eregi("$groups[$o]\|",$group_string)) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";} if (preg_match("/$groups[$o]\|/i",$group_string)) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";} else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
$o++; $o++;
} }
@@ -3,12 +3,13 @@
# #
# Date Range - Agent/Campaign Disposition (Perfect Network Corporation) # Date Range - Agent/Campaign Disposition (Perfect Network Corporation)
# #
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# CHANGES # CHANGES
# #
# 70201-1213 - First build - from Marin Blu # 70201-1213 - First build - from Marin Blu
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 130610-1136 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -27,8 +28,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6;";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -1,7 +1,7 @@
<?php <?php
# AST_agent_performance.php # AST_agent_performance.php
# #
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# CHANGES # CHANGES
# #
@@ -9,6 +9,7 @@
# - Added required user/pass to gain access to this page # - Added required user/pass to gain access to this page
# 70201-1203 - Added non_latin UTF8 output code, widened USER ID to 8 chars # 70201-1203 - Added non_latin UTF8 output code, widened USER ID to 8 chars
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 130610-1135 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -27,8 +28,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -32,6 +32,7 @@
# 120224-0910 - Added HTML display option with bar graphs # 120224-0910 - Added HTML display option with bar graphs
# 121130-0952 - Fix for user group permissions issue #588 # 121130-0952 - Fix for user group permissions issue #588
# 130414-0140 - Added report logging # 130414-0140 - Added report logging
# 130610-1031 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -90,8 +91,8 @@ if ($qm_conf_ct > 0)
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
if ($DB) {$HTML_text.="|$stmt|\n";} if ($DB) {$HTML_text.="|$stmt|\n";}
@@ -168,7 +169,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -179,7 +180,7 @@ $regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -189,7 +190,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -224,13 +225,13 @@ while ($i < $campaigns_to_print)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$groups[$i] =$row[0]; $groups[$i] =$row[0];
if (ereg("-ALL",$group_string) ) if (preg_match('/\-ALL/',$group_string) )
{$group[$i] = $groups[$i];} {$group[$i] = $groups[$i];}
$i++; $i++;
} }
for ($i=0; $i<count($user_group); $i++) for ($i=0; $i<count($user_group); $i++)
{ {
if (eregi("--ALL--", $user_group[$i])) {$all_user_groups=1; $user_group="";} if (preg_match('/\-\-ALL\-\-/', $user_group[$i])) {$all_user_groups=1; $user_group="";}
} }
$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;";
@@ -259,11 +260,11 @@ while($i < $group_ct)
} }
$i++; $i++;
} }
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$group_string) ) or ($group_ct < 1) )
{$group_SQL = "";} {$group_SQL = "";}
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
$group_SQL = "and campaign_id IN($group_SQL)"; $group_SQL = "and campaign_id IN($group_SQL)";
} }
@@ -277,11 +278,11 @@ while($i < $user_group_ct)
$user_groupQS .= "&user_group[]=$user_group[$i]"; $user_groupQS .= "&user_group[]=$user_group[$i]";
$i++; $i++;
} }
if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$user_group_string) ) or ($user_group_ct < 1) )
{$user_group_SQL = "";} {$user_group_SQL = "";}
else else
{ {
$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = preg_replace('/,$/i', '',$user_group_SQL);
$user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)";
} }
@@ -352,14 +353,14 @@ $HTML_text.="</script>\n";
$HTML_text.="</TD><TD VALIGN=TOP> Campaigns:<BR>"; $HTML_text.="</TD><TD VALIGN=TOP> Campaigns:<BR>";
$HTML_text.="<SELECT SIZE=5 NAME=group[] multiple>\n"; $HTML_text.="<SELECT SIZE=5 NAME=group[] multiple>\n";
if (eregi("--ALL--",$group_string)) if (preg_match('/\-\-ALL\-\-/',$group_string))
{$HTML_text.="<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";} {$HTML_text.="<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";}
else else
{$HTML_text.="<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";} {$HTML_text.="<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";}
$o=0; $o=0;
while ($campaigns_to_print > $o) while ($campaigns_to_print > $o)
{ {
if (eregi("$groups[$o]\|",$group_string)) {$HTML_text.="<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";} if (preg_match("/$groups[$o]\|/i",$group_string)) {$HTML_text.="<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
else {$HTML_text.="<option value=\"$groups[$o]\">$groups[$o]</option>\n";} else {$HTML_text.="<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
$o++; $o++;
} }
@@ -367,14 +368,14 @@ $HTML_text.="</SELECT>\n";
$HTML_text.="</TD><TD VALIGN=TOP>User Groups:<BR>"; $HTML_text.="</TD><TD VALIGN=TOP>User Groups:<BR>";
$HTML_text.="<SELECT SIZE=5 NAME=user_group[] multiple>\n"; $HTML_text.="<SELECT SIZE=5 NAME=user_group[] multiple>\n";
if (eregi("--ALL--",$user_group_string)) if (preg_match('/\-\-ALL\-\-/',$user_group_string))
{$HTML_text.="<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";} {$HTML_text.="<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";}
else else
{$HTML_text.="<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";} {$HTML_text.="<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";}
$o=0; $o=0;
while ($user_groups_to_print > $o) while ($user_groups_to_print > $o)
{ {
if (eregi("$user_groups[$o]\|",$user_group_string)) {$HTML_text.="<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";} if (preg_match("/$user_groups[$o]\|/i",$user_group_string)) {$HTML_text.="<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
else {$HTML_text.="<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";} else {$HTML_text.="<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
$o++; $o++;
} }
@@ -522,7 +523,7 @@ while ($i < $rows_to_print)
if ($customer_sec[$i] < 1) if ($customer_sec[$i] < 1)
{$customer_sec[$i]=0;} {$customer_sec[$i]=0;}
if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) ) if ( (!preg_match("/\-$status[$i]\-/i", $statuses)) and (strlen($status[$i])>0) )
{ {
$statusesTXT = sprintf("%8s", $status[$i]); $statusesTXT = sprintf("%8s", $status[$i]);
$statusesHEAD .= "----------+"; $statusesHEAD .= "----------+";
@@ -534,7 +535,7 @@ while ($i < $rows_to_print)
$statusesARY[$j] = $status[$i]; $statusesARY[$j] = $status[$i];
$j++; $j++;
} }
if (!eregi("-$user[$i]-", $users)) if (!preg_match("/\-$user[$i]\-/i", $users))
{ {
$users .= "$user[$i]-"; $users .= "$user[$i]-";
$usersARY[$k] = $user[$i]; $usersARY[$k] = $user[$i];
@@ -723,7 +724,7 @@ while ($m < $k)
$CSV_lines.="\"$Sfull_nameRAW\","; $CSV_lines.="\"$Sfull_nameRAW\",";
$CSV_lines.=eregi_replace(" ", "", "\"$SuserRAW\",\"$Scalls\",\"$pfUSERtime_MS\",\"$pfUSERtotPAUSE_MS\",\"$pfUSERavgPAUSE_MS\",\"$pfUSERtotWAIT_MS\",\"$pfUSERavgWAIT_MS\",\"$pfUSERtotTALK_MS\",\"$pfUSERavgTALK_MS\",\"$pfUSERtotDISPO_MS\",\"$pfUSERavgDISPO_MS\",\"$pfUSERtotDEAD_MS\",\"$pfUSERavgDEAD_MS\",\"$pfUSERtotCUSTOMER_MS\",\"$pfUSERavgCUSTOMER_MS\"$CSVstatuses\n"); $CSV_lines.=preg_replace('/\s/', '', "\"$SuserRAW\",\"$Scalls\",\"$pfUSERtime_MS\",\"$pfUSERtotPAUSE_MS\",\"$pfUSERavgPAUSE_MS\",\"$pfUSERtotWAIT_MS\",\"$pfUSERavgWAIT_MS\",\"$pfUSERtotTALK_MS\",\"$pfUSERavgTALK_MS\",\"$pfUSERtotDISPO_MS\",\"$pfUSERavgDISPO_MS\",\"$pfUSERtotDEAD_MS\",\"$pfUSERavgDEAD_MS\",\"$pfUSERtotCUSTOMER_MS\",\"$pfUSERavgCUSTOMER_MS\"$CSVstatuses\n");
$TOPsorted_output[$m] = $Toutput; $TOPsorted_output[$m] = $Toutput;
@@ -733,7 +734,7 @@ while ($m < $k)
{$TOPsort[$m] = '' . sprintf("%08s", $RAWcalls) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);} {$TOPsort[$m] = '' . sprintf("%08s", $RAWcalls) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);}
if ($stage == 'TIME') if ($stage == 'TIME')
{$TOPsort[$m] = '' . sprintf("%08s", $Stime) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);} {$TOPsort[$m] = '' . sprintf("%08s", $Stime) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);}
if (!ereg("ID|TIME|LEADS",$stage)) if (!preg_match('/ID|TIME|LEADS/',$stage))
{$ASCII_text.="$Toutput";} {$ASCII_text.="$Toutput";}
$m++; $m++;
@@ -743,11 +744,11 @@ while ($m < $k)
### BEGIN sort through output to display properly ### ### BEGIN sort through output to display properly ###
if (ereg("ID|TIME|LEADS",$stage)) if (preg_match('/ID|TIME|LEADS/',$stage))
{ {
if (ereg("ID",$stage)) if (preg_match('/ID/',$stage))
{sort($TOPsort, SORT_NUMERIC);} {sort($TOPsort, SORT_NUMERIC);}
if (ereg("TIME|LEADS",$stage)) if (preg_match('/TIME|LEADS/',$stage))
{rsort($TOPsort, SORT_NUMERIC);} {rsort($TOPsort, SORT_NUMERIC);}
$m=0; $m=0;
@@ -963,7 +964,7 @@ $GRAPH3="<tr><td colspan='".(14+count($statusesARY))."' class='graph_span_cell'>
$GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3; $GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3;
$CSV_total=eregi_replace(" ", "", "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses"); $CSV_total=preg_replace('/\s/', '', "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTcalls\",\"$TOTtime_MS\",\"$TOTtotPAUSE_MS\",\"$TOTavgPAUSE_MS\",\"$TOTtotWAIT_MS\",\"$TOTavgWAIT_MS\",\"$TOTtotTALK_MS\",\"$TOTavgTALK_MS\",\"$TOTtotDISPO_MS\",\"$TOTavgDISPO_MS\",\"$TOTtotDEAD_MS\",\"$TOTavgDEAD_MS\",\"$TOTtotCUSTOMER_MS\",\"$TOTavgCUSTOMER_MS\"$CSVSUMstatuses");
if ($file_download == 1) if ($file_download == 1)
{ {
@@ -1056,8 +1057,8 @@ while ($i < $subs_to_print)
$$max_varname=1; $$max_varname=1;
# echo "$sub_status[$i]|$PCpause_sec[$i]\n"; # echo "$sub_status[$i]|$PCpause_sec[$i]\n";
# if ( (!eregi("-$sub_status[$i]-", $sub_statuses)) and (strlen($sub_status[$i])>0) ) # if ( (!preg_match("/\-$sub_status[$i]\-/i", $sub_statuses)) and (strlen($sub_status[$i])>0) )
if (!eregi("-$sub_status[$i]-", $sub_statuses)) if (!preg_match("/\-$sub_status[$i]\-/i", $sub_statuses))
{ {
$sub_statusesTXT = sprintf("%8s", $sub_status[$i]); $sub_statusesTXT = sprintf("%8s", $sub_status[$i]);
$sub_statusesHEAD .= "----------+"; $sub_statusesHEAD .= "----------+";
@@ -1067,7 +1068,7 @@ while ($i < $subs_to_print)
$CSV_statuses.=",\"$sub_status[$i]\""; $CSV_statuses.=",\"$sub_status[$i]\"";
$j++; $j++;
} }
if (!eregi("-$PCuser[$i]-", $PCusers)) if (!preg_match("/\-$PCuser[$i]\-/i", $PCusers))
{ {
$PCusers .= "$PCuser[$i]-"; $PCusers .= "$PCuser[$i]-";
$PCusersARY[$k] = $PCuser[$i]; $PCusersARY[$k] = $PCuser[$i];
@@ -1198,7 +1199,7 @@ while ($m < $k)
$BOTTOMsorted_output[$m] = $BOTTOMoutput; $BOTTOMsorted_output[$m] = $BOTTOMoutput;
$ASCII_text.="$BOTTOMoutput"; $ASCII_text.="$BOTTOMoutput";
$CSV_lines.="\"$Sfull_nameRAW\"".eregi_replace(" ", "", ",\"$SuserRAW\",\"$pfUSERtotTOTAL_MS\",\"$pfUSERtotNONPAUSE_MS\",\"$pfUSERtotPAUSE_MS\",$CSV_statuses\n"); $CSV_lines.="\"$Sfull_nameRAW\"".preg_replace('/\s/', '', ",\"$SuserRAW\",\"$pfUSERtotTOTAL_MS\",\"$pfUSERtotNONPAUSE_MS\",\"$pfUSERtotPAUSE_MS\",$CSV_statuses\n");
$m++; $m++;
} }
### END loop through each user ### ### END loop through each user ###
@@ -1206,7 +1207,7 @@ while ($m < $k)
### BEGIN sort through output to display properly ### ### BEGIN sort through output to display properly ###
#if (ereg("ID|TIME|LEADS",$stage)) #if (preg_match('/ID|TIME|LEADS/',$stage))
# { # {
# $n=0; # $n=0;
# while ($n <= $m) # while ($n <= $m)
@@ -1347,7 +1348,7 @@ $GRAPH_text.=$JS_text.$GRAPH.$GRAPH2.$GRAPH3.$max;
$CSV_total=eregi_replace(" ", "", "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTtotTOTAL_MS\",\"$TOTtotNONPAUSE_MS\",\"$TOTtotPAUSE_MS\",$CSVSUMstatuses"); $CSV_total=preg_replace('/\s/', '', "\"TOTALS\",\"AGENTS:$TOT_AGENTS\",\"$TOTtotTOTAL_MS\",\"$TOTtotNONPAUSE_MS\",\"$TOTtotPAUSE_MS\",$CSVSUMstatuses");
if ($file_download == 2) if ($file_download == 2)
{ {
@@ -19,6 +19,7 @@
# 120224-0910 - Added HTML display option with bar graphs # 120224-0910 - Added HTML display option with bar graphs
# 121130-0958 - Fix for user group permissions issue #588 # 121130-0958 - Fix for user group permissions issue #588
# 130414-0139 - Added report logging # 130414-0139 - Added report logging
# 130610-1029 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -75,8 +76,8 @@ if ($qm_conf_ct > 0)
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -153,7 +154,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -164,7 +165,7 @@ $regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -174,7 +175,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -209,14 +210,14 @@ while ($i < $campaigns_to_print)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$groups[$i] =$row[0]; $groups[$i] =$row[0];
if (ereg("-ALL",$group_string) ) if (preg_match('/\-ALL/',$group_string) )
{$group[$i] = $groups[$i];} {$group[$i] = $groups[$i];}
$i++; $i++;
} }
for ($i=0; $i<count($user_group); $i++) for ($i=0; $i<count($user_group); $i++)
{ {
if (eregi("--ALL--", $user_group[$i])) {$all_user_groups=1; $user_group="";} if (preg_match('/\-\-ALL\-\-/', $user_group[$i])) {$all_user_groups=1; $user_group="";}
} }
$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -244,11 +245,11 @@ while($i < $group_ct)
} }
$i++; $i++;
} }
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$group_string) ) or ($group_ct < 1) )
{$group_SQL = "";} {$group_SQL = "";}
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
$group_SQL = "and campaign_id IN($group_SQL)"; $group_SQL = "and campaign_id IN($group_SQL)";
} }
@@ -262,11 +263,11 @@ while($i < $user_group_ct)
$user_groupQS .= "&user_group[]=$user_group[$i]"; $user_groupQS .= "&user_group[]=$user_group[$i]";
$i++; $i++;
} }
if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$user_group_string) ) or ($user_group_ct < 1) )
{$user_group_SQL = "";} {$user_group_SQL = "";}
else else
{ {
$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = preg_replace('/,$/i', '',$user_group_SQL);
$user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)";
} }
@@ -419,13 +420,13 @@ else
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if ( ($row[0] > 0) and (strlen($row[3]) > 0) and (!eregi("NULL",$row[3]))) if ( ($row[0] > 0) and (strlen($row[3]) > 0) and (!preg_match("/NULL/i",$row[3])))
{ {
$calls[$i] = $row[0]; $calls[$i] = $row[0];
$full_name[$i] = $row[1]; $full_name[$i] = $row[1];
$user[$i] = $row[2]; $user[$i] = $row[2];
$status[$i] = $row[3]; $status[$i] = $row[3];
if ( (!eregi("-$status[$i]-", $statuses)) and (strlen($status[$i])>0) ) if ( (!preg_match("/-$status[$i]-/i", $statuses)) and (strlen($status[$i])>0) )
{ {
$statusesTXT = sprintf("%8s", $status[$i]); $statusesTXT = sprintf("%8s", $status[$i]);
$statusesHEAD .= "----------+"; $statusesHEAD .= "----------+";
@@ -441,7 +442,7 @@ else
$j++; $j++;
} }
if (!eregi("-$user[$i]-", $users)) if (!preg_match("/\-$user[$i]\-/i", $users))
{ {
$users .= "$user[$i]-"; $users .= "$user[$i]-";
$usersARY[$k] = $user[$i]; $usersARY[$k] = $user[$i];
@@ -515,12 +516,12 @@ else
if ( ($Suser=="$user[$i]") and ($Sstatus=="$status[$i]") ) if ( ($Suser=="$user[$i]") and ($Sstatus=="$status[$i]") )
{ {
$Scalls = ($Scalls + $calls[$i]); $Scalls = ($Scalls + $calls[$i]);
if (eregi("\|$status[$i]\|",$customer_interactive_statuses)) if (preg_match("/\|$status[$i]\|/i",$customer_interactive_statuses))
{ {
$CIScount = ($CIScount + $calls[$i]); $CIScount = ($CIScount + $calls[$i]);
$CIScountTOT = ($CIScountTOT + $calls[$i]); $CIScountTOT = ($CIScountTOT + $calls[$i]);
} }
if (eregi("DNC", $status[$i])) if (preg_match("/DNC/i", $status[$i]))
{ {
$DNCcount = ($DNCcount + $calls[$i]); $DNCcount = ($DNCcount + $calls[$i]);
$DNCcountTOT = ($DNCcountTOT + $calls[$i]); $DNCcountTOT = ($DNCcountTOT + $calls[$i]);
@@ -628,7 +629,7 @@ else
$TOPsort[$m] = '' . sprintf("%08s", $RAWdncPCT) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser); $TOPsort[$m] = '' . sprintf("%08s", $RAWdncPCT) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
$TOPsortTALLY[$m]=$RAWdncPCT; $TOPsortTALLY[$m]=$RAWdncPCT;
} }
if (!ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) if (!preg_match('/ID|TIME|LEADS|CI|DNCCI/',$stage))
if ($file_download < 1) if ($file_download < 1)
{$ASCII_text.="$Toutput";} {$ASCII_text.="$Toutput";}
else else
@@ -644,11 +645,11 @@ else
### BEGIN sort through output to display properly ### ### BEGIN sort through output to display properly ###
if (ereg("ID|TIME|LEADS|CI|DNCCI",$stage)) if (preg_match('/ID|TIME|LEADS|CI|DNCCI/',$stage))
{ {
if (ereg("ID",$stage)) if (preg_match('/ID/',$stage))
{sort($TOPsort, SORT_NUMERIC);} {sort($TOPsort, SORT_NUMERIC);}
if (ereg("TIME|LEADS|CI|DNCCI",$stage)) if (preg_match('/TIME|LEADS|CI|DNCCI/',$stage))
{rsort($TOPsort, SORT_NUMERIC);} {rsort($TOPsort, SORT_NUMERIC);}
$m=0; $m=0;
@@ -891,14 +892,14 @@ o_cal.a_tpl.yearscroll = false;
echo "</TD><TD VALIGN=TOP> Campaigns:<BR>"; echo "</TD><TD VALIGN=TOP> Campaigns:<BR>";
echo "<SELECT SIZE=5 NAME=group[] multiple>\n"; echo "<SELECT SIZE=5 NAME=group[] multiple>\n";
if (eregi("--ALL--",$group_string)) if (preg_match('/\-\-ALL\-\-/',$group_string))
{echo "<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";} {echo "<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";}
else else
{echo "<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";} {echo "<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";}
$o=0; $o=0;
while ($campaigns_to_print > $o) while ($campaigns_to_print > $o)
{ {
if (eregi("$groups[$o]\|",$group_string)) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";} if (preg_match("/$groups[$o]\|/i",$group_string)) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";} else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
$o++; $o++;
} }
@@ -906,14 +907,14 @@ echo "</SELECT>\n";
echo "</TD><TD VALIGN=TOP>User Groups:<BR>"; echo "</TD><TD VALIGN=TOP>User Groups:<BR>";
echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n"; echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n";
if (eregi("--ALL--",$user_group_string)) if (preg_match('/\-\-ALL\-\-/',$user_group_string))
{echo "<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";} {echo "<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";}
else else
{echo "<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";} {echo "<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";}
$o=0; $o=0;
while ($user_groups_to_print > $o) while ($user_groups_to_print > $o)
{ {
if (eregi("$user_groups[$o]\|",$user_group_string)) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";} if (preg_match("/$user_groups[$o]\|/i",$user_group_string)) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
else {echo "<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";} else {echo "<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
$o++; $o++;
} }
@@ -26,6 +26,7 @@
# 121130-0957 - Fix for user group permissions issue #588 # 121130-0957 - Fix for user group permissions issue #588
# 130414-0137 - Added report logging # 130414-0137 - Added report logging
# 220414-2111 - Added counts on parked(hold) calls # 220414-2111 - Added counts on parked(hold) calls
# 130610-0849 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -101,8 +102,8 @@ if ($qm_conf_ct > 0)
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -179,7 +180,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -190,7 +191,7 @@ $regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -200,7 +201,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -236,7 +237,7 @@ while ($i < $campaigns_to_print)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$groups[$i] =$row[0]; $groups[$i] =$row[0];
if (ereg("-ALL",$group_string) ) if (preg_match('/\-ALL/',$group_string) )
{$group[$i] = $groups[$i];} {$group[$i] = $groups[$i];}
$i++; $i++;
} }
@@ -254,18 +255,18 @@ while($i < $group_ct)
} }
$i++; $i++;
} }
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$group_string) ) or ($group_ct < 1) )
{$group_SQL = ""; $park_log_SQL = "";} {$group_SQL = ""; $park_log_SQL = "";}
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
$park_log_SQL = "and channel_group in ($group_SQL)"; $park_log_SQL = "and channel_group in ($group_SQL)";
$group_SQL = "and campaign_id IN($group_SQL)"; $group_SQL = "and campaign_id IN($group_SQL)";
} }
for ($i=0; $i<count($user_group); $i++) for ($i=0; $i<count($user_group); $i++)
{ {
if (eregi("--ALL--", $user_group[$i])) {$all_user_groups=1; $user_group="";} if (preg_match('/\-\-ALL\-\-/', $user_group[$i])) {$all_user_groups=1; $user_group="";}
} }
$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -290,11 +291,11 @@ while($i < $user_group_ct)
$user_groupQS .= "&user_group[]=$user_group[$i]"; $user_groupQS .= "&user_group[]=$user_group[$i]";
$i++; $i++;
} }
if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$user_group_string) ) or ($user_group_ct < 1) )
{$user_group_SQL = "";} {$user_group_SQL = "";}
else else
{ {
$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = preg_replace('/,$/i', '',$user_group_SQL);
$TCuser_group_SQL = $user_group_SQL; $TCuser_group_SQL = $user_group_SQL;
$user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)";
$TCuser_group_SQL = "and user_group IN($TCuser_group_SQL)"; $TCuser_group_SQL = "and user_group IN($TCuser_group_SQL)";
@@ -515,7 +516,7 @@ else
$PCpause_sec[$i] = $row[1]; $PCpause_sec[$i] = $row[1];
$sub_status[$i] = $row[2]; $sub_status[$i] = $row[2];
if (!eregi("-$sub_status[$i]-", $sub_statuses)) if (!preg_match("/\-$sub_status[$i]\-/i", $sub_statuses))
{ {
$sub_statusesTXT = sprintf("%10s", $sub_status[$i]); $sub_statusesTXT = sprintf("%10s", $sub_status[$i]);
$sub_statusesHEAD .= "------------+"; $sub_statusesHEAD .= "------------+";
@@ -528,7 +529,7 @@ else
$max_varname="max_".$sub_status[$i]; $max_varname="max_".$sub_status[$i];
$$max_varname=1; $$max_varname=1;
} }
if (!eregi("-$PCuser[$i]-", $PCusers)) if (!preg_match("/\-$PCuser[$i]\-/i", $PCusers))
{ {
$PCusers .= "$PCuser[$i]-"; $PCusers .= "$PCuser[$i]-";
$PCusersARY[$user_count] = $PCuser[$i]; $PCusersARY[$user_count] = $PCuser[$i];
@@ -575,7 +576,7 @@ else
$TOTdead = ($TOTdead + $dead); $TOTdead = ($TOTdead + $dead);
$TOTcustomer = ($TOTcustomer + $customer); $TOTcustomer = ($TOTcustomer + $customer);
$TOTALtime = ($TOTALtime + $pause + $dispo + $talk + $wait); $TOTALtime = ($TOTALtime + $pause + $dispo + $talk + $wait);
if ( ($lead > 0) and ((!eregi("NULL",$status)) and (strlen($status) > 0)) ) {$TOTcalls++;} if ( ($lead > 0) and ((!preg_match("/NULL/i",$status)) and (strlen($status) > 0)) ) {$TOTcalls++;}
$user_found=0; $user_found=0;
if ($uc < 1) if ($uc < 1)
@@ -596,7 +597,7 @@ else
$Spause[$m] = ($Spause[$m] + $pause); $Spause[$m] = ($Spause[$m] + $pause);
$Sdead[$m] = ($Sdead[$m] + $dead); $Sdead[$m] = ($Sdead[$m] + $dead);
$Scustomer[$m] = ($Scustomer[$m] + $customer); $Scustomer[$m] = ($Scustomer[$m] + $customer);
if ( ($lead > 0) and ((!eregi("NULL",$status)) and (strlen($status) > 0)) ) {$Scalls[$m]++;} if ( ($lead > 0) and ((!preg_match("/NULL/i",$status)) and (strlen($status) > 0)) ) {$Scalls[$m]++;}
} }
$m++; $m++;
} }
@@ -951,7 +952,7 @@ else
$TOPsort[$m] = '' . sprintf("%010s", $RAWtimeTCsec) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser); $TOPsort[$m] = '' . sprintf("%010s", $RAWtimeTCsec) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
$TOPsortTALLY[$m]=$RAWtimeTCsec; $TOPsortTALLY[$m]=$RAWtimeTCsec;
} }
if (!ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) if (!preg_match('/NAME|ID|TIME|LEADS|TCLOCK/',$stage))
if ($file_download < 1) if ($file_download < 1)
{$ASCII_text.="$Toutput";} {$ASCII_text.="$Toutput";}
else else
@@ -973,13 +974,13 @@ else
### BEGIN sort through output to display properly ### ### BEGIN sort through output to display properly ###
if ( ($TOT_AGENTS > 0) and (ereg("NAME|ID|TIME|LEADS|TCLOCK",$stage)) ) if ( ($TOT_AGENTS > 0) and (preg_match('/NAME|ID|TIME|LEADS|TCLOCK/',$stage)) )
{ {
if (ereg("ID",$stage)) if (preg_match('/ID/',$stage))
{sort($TOPsort, SORT_NUMERIC);} {sort($TOPsort, SORT_NUMERIC);}
if (ereg("TIME|LEADS|TCLOCK",$stage)) if (preg_match('/TIME|LEADS|TCLOCK/',$stage))
{rsort($TOPsort, SORT_NUMERIC);} {rsort($TOPsort, SORT_NUMERIC);}
if (ereg("NAME",$stage)) if (preg_match('/NAME/',$stage))
{rsort($TOPsort, SORT_STRING);} {rsort($TOPsort, SORT_STRING);}
$m=0; $m=0;
@@ -1325,14 +1326,14 @@ o_cal.a_tpl.yearscroll = false;
echo "</TD><TD VALIGN=TOP> Campaigns:<BR>"; echo "</TD><TD VALIGN=TOP> Campaigns:<BR>";
echo "<SELECT SIZE=5 NAME=group[] multiple>\n"; echo "<SELECT SIZE=5 NAME=group[] multiple>\n";
if (eregi("--ALL--",$group_string)) if (preg_match('/--ALL--/',$group_string))
{echo "<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";} {echo "<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";}
else else
{echo "<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";} {echo "<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";}
$o=0; $o=0;
while ($campaigns_to_print > $o) while ($campaigns_to_print > $o)
{ {
if (eregi("$groups[$o]\|",$group_string)) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";} if (preg_match("/$groups[$o]\|/i",$group_string)) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";} else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
$o++; $o++;
} }
@@ -1340,14 +1341,14 @@ echo "</SELECT>\n";
echo "</TD><TD VALIGN=TOP>User Groups:<BR>"; echo "</TD><TD VALIGN=TOP>User Groups:<BR>";
echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n"; echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n";
if (eregi("--ALL--",$user_group_string)) if (preg_match('/\-\-ALL\-\-/',$user_group_string))
{echo "<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";} {echo "<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";}
else else
{echo "<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";} {echo "<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";}
$o=0; $o=0;
while ($user_groups_to_print > $o) while ($user_groups_to_print > $o)
{ {
if (eregi("$user_groups[$o]\|",$user_group_string)) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";} if (preg_match("/$user_groups[$o]\|/i",$user_group_string)) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
else {echo "<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";} else {echo "<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
$o++; $o++;
} }
@@ -17,6 +17,7 @@
# 110703-1848 - Added download option # 110703-1848 - Added download option
# 111104-1308 - Added user_group restrictions for selecting in-groups # 111104-1308 - Added user_group restrictions for selecting in-groups
# 130414-0148 - Added report logging # 130414-0148 - Added report logging
# 130610-1028 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -64,8 +65,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
$user=$agent; $user=$agent;
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
if ($DB) {$MAIN.="|$stmt|\n";} if ($DB) {$MAIN.="|$stmt|\n";}
@@ -143,7 +144,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$vuLOGadmin_viewable_groupsSQL=''; $vuLOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -154,7 +155,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -367,7 +368,7 @@ $CSV_text2.="\"\",\"ID\",\"EDIT\",\"EVENT\",\"DATE\",\"IP ADDRESS\",\"GROUP\",\"
$manager_edit=''; $manager_edit='';
if (strlen($row[6])>0) {$manager_edit = ' * ';} if (strlen($row[6])>0) {$manager_edit = ' * ';}
if (ereg("LOGIN", $row[0])) if (preg_match('/LOGIN/', $row[0]))
{ {
$login_sec=''; $login_sec='';
$MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>"; $MAIN.="<tr $bgcolor><td><font size=2><A HREF=\"./timeclock_edit.php?timeclock_id=$row[5]\">$row[5]</A></td>";
@@ -379,7 +380,7 @@ $CSV_text2.="\"\",\"ID\",\"EDIT\",\"EVENT\",\"DATE\",\"IP ADDRESS\",\"GROUP\",\"
$MAIN.="<td align=right><font size=2> </td></tr>\n"; $MAIN.="<td align=right><font size=2> </td></tr>\n";
$CSV_text2.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"\"\n"; $CSV_text2.="\"\",\"$row[5]\",\"$manager_edit\",\"$row[0]\",\"$TC_log_date\",\"$row[4]\",\"$row[2]\",\"\"\n";
} }
if (ereg("LOGOUT", $row[0])) if (preg_match('/LOGOUT/', $row[0]))
{ {
$login_sec = $row[3]; $login_sec = $row[3];
$total_login_time = ($total_login_time + $login_sec); $total_login_time = ($total_login_time + $login_sec);
@@ -9,6 +9,7 @@
# - Added required user/pass to gain access to this page # - Added required user/pass to gain access to this page
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 130414-0156 - Added report logging # 130414-0156 - Added report logging
# 130610-1027 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -31,8 +32,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -14,6 +14,7 @@
# 111104-1315 - Added user_group restrictions for selecting in-groups # 111104-1315 - Added user_group restrictions for selecting in-groups
# 120224-0910 - Added HTML display option with bar graphs # 120224-0910 - Added HTML display option with bar graphs
# 130414-0154 - Added report logging # 130414-0154 - Added report logging
# 130610-1024 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -69,8 +70,8 @@ if ($qm_conf_ct > 0)
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -147,7 +148,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -158,7 +159,7 @@ $regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -168,7 +169,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -183,8 +184,8 @@ $STARTtime = date("U");
if (!isset($group)) {$group = '';} if (!isset($group)) {$group = '';}
if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";} if (!isset($query_date)) {$query_date = "$NOW_DATE 00:00:00";}
if (!isset($end_date)) {$end_date = "$NOW_DATE 23:59:59";} if (!isset($end_date)) {$end_date = "$NOW_DATE 23:59:59";}
$query_dateURL = ereg_replace(' ','+',$query_date); $query_dateURL = preg_replace('/\s/', '+', $query_date);
$end_dateURL = ereg_replace(' ','+',$end_date); $end_dateURL = preg_replace('/\s/', '+', $end_date);
$query_dateARRAY = explode(" ",$query_date); $query_dateARRAY = explode(" ",$query_date);
$query_date_D = $query_dateARRAY[0]; $query_date_D = $query_dateARRAY[0];
@@ -226,11 +227,11 @@ while($i < $group_ct)
$groupQS .= "&group[]=$group[$i]"; $groupQS .= "&group[]=$group[$i]";
$i++; $i++;
} }
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$group_string) ) or ($group_ct < 1) )
{$group_SQL = "";} {$group_SQL = "";}
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
$group_SQL = "and campaign_id IN($group_SQL)"; $group_SQL = "and campaign_id IN($group_SQL)";
} }
@@ -244,14 +245,14 @@ while($i < $user_group_ct)
$user_groupQS .= "&user_group[]=$user_group[$i]"; $user_groupQS .= "&user_group[]=$user_group[$i]";
$i++; $i++;
} }
if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$user_group_string) ) or ($user_group_ct < 1) )
{$user_group_SQL = "";} {$user_group_SQL = "";}
else else
{ {
$TCuser_group_SQL = $user_group_SQL; $TCuser_group_SQL = $user_group_SQL;
$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = preg_replace('/,$/i', '',$user_group_SQL);
$user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)";
$TCuser_group_SQL = eregi_replace(",$",'',$TCuser_group_SQL); $TCuser_group_SQL = preg_replace('/,$/i', '',$TCuser_group_SQL);
$TCuser_group_SQL = "and user_group IN($TCuser_group_SQL)"; $TCuser_group_SQL = "and user_group IN($TCuser_group_SQL)";
} }
@@ -516,14 +517,14 @@ else
} }
if ($TC_results > 0) if ($TC_results > 0)
{$rawTCdetail = ereg_replace(",$",'',$rawTCdetail);} {$rawTCdetail = preg_replace('/,$/','',$rawTCdetail);}
$Stime[$m] = sprintf("%10s", $Stime[$m]); $Stime[$m] = sprintf("%10s", $Stime[$m]);
$SORTname = sprintf("%-20s", $Sname[$m]); $SORTname = sprintf("%-20s", $Sname[$m]);
$SORTgroup = sprintf("%-20s", $Sgroup[$m]); $SORTgroup = sprintf("%-20s", $Sgroup[$m]);
$Sgroup[$m] = sprintf("%-20s", $Sgroup[$m]); $Sgroup[$m] = sprintf("%-20s", $Sgroup[$m]);
$SORTgroup = ereg_replace(" ",'0',$SORTgroup); $SORTgroup = preg_replace('/\s/', '0',$SORTgroup);
$SORTname = ereg_replace(" ",'0',$SORTname); $SORTname = preg_replace('/\s/', '0',$SORTname);
if ($non_latin < 1) if ($non_latin < 1)
{ {
@@ -578,7 +579,7 @@ else
$TOPsort[$m] = '' . sprintf("%020s", $SORTgroup) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser); $TOPsort[$m] = '' . sprintf("%020s", $SORTgroup) . '-----' . $m . '-----' . sprintf("%020s", $RAWuser);
$TOPsortTALLY[$m]=$SORTgroup; $TOPsortTALLY[$m]=$SORTgroup;
} }
if (!ereg("NAME|ID|TCLOCK|GROUP",$stage)) if (!preg_match('/NAME|ID|TCLOCK|GROUP/',$stage))
if ($file_download < 1) if ($file_download < 1)
{ {
$ASCII_text.="$Toutput"; $ASCII_text.="$Toutput";
@@ -608,15 +609,15 @@ else
### BEGIN sort through output to display properly ### ### BEGIN sort through output to display properly ###
if ( (ereg("NAME|ID|TCLOCK|GROUP",$stage)) and ($k > 0) ) if ( (preg_match('/NAME|ID|TCLOCK|GROUP/',$stage)) and ($k > 0) )
{ {
if (ereg("ID",$stage)) if (preg_match('/ID/',$stage))
{sort($TOPsort, SORT_NUMERIC);} {sort($TOPsort, SORT_NUMERIC);}
if (ereg("TCLOCK",$stage)) if (preg_match('/TCLOCK/',$stage))
{rsort($TOPsort, SORT_NUMERIC);} {rsort($TOPsort, SORT_NUMERIC);}
if (ereg("GROUP",$stage)) if (preg_match('/GROUP/',$stage))
{sort($TOPsort, SORT_REGULAR);} {sort($TOPsort, SORT_REGULAR);}
if (ereg("NAME",$stage)) if (preg_match('/NAME/',$stage))
{sort($TOPsort, SORT_STRING);} {sort($TOPsort, SORT_STRING);}
$m=0; $m=0;
@@ -779,14 +780,14 @@ echo " &nbsp; <INPUT TYPE=TEXT NAME=end_date_T SIZE=9 MAXLENGTH=8 VALUE=\"$end_d
# echo "</TD><TD VALIGN=TOP> Campaigns:<BR>"; # echo "</TD><TD VALIGN=TOP> Campaigns:<BR>";
# echo "<SELECT SIZE=5 NAME=group[] multiple>\n"; # echo "<SELECT SIZE=5 NAME=group[] multiple>\n";
# if (eregi("--ALL--",$group_string)) # if (preg_match('/\-\-ALL\-\-/',$group_string))
# {echo "<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";} # {echo "<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";}
# else # else
# {echo "<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";} # {echo "<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";}
# $o=0; # $o=0;
# while ($campaigns_to_print > $o) # while ($campaigns_to_print > $o)
# { # {
# if (eregi("$groups[$o]\|",$group_string)) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";} # if (preg_match("/$groups[$o]\|/i",$group_string)) {echo "<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
# else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";} # else {echo "<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
# $o++; # $o++;
# } # }
@@ -795,14 +796,14 @@ echo " &nbsp; <INPUT TYPE=TEXT NAME=end_date_T SIZE=9 MAXLENGTH=8 VALUE=\"$end_d
echo "</TD><TD VALIGN=TOP>User Groups:<BR>"; echo "</TD><TD VALIGN=TOP>User Groups:<BR>";
echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n"; echo "<SELECT SIZE=5 NAME=user_group[] multiple>\n";
if (eregi("--ALL--",$user_group_string)) if (preg_match('/\-\-ALL\-\-/',$user_group_string))
{echo "<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";} {echo "<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";}
else else
{echo "<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";} {echo "<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";}
$o=0; $o=0;
while ($user_groups_to_print > $o) while ($user_groups_to_print > $o)
{ {
if (eregi("\|$user_groups[$o]\|",$user_group_string)) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";} if (preg_match("/\|$user_groups[$o]\|/i",$user_group_string)) {echo "<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
else {echo "<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";} else {echo "<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
$o++; $o++;
} }
@@ -7,6 +7,7 @@
# 120210-2202 - First build # 120210-2202 - First build
# 130413-2213 - Added SIP codes summary and fields, and report logging # 130413-2213 - Added SIP codes summary and fields, and report logging
# 130418-1048 - Changed how server list is generated # 130418-1048 - Changed how server list is generated
# 130610-0935 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -39,8 +40,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
############################################# #############################################
##### START SYSTEM_SETTINGS LOOKUP ##### ##### START SYSTEM_SETTINGS LOOKUP #####
@@ -135,7 +136,7 @@ while ($i < $servers_to_print)
$row=mysql_fetch_row($server_rslt); $row=mysql_fetch_row($server_rslt);
$LISTserverIPs[$i] = $row[0]; $LISTserverIPs[$i] = $row[0];
$LISTserver_names[$i] = $row[1]; $LISTserver_names[$i] = $row[1];
if (ereg("-ALL",$server_ip_string) ) if (preg_match('/\-ALL/',$server_ip_string) )
{ {
$server_ip[$i] = $LISTserverIPs[$i]; $server_ip[$i] = $LISTserverIPs[$i];
} }
@@ -156,15 +157,15 @@ while($i < $server_ip_ct)
$i++; $i++;
} }
if ( (ereg("--ALL--",$server_ip_string) ) or ($server_ip_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$server_ip_string) ) or ($server_ip_ct < 1) )
{ {
$server_ip_SQL = ""; $server_ip_SQL = "";
$server_rpt_string="- ALL servers "; $server_rpt_string="- ALL servers ";
if (ereg("--ALL--",$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} if (preg_match('/\-\-ALL\-\-/',$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";}
} }
else else
{ {
$server_ip_SQL = eregi_replace(",$",'',$server_ip_SQL); $server_ip_SQL = preg_replace('/,$/i', '',$server_ip_SQL);
$server_ip_SQL = "and server_ip IN($server_ip_SQL)"; $server_ip_SQL = "and server_ip IN($server_ip_SQL)";
$server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1));
} }
@@ -214,14 +215,14 @@ $MAIN.="<BR> to <BR><INPUT TYPE=TEXT NAME=query_date_T SIZE=9 MAXLENGTH=8 VALUE=
$MAIN.="</TD><TD ROWSPAN=2 VALIGN=TOP>Server IP:<BR/>\n"; $MAIN.="</TD><TD ROWSPAN=2 VALIGN=TOP>Server IP:<BR/>\n";
$MAIN.="<SELECT SIZE=5 NAME=server_ip[] multiple>\n"; $MAIN.="<SELECT SIZE=5 NAME=server_ip[] multiple>\n";
if (eregi("--ALL--",$server_ip_string)) if (preg_match('/\-\-ALL\-\-/',$server_ip_string))
{$MAIN.="<option value=\"--ALL--\" selected>-- ALL SERVERS --</option>\n";} {$MAIN.="<option value=\"--ALL--\" selected>-- ALL SERVERS --</option>\n";}
else else
{$MAIN.="<option value=\"--ALL--\">-- ALL SERVERS --</option>\n";} {$MAIN.="<option value=\"--ALL--\">-- ALL SERVERS --</option>\n";}
$o=0; $o=0;
while ($servers_to_print > $o) while ($servers_to_print > $o)
{ {
if (ereg("\|$LISTserverIPs[$o]\|",$server_ip_string)) if (preg_match("/\|$LISTserverIPs[$o]\|/",$server_ip_string))
{$MAIN.="<option selected value=\"$LISTserverIPs[$o]\">$LISTserverIPs[$o] - $LISTserver_names[$o]</option>\n";} {$MAIN.="<option selected value=\"$LISTserverIPs[$o]\">$LISTserverIPs[$o] - $LISTserver_names[$o]</option>\n";}
else else
{$MAIN.="<option value=\"$LISTserverIPs[$o]\">$LISTserverIPs[$o] - $LISTserver_names[$o]</option>\n";} {$MAIN.="<option value=\"$LISTserverIPs[$o]\">$LISTserverIPs[$o] - $LISTserver_names[$o]</option>\n";}
@@ -15,6 +15,7 @@
# 111230-1145 - Debugging additions and more minor changes # 111230-1145 - Debugging additions and more minor changes
# 120221-2237 - Added totals, list options, other small changes # 120221-2237 - Added totals, list options, other small changes
# 130414-0131 - Added report logging # 130414-0131 - Added report logging
# 130610-1021 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -159,7 +160,7 @@ if (file_exists('options.php'))
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -186,7 +187,7 @@ while ($i < $campaigns_to_print)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$groups[$i] =$row[0]; $groups[$i] =$row[0];
if (ereg("-ALL",$group_string) ) if (preg_match('/\-ALL/',$group_string) )
{$group[$i] = $groups[$i];} {$group[$i] = $groups[$i];}
$i++; $i++;
} }
@@ -206,11 +207,11 @@ while($i < $group_ct)
$i++; $i++;
} }
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$group_string) ) or ($group_ct < 1) )
{$group_SQL = "";} {$group_SQL = "";}
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
$group_SQL = "and campaign_id IN($group_SQL)"; $group_SQL = "and campaign_id IN($group_SQL)";
} }
@@ -229,14 +230,14 @@ while ($i < $lists_to_print)
$campaign_span_txt="Campaigns:<BR>"; $campaign_span_txt="Campaigns:<BR>";
$campaign_span_txt.="<SELECT SIZE=5 NAME=group[] multiple>"; $campaign_span_txt.="<SELECT SIZE=5 NAME=group[] multiple>";
if (eregi("--ALL--",$group_string)) if (preg_match('/\-\-ALL\-\-/',$group_string))
{$campaign_span_txt.="<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>";} {$campaign_span_txt.="<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>";}
else else
{$campaign_span_txt.="<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>";} {$campaign_span_txt.="<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>";}
$o=0; $o=0;
while ($campaigns_to_print > $o) while ($campaigns_to_print > $o)
{ {
if (eregi("$groups[$o]\|",$group_string)) {$campaign_span_txt.="<option selected value=\"$groups[$o]\">$groups[$o]</option>";} if (preg_match("/$groups[$o]\|/i",$group_string)) {$campaign_span_txt.="<option selected value=\"$groups[$o]\">$groups[$o]</option>";}
else {$campaign_span_txt.="<option value=\"$groups[$o]\">$groups[$o]</option>";} else {$campaign_span_txt.="<option value=\"$groups[$o]\">$groups[$o]</option>";}
$o++; $o++;
} }
@@ -7,6 +7,7 @@
# #
# changes: # changes:
# 130221-2124 - First build # 130221-2124 - First build
# 130610-1039 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -49,13 +50,13 @@ if ($allow_emails<1)
if ($non_latin < 1) if ($non_latin < 1)
{ {
$user=ereg_replace("[^-_0-9a-zA-Z]","",$user); $user=preg_replace('/[^-_0-9a-zA-Z]/', '',$user);
$pass=ereg_replace("[^-_0-9a-zA-Z]","",$pass); $pass=preg_replace('/[^-_0-9a-zA-Z]/', '',$pass);
} }
else else
{ {
$user = ereg_replace("'|\"|\\\\|;","",$user); $user = preg_replace("/'|\"|\\\\|;/","",$user);
$pass = ereg_replace("'|\"|\\\\|;","",$pass); $pass = preg_replace("/'|\"|\\\\|;/","",$pass);
} }
if ($email_log_id) { if ($email_log_id) {
@@ -8,6 +8,7 @@
# CHANGELOG: # CHANGELOG:
# 130221-2117 - First build # 130221-2117 - First build
# 130414-0132 - Added report logging # 130414-0132 - Added report logging
# 130610-1016 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -163,7 +164,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -211,14 +212,14 @@ while($i < $group_ct)
} }
$i++; $i++;
} }
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\s\-\-NONE\-\-\s/',$group_string) ) or ($group_ct < 1) )
{ {
$group_SQL = "''"; $group_SQL = "''";
# $group_SQL = "group_id IN('')"; # $group_SQL = "group_id IN('')";
} }
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
# $group_SQL = "group_id IN($group_SQL)"; # $group_SQL = "group_id IN($group_SQL)";
} }
if (strlen($group_SQL)<3) {$group_SQL="''";} if (strlen($group_SQL)<3) {$group_SQL="''";}
@@ -314,7 +315,7 @@ $MAIN.="<SELECT SIZE=5 NAME=group[] multiple>\n";
$o=0; $o=0;
while ($groups_to_print > $o) while ($groups_to_print > $o)
{ {
if (ereg("\|$LISTgroups[$o]\|",$group_string)) if (preg_match("/\|$LISTgroups[$o]\|/",$group_string))
{$MAIN.="<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroup_names[$o]</option>\n";} {$MAIN.="<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroup_names[$o]</option>\n";}
else else
{$MAIN.="<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroup_names[$o]</option>\n";} {$MAIN.="<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTgroup_names[$o]</option>\n";}
@@ -7,6 +7,7 @@
# 120331-2301 - First build # 120331-2301 - First build
# 130413-2348 - Added report logging # 130413-2348 - Added report logging
# 130419-2047 - Changed how menu lists are generated to speed up initial form load # 130419-2047 - Changed how menu lists are generated to speed up initial form load
# 132305-2305 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -28,6 +29,8 @@ if (isset($_GET["server_ip"])) {$server_ip=$_GET["server_ip"];}
elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];} elseif (isset($_POST["server_ip"])) {$server_ip=$_POST["server_ip"];}
if (isset($_GET["hangup_cause"])) {$hangup_cause=$_GET["hangup_cause"];} if (isset($_GET["hangup_cause"])) {$hangup_cause=$_GET["hangup_cause"];}
elseif (isset($_POST["hangup_cause"])) {$hangup_cause=$_POST["hangup_cause"];} elseif (isset($_POST["hangup_cause"])) {$hangup_cause=$_POST["hangup_cause"];}
if (isset($_GET["sip_hangup_cause"])) {$sip_hangup_cause=$_GET["sip_hangup_cause"];}
elseif (isset($_POST["sip_hangup_cause"])) {$sip_hangup_cause=$_POST["sip_hangup_cause"];}
if (isset($_GET["dial_status"])) {$dial_status=$_GET["dial_status"];} if (isset($_GET["dial_status"])) {$dial_status=$_GET["dial_status"];}
elseif (isset($_POST["dial_status"])) {$dial_status=$_POST["dial_status"];} elseif (isset($_POST["dial_status"])) {$dial_status=$_POST["dial_status"];}
if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];} if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
@@ -43,8 +46,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$START_TIME=date("U"); $START_TIME=date("U");
@@ -118,42 +121,103 @@ $hangup_cause_dictionary = array(
127 => "Interworking, unspecified." 127 => "Interworking, unspecified."
); );
#### SIP response code directory
$sip_response_directory = array(
100 => "Trying",
180 => "Ringing",
181 => "Call is Being Forwarded",
182 => "Queued",
183 => "Session in Progress",
199 => "Early Dialog Terminated",
200 => "OK",
202 => "Accepted",
204 => "No Notification",
300 => "Multiple Choices",
301 => "Moved Permanently",
301 => "Moved Temporarily",
302 => "Moved Temporarily",
305 => "Use Proxy",
380 => "Alternative Service",
400 => "Bad Request",
401 => "Unauthorized",
402 => "Payment Required",
403 => "Forbidden",
404 => "Not Found",
405 => "Method Not Allowed",
406 => "Not Acceptable",
407 => "Proxy Authentication Required",
408 => "Request Timeout",
409 => "Conflict",
410 => "Gone",
411 => "Length Required",
412 => "Conditional Request Failed",
413 => "Request Entity Too Large",
414 => "Request-URI Too Long",
415 => "Unsupported Media Type",
416 => "Unsupported URI Scheme",
417 => "Unknown Resource-Priority",
420 => "Bad Extension",
421 => "Extension Required",
422 => "Session Interval Too Small",
423 => "Interval Too Brief",
424 => "Bad Location Information",
428 => "Use Identity Header",
429 => "Provide Referrer Identity",
430 => "Flow Failed",
433 => "Anonymity Disallowed",
436 => "Bad Identity-Info",
437 => "Unsupported Certificate",
438 => "Invalid Identity Header",
439 => "First Hop Lacks Outbound Support",
470 => "Consent Needed",
480 => "Temporarily Unavailable",
481 => "Call/Transaction Does Not Exist",
482 => "Loop Detected.",
483 => "Too Many Hops",
484 => "Address Incomplete",
485 => "Ambiguous",
486 => "Busy Here",
487 => "Request Terminated",
488 => "Not Acceptable Here",
489 => "Bad Event",
491 => "Request Pending",
493 => "Undecipherable",
494 => "Security Agreement Required",
500 => "Server Internal Error",
501 => "Not Implemented",
502 => "Bad Gateway",
503 => "Service Unavailable",
504 => "Server Time-out",
505 => "Version Not Supported",
513 => "Message Too Large",
580 => "Precondition Failure",
600 => "Busy Everywhere",
603 => "Decline",
604 => "Does Not Exist Anywhere",
606 => "Not Acceptable",
);
$master_hangup_cause_array=array(); $master_hangup_cause_array=array();
$i=0; $i=0;
while (list($key, $val)=each($hangup_cause_dictionary)) { while (list($key, $val)=each($hangup_cause_dictionary)) {
$master_hangup_cause_array[$i]=$key; $master_hangup_cause_array[$i]=$key;
$i++; $i++;
} }
$master_sip_response_directory=array();
$master_sip_response_verbiage_directory=array();
$i=0;
while (list($key, $val)=each($sip_response_directory)) {
$master_sip_response_directory[$i]=$key;
$master_sip_response_verbiage_directory[$i]=$val;
$i++;
}
$hangup_causes_to_print=count($master_hangup_cause_array); $hangup_causes_to_print=count($master_hangup_cause_array);
$sip_responses_to_print=count($master_sip_response_directory);
$master_dialstatus_array=array("ANSWER", "BUSY", "NOANSWER", "CANCEL", "CONGESTION", "CHANUNAVAIL", "DONTCALL", "TORTURE", "INVALIDARGS"); $master_dialstatus_array=array("ANSWER", "BUSY", "NOANSWER", "CANCEL", "CONGESTION", "CHANUNAVAIL", "DONTCALL", "TORTURE", "INVALIDARGS");
$dialstatuses_to_print=count($master_dialstatus_array); $dialstatuses_to_print=count($master_dialstatus_array);
/*
$hangup_cause_ct = count($hangup_cause);
$dial_status_ct = count($dial_status);
$i=0;
while($i < $hangup_cause_ct)
{
if (preg_match('/\-\-ALL\-\-/', $hangup_cause[$i]))
{
$hangup_cause=$master_hangup_cause_array;
break;
}
$i++;
}
$j=0;
while($j < $dial_status_ct)
{
if (preg_match('/\-\-ALL\-\-/', $dial_status[$j]))
{
$dial_status=$master_dialstatus_array;
break;
}
$j++;
}
*/
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level >= 7 and view_reports='1' and active='Y';";
if ($DB) {$MAIN.="|$stmt|\n";} if ($DB) {$MAIN.="|$stmt|\n";}
@@ -230,7 +294,7 @@ while ($i < $servers_to_print)
$row=mysql_fetch_row($server_rslt); $row=mysql_fetch_row($server_rslt);
$LISTserverIPs[$i] = $row[0]; $LISTserverIPs[$i] = $row[0];
$LISTserver_names[$i] = $row[1]; $LISTserver_names[$i] = $row[1];
if (ereg("-ALL",$server_ip_string) ) if (preg_match('/\-ALL/',$server_ip_string) )
{ {
$server_ip[$i] = $LISTserverIPs[$i]; $server_ip[$i] = $LISTserverIPs[$i];
} }
@@ -251,15 +315,15 @@ while($i < $server_ip_ct)
$i++; $i++;
} }
if ( (ereg("--ALL--",$server_ip_string) ) or ($server_ip_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$server_ip_string) ) or ($server_ip_ct < 1) )
{ {
$server_ip_SQL = ""; $server_ip_SQL = "";
$server_rpt_string="- ALL servers "; $server_rpt_string="- ALL servers ";
if (ereg("--ALL--",$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";} if (preg_match('/\-\-ALL\-\-/',$server_ip_string)) {$server_ipQS="&server_ip[]=--ALL--";}
} }
else else
{ {
$server_ip_SQL = eregi_replace(",$",'',$server_ip_SQL); $server_ip_SQL = preg_replace('/,$/i', '',$server_ip_SQL);
$server_ip_SQL = "and server_ip IN($server_ip_SQL)"; $server_ip_SQL = "and server_ip IN($server_ip_SQL)";
$server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1)); $server_rpt_string="- server(s) ".preg_replace('/\|/', ", ", substr($server_ip_string, 1, -1));
} }
@@ -268,9 +332,11 @@ if (strlen($server_ip_SQL)<3) {$server_ip_SQL="";}
########### HANGUP CAUSES ########### HANGUP CAUSES
$hangup_cause_string='|'; $hangup_cause_string='|';
$dialstatus_string='|'; $dialstatus_string='|';
#$hangup_and_dialstatus_string='|'; $sip_hangup_cause_string='|';
$hangup_cause_ct = count($hangup_cause); $hangup_cause_ct = count($hangup_cause);
$dial_status_ct = count($dial_status); $dial_status_ct = count($dial_status);
$sip_hangup_cause_ct = count($sip_hangup_cause);
$i=0; $i=0;
while($i < $hangup_cause_ct) while($i < $hangup_cause_ct)
@@ -286,9 +352,17 @@ while($j < $dial_status_ct)
$j++; $j++;
} }
$i=0;
while($i < $sip_hangup_cause_ct)
{
$sip_hangup_cause_string .= "$sip_hangup_cause[$i]|";
$i++;
}
$i=0; $j=0; $i=0; $j=0;
$hangup_causes_string='|'; $hangup_causes_string='|';
$dialstatuses_string='|'; $dialstatuses_string='|';
$sip_hangup_causes_string='|';
while($i < $hangup_cause_ct) while($i < $hangup_cause_ct)
{ {
if ( (strlen($hangup_cause[$i]) > 0) and (preg_match("/\|$hangup_cause[$i]\|/",$hangup_cause_string)) ) if ( (strlen($hangup_cause[$i]) > 0) and (preg_match("/\|$hangup_cause[$i]\|/",$hangup_cause_string)) )
@@ -298,6 +372,20 @@ while($i < $hangup_cause_ct)
} }
$i++; $i++;
} }
$i=0;
$sip_hangup_cause_SQL="";
while($i < $sip_hangup_cause_ct)
{
if ( (strlen($sip_hangup_cause[$i]) > 0) and (preg_match("/\|$sip_hangup_cause[$i]\|/",$sip_hangup_cause_string)) )
{
$sip_hangup_causes_string .= "$sip_hangup_cause[$i]|";
$sip_hangup_causeQS .= "&sip_hangup_cause[]=$sip_hangup_cause[$i]";
$sip_hangup_cause_SQL.="$sip_hangup_cause[$i],";
}
$i++;
}
while ($j < $dial_status_ct) while ($j < $dial_status_ct)
{ {
if ( (strlen($dial_status[$j]) > 0) and (preg_match("/\|$dial_status[$j]\|/",$dialstatus_string)) ) if ( (strlen($dial_status[$j]) > 0) and (preg_match("/\|$dial_status[$j]\|/",$dialstatus_string)) )
@@ -316,8 +404,8 @@ while($i < $hangup_cause_ct)
{ {
if ( (strlen($hangup_cause[$i]) > 0) and (preg_match("/\|$hangup_cause[$i]\|/",$hangup_cause_string)) and (strlen($dial_status[$j]) > 0) and (preg_match("/\|$dial_status[$j]\|/",$dialstatus_string)) ) if ( (strlen($hangup_cause[$i]) > 0) and (preg_match("/\|$hangup_cause[$i]\|/",$hangup_cause_string)) and (strlen($dial_status[$j]) > 0) and (preg_match("/\|$dial_status[$j]\|/",$dialstatus_string)) )
{ {
if ( ereg("--ALL--",$hangup_cause_string) ) {$HC_subclause="";} else {$HC_subclause="hangup_cause='$hangup_cause[$i]'";} if ( preg_match('/\-\-ALL\-\-/',$hangup_cause_string) ) {$HC_subclause="";} else {$HC_subclause="hangup_cause='$hangup_cause[$i]'";}
if ( ereg("--ALL--",$dialstatus_string) ) {$DS_subclause="";} else {$DS_subclause="dialstatus='$dial_status[$j]'";} if ( preg_match('/\-\-ALL\-\-/',$dialstatus_string) ) {$DS_subclause="";} else {$DS_subclause="dialstatus='$dial_status[$j]'";}
if ($HC_subclause=="" || $DS_subclause=="") {$conjunction="";} else {$conjunction=" and ";} if ($HC_subclause=="" || $DS_subclause=="") {$conjunction="";} else {$conjunction=" and ";}
$hangup_cause_SQL .= "($HC_subclause$conjunction$DS_subclause) OR"; $hangup_cause_SQL .= "($HC_subclause$conjunction$DS_subclause) OR";
$hangup_cause_SQL=preg_replace('/\(\) OR$/', '', $hangup_cause_SQL); $hangup_cause_SQL=preg_replace('/\(\) OR$/', '', $hangup_cause_SQL);
@@ -328,40 +416,55 @@ while($i < $hangup_cause_ct)
$i++; $i++;
} }
if ( (ereg("--ALL--",$hangup_cause_string) ) or ($hangup_cause_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$hangup_cause_string) ) or ($hangup_cause_ct < 1) )
{ {
# $hangup_cause_SQL = "";
$HC_rpt_string="- ALL hangup causes "; $HC_rpt_string="- ALL hangup causes ";
if (ereg("--ALL--",$hangup_cause_string)) {$hangup_causeQS="&hangup_cause[]=--ALL--";} if (preg_match('/\-\-ALL\-\-/',$hangup_cause_string)) {$hangup_causeQS="&hangup_cause[]=--ALL--";}
} }
else else
{ {
# $hangup_cause_SQL=preg_replace('/ OR$/', '', $hangup_cause_SQL);
# $hangup_cause_SQL = eregi_replace(",$",'',$hangup_cause_SQL);
# $hangup_cause_SQL = "and ($hangup_cause_SQL)";
$hangup_causes_string=preg_replace('/\!/', "-", $hangup_causes_string); $hangup_causes_string=preg_replace('/\!/', "-", $hangup_causes_string);
$HC_rpt_string="AND hangup cause(s) ".preg_replace('/\|/', ", ", substr($hangup_causes_string, 1, -1)); $HC_rpt_string="AND hangup cause(s) ".preg_replace('/\|/', ", ", substr($hangup_causes_string, 1, -1));
} }
if ( (ereg("--ALL--",$dial_status_string) ) or ($dial_status_ct < 1) )
if ( (preg_match('/\-\-ALL\-\-/',$sip_hangup_cause_string) ) or ($sip_hangup_cause_ct < 1) )
{
$HC_rpt_string="- ALL SIP hangup causes ";
if (preg_match('/\-\-ALL\-\-/',$sip_hangup_cause_string))
{
$sip_hangup_causeQS="&sip_hangup_cause[]=--ALL--";
$sip_hangup_cause_SQL="";
}
}
else
{
$sip_hangup_causes_string=preg_replace('/\!/', "-", $sip_hangup_causes_string);
$HC_rpt_string="AND SIP hangup cause(s) ".preg_replace('/\|/', ", ", substr($sip_hangup_causes_string, 1, -1));
}
$sip_hangup_cause_SQL = preg_replace('/,$/i', '',$sip_hangup_cause_SQL);
if (strlen($sip_hangup_cause_SQL)>0) {$sip_hangup_cause_SQL="and sip_hangup_cause in ($sip_hangup_cause_SQL)";}
if ( (preg_match('/\-\-ALL\-\-/',$dial_status_string) ) or ($dial_status_ct < 1) )
{ {
$dial_status_SQL = ""; $dial_status_SQL = "";
$DS_rpt_string="- ALL dial statuses "; $DS_rpt_string="- ALL dial statuses ";
if (ereg("--ALL--",$dial_status_string)) {$dial_statusQS="&dial_status[]=--ALL--";} if (preg_match('/\-\-ALL\-\-/',$dial_status_string)) {$dial_statusQS="&dial_status[]=--ALL--";}
} }
else else
{ {
#$hangup_cause_SQL=preg_replace('/ OR$/', '', $hangup_cause_SQL); #$hangup_cause_SQL=preg_replace('/ OR$/', '', $hangup_cause_SQL);
#$hangup_cause_SQL = eregi_replace(",$",'',$hangup_cause_SQL); #$hangup_cause_SQL = preg_replace('/,$/i', '',$hangup_cause_SQL);
#$hangup_cause_SQL = "and ($hangup_cause_SQL)"; #$hangup_cause_SQL = "and ($hangup_cause_SQL)";
$dialstatuses_string=preg_replace('/\!/', "-", $dialstatuses_string); $dialstatuses_string=preg_replace('/\!/', "-", $dialstatuses_string);
$DS_rpt_string="AND dial status(es) ".preg_replace('/\|/', ", ", substr($dialstatuses_string, 1, -1)); $DS_rpt_string="AND dial status(es) ".preg_replace('/\|/', ", ", substr($dialstatuses_string, 1, -1));
} }
$hangup_cause_SQL=preg_replace('/ OR$/', '', $hangup_cause_SQL); $hangup_cause_SQL=preg_replace('/ OR$/', '', $hangup_cause_SQL);
$hangup_cause_SQL = eregi_replace(",$",'',$hangup_cause_SQL); $hangup_cause_SQL = preg_replace('/,$/i', '',$hangup_cause_SQL);
$hangup_cause_SQL = "and ($hangup_cause_SQL)"; $hangup_cause_SQL = "and ($hangup_cause_SQL)";
if (strlen($hangup_cause_SQL)<7) {$hangup_cause_SQL="";} if (strlen($hangup_cause_SQL)<7) {$hangup_cause_SQL="";}
######################## ########################
@@ -409,14 +512,14 @@ $MAIN.="<BR> to <BR><INPUT TYPE=TEXT NAME=query_date_T SIZE=9 MAXLENGTH=8 VALUE=
$MAIN.="</TD><TD ROWSPAN=2 VALIGN=TOP>Server IP:<BR/>\n"; $MAIN.="</TD><TD ROWSPAN=2 VALIGN=TOP>Server IP:<BR/>\n";
$MAIN.="<SELECT SIZE=5 NAME=server_ip[] multiple>\n"; $MAIN.="<SELECT SIZE=5 NAME=server_ip[] multiple>\n";
if (eregi("--ALL--",$server_ip_string)) if (preg_match('/\-\-ALL\-\-/',$server_ip_string))
{$MAIN.="<option value=\"--ALL--\" selected>-- ALL SERVERS --</option>\n";} {$MAIN.="<option value=\"--ALL--\" selected>-- ALL SERVERS --</option>\n";}
else else
{$MAIN.="<option value=\"--ALL--\">-- ALL SERVERS --</option>\n";} {$MAIN.="<option value=\"--ALL--\">-- ALL SERVERS --</option>\n";}
$o=0; $o=0;
while ($servers_to_print > $o) while ($servers_to_print > $o)
{ {
if (ereg("\|$LISTserverIPs[$o]\|",$server_ip_string)) if (preg_match("/\|$LISTserverIPs[$o]\|/",$server_ip_string))
{$MAIN.="<option selected value=\"$LISTserverIPs[$o]\">$LISTserverIPs[$o] - $LISTserver_names[$o]</option>\n";} {$MAIN.="<option selected value=\"$LISTserverIPs[$o]\">$LISTserverIPs[$o] - $LISTserver_names[$o]</option>\n";}
else else
{$MAIN.="<option value=\"$LISTserverIPs[$o]\">$LISTserverIPs[$o] - $LISTserver_names[$o]</option>\n";} {$MAIN.="<option value=\"$LISTserverIPs[$o]\">$LISTserverIPs[$o] - $LISTserver_names[$o]</option>\n";}
@@ -426,7 +529,7 @@ $MAIN.="</SELECT></TD>";
$MAIN.="<TD ROWSPAN=2 VALIGN=top align=center>Hangup Cause:<BR/>"; $MAIN.="<TD ROWSPAN=2 VALIGN=top align=center>Hangup Cause:<BR/>";
$MAIN.="<SELECT SIZE=5 NAME=hangup_cause[] multiple>\n"; $MAIN.="<SELECT SIZE=5 NAME=hangup_cause[] multiple>\n";
if (eregi("--ALL--",$hangup_causes_string)) if (preg_match('/\-\-ALL\-\-/',$hangup_causes_string))
{$MAIN.="<option value=\"--ALL--\" selected>-- ALL HANGUP CAUSES --</option>\n";} {$MAIN.="<option value=\"--ALL--\" selected>-- ALL HANGUP CAUSES --</option>\n";}
else else
{$MAIN.="<option value=\"--ALL--\">-- ALL HANGUP CAUSES --</option>\n";} {$MAIN.="<option value=\"--ALL--\">-- ALL HANGUP CAUSES --</option>\n";}
@@ -434,7 +537,7 @@ else
$o=0; $o=0;
while ($hangup_causes_to_print > $o) while ($hangup_causes_to_print > $o)
{ {
if (ereg("\|$master_hangup_cause_array[$o]\|",$hangup_causes_string)) if (preg_match("/\|$master_hangup_cause_array[$o]\|/",$hangup_causes_string))
{$MAIN.="<option selected value=\"$master_hangup_cause_array[$o]\">$master_hangup_cause_array[$o]</option>\n";} {$MAIN.="<option selected value=\"$master_hangup_cause_array[$o]\">$master_hangup_cause_array[$o]</option>\n";}
else else
{$MAIN.="<option value=\"$master_hangup_cause_array[$o]\">$master_hangup_cause_array[$o]</option>\n";} {$MAIN.="<option value=\"$master_hangup_cause_array[$o]\">$master_hangup_cause_array[$o]</option>\n";}
@@ -445,7 +548,7 @@ $MAIN.="</TD>";
$MAIN.="<TD ROWSPAN=2 VALIGN=top align=center>Dial status:<BR/>"; $MAIN.="<TD ROWSPAN=2 VALIGN=top align=center>Dial status:<BR/>";
$MAIN.="<SELECT SIZE=5 NAME=dial_status[] multiple>\n"; $MAIN.="<SELECT SIZE=5 NAME=dial_status[] multiple>\n";
if (eregi("--ALL--",$dialstatuses_string)) if (preg_match('/\-\-ALL\-\-/',$dialstatuses_string))
{$MAIN.="<option value=\"--ALL--\" selected>-- ALL DIAL STATUSES --</option>\n";} {$MAIN.="<option value=\"--ALL--\" selected>-- ALL DIAL STATUSES --</option>\n";}
else else
{$MAIN.="<option value=\"--ALL--\">-- ALL DIAL STATUSES --</option>\n";} {$MAIN.="<option value=\"--ALL--\">-- ALL DIAL STATUSES --</option>\n";}
@@ -454,7 +557,7 @@ $o=0;
while ($dialstatuses_to_print > $o) while ($dialstatuses_to_print > $o)
{ {
if (ereg("\|$master_dialstatus_array[$o]\|",$dialstatuses_string)) if (preg_match("/\|$master_dialstatus_array[$o]\|/",$dialstatuses_string))
{$MAIN.="<option selected value=\"$master_dialstatus_array[$o]\">$master_dialstatus_array[$o]</option>\n";} {$MAIN.="<option selected value=\"$master_dialstatus_array[$o]\">$master_dialstatus_array[$o]</option>\n";}
else else
{$MAIN.="<option value=\"$master_dialstatus_array[$o]\">$master_dialstatus_array[$o]</option>\n";} {$MAIN.="<option value=\"$master_dialstatus_array[$o]\">$master_dialstatus_array[$o]</option>\n";}
@@ -463,9 +566,25 @@ while ($dialstatuses_to_print > $o)
$MAIN.="</SELECT>"; $MAIN.="</SELECT>";
$MAIN.="</TD>"; $MAIN.="</TD>";
$MAIN.="<TD ROWSPAN=2 VALIGN=top align=center>"; $MAIN.="<TD ROWSPAN=2 VALIGN=top align=center>SIP Response:<BR/>";
$MAIN.="<SELECT SIZE=5 NAME=sip_hangup_cause[] multiple>\n";
if (preg_match('/--ALL--/',$sip_hangup_causes_string))
{$MAIN.="<option value=\"--ALL--\" selected>-- ALL SIP CAUSES --</option>\n";}
else
{$MAIN.="<option value=\"--ALL--\">-- ALL SIP CAUSES --</option>\n";}
$o=0;
while ($sip_responses_to_print > $o)
{
if (preg_match("/\|$master_sip_response_directory[$o]\|/",$sip_hangup_causes_string))
{$MAIN.="<option selected value=\"$master_sip_response_directory[$o]\">$master_sip_response_directory[$o] - $master_sip_response_verbiage_directory[$o]</option>\n";}
else
{$MAIN.="<option value=\"$master_sip_response_directory[$o]\">$master_sip_response_directory[$o] - $master_sip_response_verbiage_directory[$o]</option>\n";}
$o++;
}
$MAIN.="</SELECT>";
$MAIN.="</TD>";
$MAIN.="</TD>\n";
$MAIN.="<TD ROWSPAN=2 VALIGN=middle align=center>\n"; $MAIN.="<TD ROWSPAN=2 VALIGN=middle align=center>\n";
$MAIN.="<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT><BR/><BR/>\n"; $MAIN.="<INPUT TYPE=submit NAME=SUBMIT VALUE=SUBMIT><BR/><BR/>\n";
@@ -492,7 +611,7 @@ if ($SUBMIT && $server_ip_ct>0) {
$MAIN.="| TOTAL | ".sprintf("%-8s", $total_count)."|\n"; $MAIN.="| TOTAL | ".sprintf("%-8s", $total_count)."|\n";
$MAIN.="+--------------+-------------+---------+\n\n\n"; $MAIN.="+--------------+-------------+---------+\n\n\n";
$rpt_stmt="SELECT vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL order by vicidial_carrier_log.call_date asc"; $rpt_stmt="SELECT vicidial_carrier_log.*, vicidial_log.phone_number from vicidial_carrier_log left join vicidial_log on vicidial_log.uniqueid=vicidial_carrier_log.uniqueid where vicidial_carrier_log.call_date>='$query_date $query_date_D' and vicidial_carrier_log.call_date<='$query_date $query_date_T' $server_ip_SQL $hangup_cause_SQL $sip_hangup_cause_SQL order by vicidial_carrier_log.call_date asc";
$rpt_rslt=mysql_query($rpt_stmt, $link); $rpt_rslt=mysql_query($rpt_stmt, $link);
if ($DB) {$MAIN.=$rpt_stmt."\n";} if ($DB) {$MAIN.=$rpt_stmt."\n";}
@@ -500,10 +619,10 @@ if ($SUBMIT && $server_ip_ct>0) {
if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;} if ($lower_limit+999>=mysql_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysql_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
$MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, $HC_rpt_string, $DS_rpt_string\n --- RECORDS #$lower_limit-$upper_limit <a href=\"$PHP_SELF?SUBMIT=$SUBMIT&DB=$DB&type=$type&query_date=$query_date&query_date_D=$query_date_D&query_date_T=$query_date_T$server_ipQS&lower_limit=$lower_limit&upper_limit=$upper_limit&file_download=1\">[DOWNLOAD]</a>\n"; $MAIN.="--- CARRIER LOG RECORDS FOR $query_date, $query_date_D TO $query_date_T $server_rpt_string, $HC_rpt_string, $DS_rpt_string\n --- RECORDS #$lower_limit-$upper_limit <a href=\"$PHP_SELF?SUBMIT=$SUBMIT&DB=$DB&type=$type&query_date=$query_date&query_date_D=$query_date_D&query_date_T=$query_date_T$server_ipQS&lower_limit=$lower_limit&upper_limit=$upper_limit&file_download=1\">[DOWNLOAD]</a>\n";
$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n"; $carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+--------------+--------------------------------+\n";
$carrier_rpt.="| UNIQUE ID | CALL DATE | SERVER IP | LEAD ID | HANGUP CAUSE | DIAL STATUS | CHANNEL | DIAL TIME | ANSWERED TIME | PHONE NUMBER |\n"; $carrier_rpt.="| UNIQUE ID | CALL DATE | SERVER IP | LEAD ID | HANGUP CAUSE | DIAL STATUS | CHANNEL | DIAL TIME | ANSWERED TIME | PHONE NUMBER | SIP RESPONSE | SIP REASON |\n";
$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n"; $carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+--------------+--------------------------------+\n";
$CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"SERVER IP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"ANSWERED TIME\",\"PHONE NUMBER\"\n"; $CSV_text="\"UNIQUE ID\",\"CALL DATE\",\"SERVER IP\",\"LEAD ID\",\"HANGUP CAUSE\",\"DIAL STATUS\",\"CHANNEL\",\"DIAL TIME\",\"ANSWERED TIME\",\"PHONE NUMBER\",\"SIP RESPONSE\",\"SIP REASON\"\n";
for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) { for ($i=1; $i<=mysql_num_rows($rpt_rslt); $i++) {
$row=mysql_fetch_array($rpt_rslt); $row=mysql_fetch_array($rpt_rslt);
@@ -522,7 +641,7 @@ if ($SUBMIT && $server_ip_ct>0) {
$phone_number=$row["phone_number"]; $phone_number=$row["phone_number"];
} }
$CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\"\n"; $CSV_text.="\"$row[uniqueid]\",\"$row[call_date]\",\"$row[server_ip]\",\"$row[lead_id]\",\"$row[hangup_cause]\",\"$row[dialstatus]\",\"$row[channel]\",\"$row[dial_time]\",\"$row[answered_time]\",\"$phone_number\",\"$row[sip_hangup_cause]\",\"$row[sip_hangup_reason]\"\n";
if ($i>=$lower_limit && $i<=$upper_limit) { if ($i>=$lower_limit && $i<=$upper_limit) {
if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";} if (strlen($row["channel"])>37) {$row["channel"]=substr($row["channel"],0,37)."...";}
$carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]); $carrier_rpt.="| ".sprintf("%-21s", $row["uniqueid"]);
@@ -534,10 +653,12 @@ if ($SUBMIT && $server_ip_ct>0) {
$carrier_rpt.="| ".sprintf("%-41s", $row["channel"]); $carrier_rpt.="| ".sprintf("%-41s", $row["channel"]);
$carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]); $carrier_rpt.="| ".sprintf("%-10s", $row["dial_time"]);
$carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]); $carrier_rpt.="| ".sprintf("%-14s", $row["answered_time"]);
$carrier_rpt.="| ".sprintf("%-13s", $phone_number)."|\n"; $carrier_rpt.="| ".sprintf("%-13s", $phone_number);
$carrier_rpt.="| ".sprintf("%-13s", $row["sip_hangup_cause"]);
$carrier_rpt.="| ".sprintf("%-31s", $row["sip_hangup_reason"])."|\n";
} }
} }
$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+\n"; $carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+-----------+---------------+--------------+--------------+--------------------------------+\n";
$carrier_rpt_hf=""; $carrier_rpt_hf="";
$ll=$lower_limit-1000; $ll=$lower_limit-1000;
@@ -1,13 +1,14 @@
<?php <?php
# AST_inboundEXTstats.php # AST_inboundEXTstats.php
# #
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# CHANGES # CHANGES
# 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES # 60421-1450 - check GET/POST vars lines with isset to not trigger PHP NOTICES
# 60620-1322 - Added variable filtering to eliminate SQL injection attack threat # 60620-1322 - Added variable filtering to eliminate SQL injection attack threat
# - Added required user/pass to gain access to this page # - Added required user/pass to gain access to this page
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 130610-1134 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -26,8 +27,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -114,7 +115,7 @@ echo "\n";
echo "---------- TOTALS\n"; echo "---------- TOTALS\n";
$extenSQL = "and extension='" . mysql_real_escape_string($group) . "'"; $extenSQL = "and extension='" . mysql_real_escape_string($group) . "'";
if (eregi("\*",$group)) if (preg_match("/\*/i",$group))
{$extenSQL = "and extension LIKE \"%$group\"";} {$extenSQL = "and extension LIKE \"%$group\"";}
$stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;"; $stmt="select count(*),sum(length_in_sec) from call_log where start_time >= '" . mysql_real_escape_string($query_date) . " 00:00:01' and start_time <= '" . mysql_real_escape_string($query_date) . " 23:59:59' and server_ip='" . mysql_real_escape_string($server_ip) . "' $extenSQL ;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -1,11 +1,12 @@
<?php <?php
# AST_inboundEXTstats_department.php # AST_inboundEXTstats_department.php
# #
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# CHANGES # CHANGES
# 70201-1710 - First Build # 70201-1710 - First Build
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 130610-1134 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -26,8 +27,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
############################################# #############################################
##### START SYSTEM_SETTINGS LOOKUP ##### ##### START SYSTEM_SETTINGS LOOKUP #####
@@ -14,6 +14,7 @@
# 121115-0621 - Changed to multi-select for in-group selection # 121115-0621 - Changed to multi-select for in-group selection
# 130322-2008 - Added Unique Agents column # 130322-2008 - Added Unique Agents column
# 130414-0110 - Added report logging # 130414-0110 - Added report logging
# 130610-1008 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -53,8 +54,8 @@ if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
if (strlen($shift)<2) {$shift='ALL';} if (strlen($shift)<2) {$shift='ALL';}
@@ -155,7 +156,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -167,7 +168,7 @@ if ($IDR_calltime_available==1)
{ {
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -839,7 +840,7 @@ else
if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];} if ($totCALLSmax < $ls[$i]) {$totCALLSmax = $ls[$i];}
if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];} if ($qrtCALLSmax[$j] < $ls[$i]) {$qrtCALLSmax[$j] = $ls[$i];}
if (ereg('ABANDON|NOAGENT|QUEUETIMEOUT|AFTERHOURS|MAXCALLS', $tr[$i])) if (preg_match('/ABANDON|NOAGENT|QUEUETIMEOUT|AFTERHOURS|MAXCALLS/', $tr[$i]))
{ {
$totABANDONSdate[$j]++; $totABANDONSdate[$j]++;
$totABANDONSsecdate[$j]+=$ls[$i]; $totABANDONSsecdate[$j]+=$ls[$i];
@@ -857,7 +858,7 @@ else
$FtotANSWERS++; $FtotANSWERS++;
$FtotANSWERSspeeddate+=$qs[$i]; $FtotANSWERSspeeddate+=$qs[$i];
} }
if (ereg('DROP',$st[$i])) if (preg_match('/DROP/',$st[$i]))
{ {
$totDROPS++; $totDROPS++;
$totDROPSsec = ($totDROPSsec + $ls[$i]); $totDROPSsec = ($totDROPSsec + $ls[$i]);
+4 -3
View File
@@ -1,13 +1,14 @@
<?php <?php
# AST_parkstats.php # AST_parkstats.php
# #
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# CHANGES # CHANGES
# #
# 60619-1717 - Added variable filtering to eliminate SQL injection attack threat # 60619-1717 - Added variable filtering to eliminate SQL injection attack threat
# - Added required user/pass to gain access to this page # - Added required user/pass to gain access to this page
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 130610-1133 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -24,8 +25,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -17,6 +17,7 @@
# 100802-2347 - Added User Group Allowed Reports option validation # 100802-2347 - Added User Group Allowed Reports option validation
# 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links # 100914-1326 - Added lookup for user_level 7 users to set to reports only which will remove other admin links
# 130414-0157 - Added report logging # 130414-0157 - Added report logging
# 130610-0959 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -39,8 +40,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$report_name = 'Server Performance Report'; $report_name = 'Server Performance Report';
$db_source = 'M'; $db_source = 'M';
@@ -16,6 +16,7 @@
# 120224-1424 - Added new colums and PRECAL to System Time # 120224-1424 - Added new colums and PRECAL to System Time
# 120307-1926 - Added additional statuses option and HTML display option # 120307-1926 - Added additional statuses option and HTML display option
# 130414-0142 - Added report logging # 130414-0142 - Added report logging
# 130610-0958 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -74,8 +75,8 @@ if ($qm_conf_ct > 0)
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
if ($DB) {$HTML_text.="|$stmt|\n";} if ($DB) {$HTML_text.="|$stmt|\n";}
@@ -152,7 +153,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -163,7 +164,7 @@ $regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -173,7 +174,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -213,7 +214,7 @@ while ($i < $campaigns_to_print)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$groups[$i] =$row[0]; $groups[$i] =$row[0];
if (ereg("-ALL",$group_string) ) if (preg_match('/\-ALL/',$group_string) )
{$group[$i] = $groups[$i];} {$group[$i] = $groups[$i];}
$i++; $i++;
} }
@@ -244,7 +245,7 @@ while ($i < $call_statuses_to_print)
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$call_statuses[$i] =$row[0]; $call_statuses[$i] =$row[0];
$call_statuses_names[$i] =$row[1]; $call_statuses_names[$i] =$row[1];
# if (ereg("-ALL",$call_status_string) ) # if (preg_match('/\-ALL/',$call_status_string) )
# {$call_status[$i] = $call_statuses[$i];} # {$call_status[$i] = $call_statuses[$i];}
$i++; $i++;
} }
@@ -252,7 +253,7 @@ while ($i < $call_statuses_to_print)
####################################### #######################################
for ($i=0; $i<count($user_group); $i++) for ($i=0; $i<count($user_group); $i++)
{ {
if (eregi("--ALL--", $user_group[$i])) {$all_user_groups=1; $user_group="";} if (preg_match('/\-\-ALL\-\-/', $user_group[$i])) {$all_user_groups=1; $user_group="";}
} }
$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;";
@@ -282,11 +283,11 @@ while($i < $group_ct)
$i++; $i++;
} }
if ( (ereg("--ALL--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$group_string) ) or ($group_ct < 1) )
{$group_SQL = "";} {$group_SQL = "";}
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
$group_SQL_str=$group_SQL; $group_SQL_str=$group_SQL;
$group_SQL = "and campaign_id IN($group_SQL)"; $group_SQL = "and campaign_id IN($group_SQL)";
} }
@@ -305,11 +306,11 @@ while($i < $call_status_ct)
$i++; $i++;
} }
if ( (ereg("--NONE--",$call_status_string) ) or ($call_status_ct < 1) ) if ( (preg_match('/\s\-\-NONE\-\-\s/',$call_status_string) ) or ($call_status_ct < 1) )
{$call_status_SQL = "";} {$call_status_SQL = "";}
else else
{ {
$call_status_SQL = eregi_replace(",$",'',$call_status_SQL); $call_status_SQL = preg_replace('/,$/i', '',$call_status_SQL);
$call_status_SQL_str=$call_status_SQL; $call_status_SQL_str=$call_status_SQL;
$call_status_SQL = "and status IN($call_status_SQL)"; $call_status_SQL = "and status IN($call_status_SQL)";
} }
@@ -326,11 +327,11 @@ while($i < $user_group_ct)
$i++; $i++;
} }
if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$user_group_string) ) or ($user_group_ct < 1) )
{$user_group_SQL = "";} {$user_group_SQL = "";}
else else
{ {
$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = preg_replace('/,$/i', '',$user_group_SQL);
$user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; $user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)";
} }
###################################### ######################################
@@ -402,14 +403,14 @@ $HTML_text.=" &nbsp; <INPUT TYPE=TEXT NAME=end_date_T SIZE=9 MAXLENGTH=8 VALUE=\
$HTML_text.="</TD><TD VALIGN=TOP> Campaigns:<BR>"; $HTML_text.="</TD><TD VALIGN=TOP> Campaigns:<BR>";
$HTML_text.="<SELECT SIZE=5 NAME=group[] multiple>\n"; $HTML_text.="<SELECT SIZE=5 NAME=group[] multiple>\n";
if (eregi("--ALL--",$group_string)) if (preg_match('/\-\-ALL\-\-/',$group_string))
{$HTML_text.="<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";} {$HTML_text.="<option value=\"--ALL--\" selected>-- ALL CAMPAIGNS --</option>\n";}
else else
{$HTML_text.="<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";} {$HTML_text.="<option value=\"--ALL--\">-- ALL CAMPAIGNS --</option>\n";}
$o=0; $o=0;
while ($campaigns_to_print > $o) while ($campaigns_to_print > $o)
{ {
if (eregi("$groups[$o]\|",$group_string)) if (preg_match("/$groups[$o]\|/i",$group_string))
{$HTML_text.="<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";} {$HTML_text.="<option selected value=\"$groups[$o]\">$groups[$o]</option>\n";}
else else
{$HTML_text.="<option value=\"$groups[$o]\">$groups[$o]</option>\n";} {$HTML_text.="<option value=\"$groups[$o]\">$groups[$o]</option>\n";}
@@ -420,14 +421,14 @@ $HTML_text.="</SELECT>\n";
$HTML_text.="</TD><TD VALIGN=TOP>Teams/User Groups:<BR>"; $HTML_text.="</TD><TD VALIGN=TOP>Teams/User Groups:<BR>";
$HTML_text.="<SELECT SIZE=5 NAME=user_group[] multiple>\n"; $HTML_text.="<SELECT SIZE=5 NAME=user_group[] multiple>\n";
if (eregi("--ALL--",$user_group_string)) if (preg_match('/\-\-ALL\-\-/',$user_group_string))
{$HTML_text.="<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";} {$HTML_text.="<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";}
else else
{$HTML_text.="<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";} {$HTML_text.="<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";}
$o=0; $o=0;
while ($user_groups_to_print > $o) while ($user_groups_to_print > $o)
{ {
if (eregi("\|$user_groups[$o]\|",$user_group_string)) if (preg_match("/\|$user_groups[$o]\|/i",$user_group_string))
{$HTML_text.="<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";} {$HTML_text.="<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
else else
{$HTML_text.="<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";} {$HTML_text.="<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
@@ -480,11 +481,11 @@ if ($SUBMIT=="SUBMIT")
$lead_id=$row["lead_id"]; $lead_id=$row["lead_id"];
$user=$row["user"]; $user=$row["user"];
$current_status=$row["current_status"]; $current_status=$row["current_status"];
if (eregi("QCCANC", $current_status)) if (preg_match("/QCCANC/i", $current_status))
{ {
$cancel_array[$row["user"]]++; $cancel_array[$row["user"]]++;
} }
else if (eregi("QCFAIL", $current_status)) else if (preg_match("/QCFAIL/i", $current_status))
{ {
$incomplete_array[$row["user"]]++; $incomplete_array[$row["user"]]++;
} }
+27 -26
View File
@@ -1,7 +1,7 @@
<?php <?php
# AST_timeonVDAD.php # AST_timeonVDAD.php
# #
# Copyright (C) 2008 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# live real-time stats for the VICIDIAL Auto-Dialer # live real-time stats for the VICIDIAL Auto-Dialer
# #
@@ -14,6 +14,7 @@
# 81013-2227 - Fixed Remote Agent display bug # 81013-2227 - Fixed Remote Agent display bug
# 90310-1945 - Admin header # 90310-1945 - Admin header
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 130610-1128 - Finalized changing of all ereg instances to preg
# #
header ("Content-type: text/html; charset=utf-8"); header ("Content-type: text/html; charset=utf-8");
@@ -34,8 +35,8 @@ if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
if (isset($_GET["closer_display"])) {$closer_display=$_GET["closer_display"];} if (isset($_GET["closer_display"])) {$closer_display=$_GET["closer_display"];}
elseif (isset($_POST["closer_display"])) {$closer_display=$_POST["closer_display"];} elseif (isset($_POST["closer_display"])) {$closer_display=$_POST["closer_display"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -186,38 +187,38 @@ $talking_to_print = mysql_num_rows($rslt);
while ($i < $talking_to_print) while ($i < $talking_to_print)
{ {
$phone[$i]=' '; $phone[$i]=' ';
if (eregi("R/",$Sextension[$i])) if (preg_match("/R\//i",$Sextension[$i]))
{ {
$protocol = 'EXTERNAL'; $protocol = 'EXTERNAL';
$dialplan = eregi_replace('R/',"",$Sextension[$i]); $dialplan = preg_replace('/R\//i', '',$Sextension[$i]);
$dialplan = eregi_replace("\@.*",'',$dialplan); $dialplan = preg_replace('/\@.*/i', '',$dialplan);
$exten = "dialplan_number='$dialplan'"; $exten = "dialplan_number='$dialplan'";
} }
if (eregi("Local/",$Sextension[$i])) if (preg_match("/Local\//i",$Sextension[$i]))
{ {
$protocol = 'EXTERNAL'; $protocol = 'EXTERNAL';
$dialplan = eregi_replace('Local/',"",$Sextension[$i]); $dialplan = preg_replace('/Local\//i', '',$Sextension[$i]);
$dialplan = eregi_replace("\@.*",'',$dialplan); $dialplan = preg_replace('/\@.*/i', '',$dialplan);
$exten = "dialplan_number='$dialplan'"; $exten = "dialplan_number='$dialplan'";
} }
if (eregi('SIP/',$Sextension[$i])) if (preg_match('/SIP\//i',$Sextension[$i]))
{ {
$protocol = 'SIP'; $protocol = 'SIP';
$dialplan = eregi_replace('SIP/',"",$Sextension[$i]); $dialplan = preg_replace('/SIP\//i', '',$Sextension[$i]);
$dialplan = eregi_replace("-.*",'',$dialplan); $dialplan = preg_replace('/\-.*/i', '',$dialplan);
$exten = "extension='$dialplan'"; $exten = "extension='$dialplan'";
} }
if (eregi('IAX2/',$Sextension[$i])) if (preg_match('/IAX2\//i',$Sextension[$i]))
{ {
$protocol = 'IAX2'; $protocol = 'IAX2';
$dialplan = eregi_replace('IAX2/',"",$Sextension[$i]); $dialplan = preg_replace('/IAX2\//i', '',$Sextension[$i]);
$dialplan = eregi_replace("-.*",'',$dialplan); $dialplan = preg_replace('/\-.*/i', '',$dialplan);
$exten = "extension='$dialplan'"; $exten = "extension='$dialplan'";
} }
if (eregi('Zap/',$Sextension[$i])) if (preg_match('/Zap\//i',$Sextension[$i]))
{ {
$protocol = 'Zap'; $protocol = 'Zap';
$dialplan = eregi_replace('Zap/',"",$Sextension[$i]); $dialplan = preg_replace('/Zap\/|DAHDI\//i', '',$Sextension[$i]);
$exten = "extension='$dialplan'"; $exten = "extension='$dialplan'";
} }
@@ -228,13 +229,13 @@ $talking_to_print = mysql_num_rows($rslt);
$phone[$i] = sprintf("%-10s", $login); $phone[$i] = sprintf("%-10s", $login);
if (eregi("READY|PAUSED|CLOSER",$Sstatus[$i])) if (preg_match("/READY|PAUSED|CLOSER/i",$Sstatus[$i]))
{ {
$Schannel[$i]=''; $Schannel[$i]='';
$Sstart_time[$i]='- WAIT -'; $Sstart_time[$i]='- WAIT -';
$Scall_time[$i]=$Sfinish_time[$i]; $Scall_time[$i]=$Sfinish_time[$i];
} }
$extension[$i] = eregi_replace('Local/',"",$Sextension[$i]); $extension[$i] = preg_replace('/Local\//i', '',$Sextension[$i]);
$extension[$i] = sprintf("%-10s", $extension[$i]); $extension[$i] = sprintf("%-10s", $extension[$i]);
while(strlen($extension[$i])>10) {$extension[$i] = substr("$extension[$i]", 0, -1);} while(strlen($extension[$i])>10) {$extension[$i] = substr("$extension[$i]", 0, -1);}
$user[$i] = sprintf("%-6s", $Suser[$i]); $user[$i] = sprintf("%-6s", $Suser[$i]);
@@ -243,7 +244,7 @@ $talking_to_print = mysql_num_rows($rslt);
$cc[$i]=0; $cc[$i]=0;
while ( (strlen($channel[$i]) > 19) and ($cc[$i] < 100) ) while ( (strlen($channel[$i]) > 19) and ($cc[$i] < 100) )
{ {
$channel[$i] = eregi_replace(".$","",$channel[$i]); $channel[$i] = preg_replace('/.$/i', '',$channel[$i]);
$cc[$i]++; $cc[$i]++;
if (strlen($channel[$i]) <= 19) {$cc[$i]=101;} if (strlen($channel[$i]) <= 19) {$cc[$i]=101;}
} }
@@ -252,7 +253,7 @@ $talking_to_print = mysql_num_rows($rslt);
$cd[$i]=0; $cd[$i]=0;
while ( (strlen($start_time[$i]) > 8) and ($cd[$i] < 100) ) while ( (strlen($start_time[$i]) > 8) and ($cd[$i] < 100) )
{ {
$start_time[$i] = eregi_replace("^.","",$start_time[$i]); $start_time[$i] = preg_replace('/^./i', '',$start_time[$i]);
$cd[$i]++; $cd[$i]++;
if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;} if (strlen($start_time[$i]) <= 8) {$cd[$i]=101;}
} }
@@ -276,7 +277,7 @@ $talking_to_print = mysql_num_rows($rslt);
$G = ''; $EG = ''; $G = ''; $EG = '';
if ($call_time_M_int[$i] >= 5) {$G='<SPAN class="blue"><B>'; $EG='</B></SPAN>';} if ($call_time_M_int[$i] >= 5) {$G='<SPAN class="blue"><B>'; $EG='</B></SPAN>';}
if ($call_time_M_int[$i] >= 10) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';} if ($call_time_M_int[$i] >= 10) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
if (eregi("PAUSED",$Sstatus[$i])) if (preg_match("/PAUSED/i",$Sstatus[$i]))
{ {
if ($call_time_M_int >= 1) if ($call_time_M_int >= 1)
{$i++; continue;} {$i++; continue;}
@@ -309,7 +310,7 @@ $talking_to_print = mysql_num_rows($rslt);
} }
else else
{$campaign = 'DEAD '; $camp_color = 'DEAD';} {$campaign = 'DEAD '; $camp_color = 'DEAD';}
if (eregi("READY|PAUSED|CLOSER",$status[$i])) if (preg_match("/READY|PAUSED|CLOSER/i",$status[$i]))
{$campaign = ' '; $camp_color = '';} {$campaign = ' '; $camp_color = '';}
$stmt="select user from vicidial_xfer_log where lead_id='$lead_id[$i]' and closer='$closer[$i]' order by call_date desc limit 1;"; $stmt="select user from vicidial_xfer_log where lead_id='$lead_id[$i]' and closer='$closer[$i]' order by call_date desc limit 1;";
@@ -385,7 +386,7 @@ $parked_to_print = mysql_num_rows($rslt);
$cc=0; $cc=0;
while ( (strlen($channel) > 19) and ($cc < 100) ) while ( (strlen($channel) > 19) and ($cc < 100) )
{ {
$channel = eregi_replace(".$","",$channel); $channel = preg_replace('/.$/i', '',$channel);
$cc++; $cc++;
if (strlen($channel) <= 19) {$cc=101;} if (strlen($channel) <= 19) {$cc=101;}
} }
@@ -393,7 +394,7 @@ $parked_to_print = mysql_num_rows($rslt);
$cd=0; $cd=0;
while ( (strlen($start_time) > 8) and ($cd < 100) ) while ( (strlen($start_time) > 8) and ($cd < 100) )
{ {
$start_time = eregi_replace("^.","",$start_time); $start_time = preg_replace('/^./i', '',$start_time);
$cd++; $cd++;
if (strlen($start_time) <= 8) {$cd=101;} if (strlen($start_time) <= 8) {$cd=101;}
} }
@@ -413,7 +414,7 @@ $parked_to_print = mysql_num_rows($rslt);
$call_time_MS = "$call_time_M_int:$call_time_SEC"; $call_time_MS = "$call_time_M_int:$call_time_SEC";
$call_time_MS = sprintf("%7s", $call_time_MS); $call_time_MS = sprintf("%7s", $call_time_MS);
$G = ''; $EG = ''; $G = ''; $EG = '';
if (eregi("LIVE",$status)) {$G='<SPAN class="green"><B>'; $EG='</B></SPAN>';} if (preg_match("/LIVE/i",$status)) {$G='<SPAN class="green"><B>'; $EG='</B></SPAN>';}
# if ($call_time_M_int >= 6) {$G='<SPAN class="red"><B>'; $EG='</B></SPAN>';} # if ($call_time_M_int >= 6) {$G='<SPAN class="red"><B>'; $EG='</B></SPAN>';}
echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n"; echo "| $G$channel$EG | $G$status$EG | $G$campaign$EG | $G$number_dialed$EG | $G$start_time$EG | $G$call_time_MS$EG |\n";
@@ -80,6 +80,7 @@
# 121222-2151 - Added email status # 121222-2151 - Added email status
# 130214-1323 - Added link to in-group selected users report for in-queue inbound calls # 130214-1323 - Added link to in-group selected users report for in-queue inbound calls
# 130424-1357 - Fixed issue with pause codes display # 130424-1357 - Fixed issue with pause codes display
# 130610-0905 - Finalized changing of all ereg instances to preg
# #
$version = '2.6-70'; $version = '2.6-70';
@@ -278,8 +279,8 @@ $timeSIXhoursAGO = date("Y-m-d H:i:s",$epochSIXhoursAGO);
$epochTWENTYFOURhoursAGO = ($STARTtime - 86400); $epochTWENTYFOURhoursAGO = ($STARTtime - 86400);
$timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO); $timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO);
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -367,7 +368,7 @@ if ($auth)
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$valLOGadmin_viewable_groupsSQL=''; $valLOGadmin_viewable_groupsSQL='';
$vmLOGadmin_viewable_groupsSQL=''; $vmLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -459,7 +460,7 @@ while($i < $group_ct)
$i++; $i++;
} }
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
$i=0; $i=0;
$user_group_string='|'; $user_group_string='|';
@@ -475,7 +476,7 @@ while($i < $user_group_ct)
$i++; $i++;
} }
$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = preg_replace('/,$/i', '',$user_group_SQL);
### if no campaigns selected, display all ### if no campaigns selected, display all
if ( ($group_ct < 1) or (strlen($group_string) < 2) ) if ( ($group_ct < 1) or (strlen($group_string) < 2) )
@@ -493,14 +494,14 @@ if ( ($user_group_ct < 1) or (strlen($user_group_string) < 2) )
$usergroupQS .= "&user_group_filter[]=ALL-GROUPS"; $usergroupQS .= "&user_group_filter[]=ALL-GROUPS";
} }
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\s\-\-NONE\-\-\s/',$group_string) ) or ($group_ct < 1) )
{ {
$all_active = 0; $all_active = 0;
$group_SQL = "''"; $group_SQL = "''";
$group_SQLand = "and FALSE"; $group_SQLand = "and FALSE";
$group_SQLwhere = "where FALSE"; $group_SQLwhere = "where FALSE";
} }
elseif ( eregi('ALL-ACTIVE',$group_string) ) elseif ( preg_match('/ALL\-ACTIVE/i',$group_string) )
{ {
$all_active = 1; $all_active = 1;
$group_SQL = $allactivecampaigns; $group_SQL = $allactivecampaigns;
@@ -514,14 +515,14 @@ else
$group_SQLwhere = "where campaign_id IN($group_SQL)"; $group_SQLwhere = "where campaign_id IN($group_SQL)";
} }
### USER GROUP STUFF ### USER GROUP STUFF
if ( (ereg("--NONE--",$user_group_string) ) or ($user_group_ct < 1) ) if ( (preg_match('/\s\-\-NONE\-\-\s/',$user_group_string) ) or ($user_group_ct < 1) )
{ {
$all_active_groups = 0; $all_active_groups = 0;
$user_group_SQL = "''"; $user_group_SQL = "''";
# $user_group_SQLand = "and FALSE"; # $user_group_SQLand = "and FALSE";
# $user_group_SQLwhere = "where FALSE"; # $user_group_SQLwhere = "where FALSE";
} }
elseif ( eregi('ALL-GROUPS',$user_group_string) ) elseif ( preg_match('/ALL\-GROUPS/i',$user_group_string) )
{ {
$all_active_groups = 1; $all_active_groups = 1;
# $user_group_SQL = ''; # $user_group_SQL = '';
@@ -565,7 +566,7 @@ $select_list .= "<SELECT SIZE=15 NAME=groups[] multiple>";
$o=0; $o=0;
while ($groups_to_print > $o) while ($groups_to_print > $o)
{ {
if (ereg("\|$LISTgroups[$o]\|",$group_string)) if (preg_match("/\|$LISTgroups[$o]\|/",$group_string))
{$select_list .= "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTnames[$o]</option>";} {$select_list .= "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTnames[$o]</option>";}
else else
{$select_list .= "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTnames[$o]</option>";} {$select_list .= "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTnames[$o]</option>";}
@@ -579,7 +580,7 @@ $select_list .= "<SELECT SIZE=8 NAME=user_group_filter[] ID=user_group_filter[]
$o=0; $o=0;
while ($o < $usergroups_to_print) while ($o < $usergroups_to_print)
{ {
if (ereg("\|$usergroups[$o]\|",$user_group_filter_string)) if (preg_match("/\|$usergroups[$o]\|/",$user_group_filter_string))
{$select_list .= "<option selected value=\"$usergroups[$o]\">$usergroups[$o] - $usergroupnames[$o]</option>";} {$select_list .= "<option selected value=\"$usergroups[$o]\">$usergroups[$o] - $usergroupnames[$o]</option>";}
else else
{$select_list .= "<option value=\"$usergroups[$o]\">$usergroups[$o] - $usergroupnames[$o]</option>";} {$select_list .= "<option value=\"$usergroups[$o]\">$usergroups[$o] - $usergroupnames[$o]</option>";}
@@ -1065,7 +1066,7 @@ if ($RTajax < 1)
echo "<a href=\"$PHP_SELF?RR=4000$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">STOP</a> | "; echo "<a href=\"$PHP_SELF?RR=4000$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">STOP</a> | ";
echo "<a href=\"$PHP_SELF?RR=40$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">SLOW</a> | "; echo "<a href=\"$PHP_SELF?RR=40$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">SLOW</a> | ";
echo "<a href=\"$PHP_SELF?RR=4$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">GO</a>"; echo "<a href=\"$PHP_SELF?RR=4$groupQS&DB=$DB&adastats=$adastats&SIPmonitorLINK=$SIPmonitorLINK&IAXmonitorLINK=$IAXmonitorLINK&usergroup=$usergroup&UGdisplay=$UGdisplay&UidORname=$UidORname&orderby=$orderby&SERVdisplay=$SERVdisplay&CALLSdisplay=$CALLSdisplay&PHONEdisplay=$PHONEdisplay&CUSTPHONEdisplay=$CUSTPHONEdisplay&with_inbound=$with_inbound&monitor_active=$monitor_active&monitor_phone=$monitor_phone&ALLINGROUPstats=$ALLINGROUPstats&DROPINGROUPstats=$DROPINGROUPstats&NOLEADSalert=$NOLEADSalert&CARRIERstats=$CARRIERstats&PRESETstats=$PRESETstats&AGENTtimeSTATS=$AGENTtimeSTATS\">GO</a>";
if (eregi('ALL-ACTIVE',$group_string)) if (preg_match('/ALL\-ACTIVE/i',$group_string))
{ {
echo " &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=10\">MODIFY</a> | \n"; echo " &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=10\">MODIFY</a> | \n";
} }
@@ -1099,7 +1100,7 @@ if ($DB > 0) {echo "\n|$ALLcloser_campaignsSQL|$stmt|\n";}
##### INBOUND ##### ##### INBOUND #####
if ( ( ereg('Y',$with_inbound) or ereg('O',$with_inbound) ) and ($campaign_allow_inbound > 0) ) if ( ( preg_match('/Y/',$with_inbound) or preg_match('/O/',$with_inbound) ) and ($campaign_allow_inbound > 0) )
{ {
### Gather list of Closer group ids ### Gather list of Closer group ids
$stmt = "select closer_campaigns from vicidial_campaigns where active='Y' $group_SQLand;"; $stmt = "select closer_campaigns from vicidial_campaigns where active='Y' $group_SQLand;";
@@ -1124,7 +1125,7 @@ if ($DB > 0) {echo "\n|$closer_campaigns|$closer_campaignsSQL|$stmt|\n";}
##### SHOW IN-GROUP STATS OR INBOUND ONLY WITH VIEW-MORE ### ##### SHOW IN-GROUP STATS OR INBOUND ONLY WITH VIEW-MORE ###
if ( ($ALLINGROUPstats > 0) or ( (ereg('O',$with_inbound)) and ($adastats > 1) ) ) if ( ($ALLINGROUPstats > 0) or ( (preg_match('/O/',$with_inbound)) and ($adastats > 1) ) )
{ {
$stmtB="select calls_today,drops_today,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL) order by campaign_id;"; $stmtB="select calls_today,drops_today,answers_today,status_category_1,status_category_count_1,status_category_2,status_category_count_2,status_category_3,status_category_count_3,status_category_4,status_category_count_4,hold_sec_stat_one,hold_sec_stat_two,hold_sec_answer_calls,hold_sec_drop_calls,hold_sec_queue_calls,campaign_id from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL) order by campaign_id;";
@@ -1207,7 +1208,7 @@ if ( ($ALLINGROUPstats > 0) or ( (ereg('O',$with_inbound)) and ($adastats > 1) )
$AVG_ANSWERagent_non_pause_sec=0; $AVG_ANSWERagent_non_pause_sec=0;
} }
if (ereg("0$|2$|4$|6$|8$",$r)) {$bgcolor='#E6E6E6';} if (preg_match('/0$|2$|4$|6$|8$/',$r)) {$bgcolor='#E6E6E6';}
else {$bgcolor='white';} else {$bgcolor='white';}
$ingroup_detail .= "<TR bgcolor=\"$bgcolor\">"; $ingroup_detail .= "<TR bgcolor=\"$bgcolor\">";
$ingroup_detail .= "<TD ALIGN=RIGHT bgcolor=white><font size=2> &nbsp; &nbsp; &nbsp; &nbsp; </TD>"; $ingroup_detail .= "<TD ALIGN=RIGHT bgcolor=white><font size=2> &nbsp; &nbsp; &nbsp; &nbsp; </TD>";
@@ -1494,7 +1495,7 @@ if ($PRESETstats > 0)
# http://server/vicidial/AST_timeonVDADall.php?&groups[]=ALL-ACTIVE&RR=4000&DB=0&adastats=&SIPmonitorLINK=&IAXmonitorLINK=&usergroup=&UGdisplay=1&UidORname=1&orderby=timeup&SERVdisplay=0&CALLSdisplay=1&PHONEdisplay=0&CUSTPHONEdisplay=0&with_inbound=Y&monitor_active=&monitor_phone=350a&ALLINGROUPstats=1&DROPINGROUPstats=0&NOLEADSalert=&CARRIERstats=1 # http://server/vicidial/AST_timeonVDADall.php?&groups[]=ALL-ACTIVE&RR=4000&DB=0&adastats=&SIPmonitorLINK=&IAXmonitorLINK=&usergroup=&UGdisplay=1&UidORname=1&orderby=timeup&SERVdisplay=0&CALLSdisplay=1&PHONEdisplay=0&CUSTPHONEdisplay=0&with_inbound=Y&monitor_active=&monitor_phone=350a&ALLINGROUPstats=1&DROPINGROUPstats=0&NOLEADSalert=&CARRIERstats=1
##### INBOUND ONLY ### ##### INBOUND ONLY ###
if (ereg('O',$with_inbound)) if (preg_match('/O/',$with_inbound))
{ {
$multi_drop++; $multi_drop++;
@@ -1502,7 +1503,7 @@ if (ereg('O',$with_inbound))
$stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);"; $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats where campaign_id IN ($closer_campaignsSQL);";
if (eregi('ALL-ACTIVE',$group_string)) if (preg_match('/ALL\-ACTIVE/i',$group_string))
{ {
$inboundSQL = "where campaign_id IN ($closer_campaignsSQL)"; $inboundSQL = "where campaign_id IN ($closer_campaignsSQL)";
$stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $inboundSQL;"; $stmtB="select sum(calls_today),sum(drops_today),sum(answers_today),max(status_category_1),sum(status_category_count_1),max(status_category_2),sum(status_category_count_2),max(status_category_3),sum(status_category_count_3),max(status_category_4),sum(status_category_count_4),sum(hold_sec_stat_one),sum(hold_sec_stat_two),sum(hold_sec_answer_calls),sum(hold_sec_drop_calls),sum(hold_sec_queue_calls) from vicidial_campaign_stats $inboundSQL;";
@@ -1624,10 +1625,10 @@ if (ereg('O',$with_inbound))
##### NOT INBOUND ONLY ### ##### NOT INBOUND ONLY ###
else else
{ {
if (eregi('ALL-ACTIVE',$group_string)) if (preg_match('/ALL\-ACTIVE/i',$group_string))
{ {
$non_inboundSQL=''; $non_inboundSQL='';
if (ereg('N',$with_inbound)) if (preg_match('/N/',$with_inbound))
{$non_inboundSQL = "and campaign_id NOT IN($ALLcloser_campaignsSQL)";} {$non_inboundSQL = "and campaign_id NOT IN($ALLcloser_campaignsSQL)";}
else else
{$non_inboundSQL = "and campaign_id IN($group_SQL,$closer_campaignsSQL)";} {$non_inboundSQL = "and campaign_id IN($group_SQL,$closer_campaignsSQL)";}
@@ -1642,7 +1643,7 @@ else
{ {
if ($DB > 0) {echo "\n|$with_inbound|$campaign_allow_inbound|\n";} if ($DB > 0) {echo "\n|$with_inbound|$campaign_allow_inbound|\n";}
if ( (ereg('Y',$with_inbound)) and ($campaign_allow_inbound > 0) ) if ( (preg_match('/Y/',$with_inbound)) and ($campaign_allow_inbound > 0) )
{ {
$multi_drop++; $multi_drop++;
if ($DB) {echo "with_inbound|$with_inbound|$campaign_allow_inbound\n";} if ($DB) {echo "with_inbound|$with_inbound|$campaign_allow_inbound\n";}
@@ -1744,10 +1745,10 @@ else
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$balanceSHORT = $row[0]; $balanceSHORT = $row[0];
if (ereg('DISABLED',$DIALmix)) if (preg_match('/DISABLED/',$DIALmix))
{ {
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses)); $DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses)); $DIALstatuses = (preg_replace('/\s/', ', ', $DIALstatuses));
} }
else else
{ {
@@ -1876,13 +1877,13 @@ else
echo "<TR>"; echo "<TR>";
echo "<TD ALIGN=LEFT COLSPAN=8>"; echo "<TD ALIGN=LEFT COLSPAN=8>";
if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) if ( (!preg_match('/NULL/i',$VSCcat1)) and (strlen($VSCcat1)>0) )
{echo "<font size=2><B>$VSCcat1:</B> &nbsp; $VSCcat1tally &nbsp; &nbsp; &nbsp; \n";} {echo "<font size=2><B>$VSCcat1:</B> &nbsp; $VSCcat1tally &nbsp; &nbsp; &nbsp; \n";}
if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) if ( (!preg_match('/NULL/i',$VSCcat2)) and (strlen($VSCcat2)>0) )
{echo "<font size=2><B>$VSCcat2:</B> &nbsp; $VSCcat2tally &nbsp; &nbsp; &nbsp; \n";} {echo "<font size=2><B>$VSCcat2:</B> &nbsp; $VSCcat2tally &nbsp; &nbsp; &nbsp; \n";}
if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) if ( (!preg_match('/NULL/i',$VSCcat3)) and (strlen($VSCcat3)>0) )
{echo "<font size=2><B>$VSCcat3:</B> &nbsp; $VSCcat3tally &nbsp; &nbsp; &nbsp; \n";} {echo "<font size=2><B>$VSCcat3:</B> &nbsp; $VSCcat3tally &nbsp; &nbsp; &nbsp; \n";}
if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) if ( (!preg_match('/NULL/i',$VSCcat4)) and (strlen($VSCcat4)>0) )
{echo "<font size=2><B>$VSCcat4:</B> &nbsp; $VSCcat4tally &nbsp; &nbsp; &nbsp; \n";} {echo "<font size=2><B>$VSCcat4:</B> &nbsp; $VSCcat4tally &nbsp; &nbsp; &nbsp; \n";}
echo "</TD></TR>"; echo "</TD></TR>";
echo "<TR>"; echo "<TR>";
@@ -1994,7 +1995,7 @@ if ( ($with_inbound != 'O') and ($NOLEADSalert == 'YES') )
################################################################################### ###################################################################################
if ($campaign_allow_inbound > 0) if ($campaign_allow_inbound > 0)
{ {
if (eregi('ALL-ACTIVE',$group_string)) if (preg_match('/ALL\-ACTIVE/i',$group_string))
{ {
$stmt="select closer_campaigns from vicidial_campaigns where active='Y' $group_SQLand"; $stmt="select closer_campaigns from vicidial_campaigns where active='Y' $group_SQLand";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -2057,7 +2058,7 @@ $parked_to_print = mysql_num_rows($rslt);
} }
} }
if (eregi("LIVE",$row[0])) if (preg_match("/LIVE/i",$row[0]))
{ {
$out_live++; $out_live++;
@@ -2077,7 +2078,7 @@ $parked_to_print = mysql_num_rows($rslt);
} }
else else
{ {
if (eregi("IVR",$row[0])) if (preg_match("/IVR/i",$row[0]))
{ {
$in_ivr++; $in_ivr++;
@@ -2095,7 +2096,7 @@ $parked_to_print = mysql_num_rows($rslt);
$k++; $k++;
} }
} }
if (eregi("CLOSER",$row[0])) if (preg_match("/CLOSER/i",$row[0]))
{$nothing=1;} {$nothing=1;}
else else
{$out_ring++;} {$out_ring++;}
@@ -2362,13 +2363,13 @@ else
} }
if ( !preg_match("/ALL-/",$LOGallowed_campaigns) ) {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";} if ( !preg_match("/ALL-/",$LOGallowed_campaigns) ) {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";}
else if ( (eregi('ALL-ACTIVE',$group_string)) and (strlen($group_SQL) < 3) ) {$UgroupSQL = '';} else if ( (preg_match('/ALL\-ACTIVE/i',$group_string)) and (strlen($group_SQL) < 3) ) {$UgroupSQL = '';}
else {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";} else {$UgroupSQL = " and vicidial_live_agents.campaign_id IN($group_SQL)";}
if (strlen($usergroup)<1) {$usergroupSQL = '';} if (strlen($usergroup)<1) {$usergroupSQL = '';}
else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";} else {$usergroupSQL = " and user_group='" . mysql_real_escape_string($usergroup) . "'";}
if ( (eregi('ALL-GROUPS',$user_group_string)) and (strlen($user_group_SQL) < 3) ) {$user_group_filter_SQL = '';} if ( (preg_match('/ALL\-GROUPS/i',$user_group_string)) and (strlen($user_group_SQL) < 3) ) {$user_group_filter_SQL = '';}
else {$user_group_filter_SQL = " and vicidial_users.user_group IN($user_group_SQL)";} else {$user_group_filter_SQL = " and vicidial_users.user_group IN($user_group_SQL)";}
$ring_agents=0; $ring_agents=0;
@@ -2469,44 +2470,44 @@ $talking_to_print = mysql_num_rows($rslt);
$i=0; $i=0;
while ($i < $talking_to_print) while ($i < $talking_to_print)
{ {
if (eregi("R/",$Aextension[$i])) if (preg_match("/R\//i",$Aextension[$i]))
{ {
$protocol = 'EXTERNAL'; $protocol = 'EXTERNAL';
$dialplan = eregi_replace('R/',"",$Aextension[$i]); $dialplan = preg_replace('/R\//i', '',$Aextension[$i]);
$dialplan = eregi_replace("\@.*",'',$dialplan); $dialplan = preg_replace('/\@.*/i', '',$dialplan);
$exten = "dialplan_number='$dialplan'"; $exten = "dialplan_number='$dialplan'";
} }
if (eregi("Local/",$Aextension[$i])) if (preg_match("/Local\//i",$Aextension[$i]))
{ {
$protocol = 'EXTERNAL'; $protocol = 'EXTERNAL';
$dialplan = eregi_replace('Local/',"",$Aextension[$i]); $dialplan = preg_replace('/Local\//i', '',$Aextension[$i]);
$dialplan = eregi_replace("\@.*",'',$dialplan); $dialplan = preg_replace('/\@.*/i', '',$dialplan);
$exten = "dialplan_number='$dialplan'"; $exten = "dialplan_number='$dialplan'";
} }
if (eregi('SIP/',$Aextension[$i])) if (preg_match('/SIP\//i',$Aextension[$i]))
{ {
$protocol = 'SIP'; $protocol = 'SIP';
$dialplan = eregi_replace('SIP/',"",$Aextension[$i]); $dialplan = preg_replace('/SIP\//i', '',$Aextension[$i]);
$dialplan = eregi_replace("-.*",'',$dialplan); $dialplan = preg_replace('/\-.*/i', '',$dialplan);
$exten = "extension='$dialplan'"; $exten = "extension='$dialplan'";
} }
if (eregi('IAX2/',$Aextension[$i])) if (preg_match('/IAX2\//i',$Aextension[$i]))
{ {
$protocol = 'IAX2'; $protocol = 'IAX2';
$dialplan = eregi_replace('IAX2/',"",$Aextension[$i]); $dialplan = preg_replace('/IAX2\//i', '',$Aextension[$i]);
$dialplan = eregi_replace("-.*",'',$dialplan); $dialplan = preg_replace('/\-.*/i', '',$dialplan);
$exten = "extension='$dialplan'"; $exten = "extension='$dialplan'";
} }
if (eregi('Zap/',$Aextension[$i])) if (preg_match('/Zap\//i',$Aextension[$i]))
{ {
$protocol = 'Zap'; $protocol = 'Zap';
$dialplan = eregi_replace('Zap/',"",$Aextension[$i]); $dialplan = preg_replace('/Zap\//i', '',$Aextension[$i]);
$exten = "extension='$dialplan'"; $exten = "extension='$dialplan'";
} }
if (eregi('DAHDI/',$Aextension[$i])) if (preg_match('/DAHDI\//i',$Aextension[$i]))
{ {
$protocol = 'Zap'; $protocol = 'Zap';
$dialplan = eregi_replace('DAHDI/',"",$Aextension[$i]); $dialplan = preg_replace('/DAHDI\//i', '',$Aextension[$i]);
$exten = "extension='$dialplan'"; $exten = "extension='$dialplan'";
} }
@@ -2545,7 +2546,7 @@ $talking_to_print = mysql_num_rows($rslt);
$custphone=''; $custphone='';
while ($n < $calls_to_list) while ($n < $calls_to_list)
{ {
if ( (ereg("$VAClead_ids[$n]", $Alead_id[$j])) and (strlen($VAClead_ids[$n]) == strlen($Alead_id[$j])) ) if ( (preg_match("/$VAClead_ids[$n]/", $Alead_id[$j])) and (strlen($VAClead_ids[$n]) == strlen($Alead_id[$j])) )
{$custphone = $VACphones[$n];} {$custphone = $VACphones[$n];}
$n++; $n++;
} }
@@ -2553,7 +2554,7 @@ $talking_to_print = mysql_num_rows($rslt);
$phone_split = explode("-----",$Alogin[$j]); $phone_split = explode("-----",$Alogin[$j]);
$i = $phone_split[1]; $i = $phone_split[1];
if (eregi("READY|PAUSED",$Astatus[$i])) if (preg_match("/READY|PAUSED/i",$Astatus[$i]))
{ {
$Acall_time[$i]=$Astate_change[$i]; $Acall_time[$i]=$Astate_change[$i];
@@ -2566,13 +2567,13 @@ $talking_to_print = mysql_num_rows($rslt);
} }
if ($non_latin < 1) if ($non_latin < 1)
{ {
$extension = eregi_replace('Local/',"",$Aextension[$i]); $extension = preg_replace('/Local\//i', '',$Aextension[$i]);
$extension = sprintf("%-14s", $extension); $extension = sprintf("%-14s", $extension);
while(strlen($extension)>14) {$extension = substr("$extension", 0, -1);} while(strlen($extension)>14) {$extension = substr("$extension", 0, -1);}
} }
else else
{ {
$extension = eregi_replace('Local/',"",$Aextension[$i]); $extension = preg_replace('/Local\//i', '',$Aextension[$i]);
$extension = sprintf("%-48s", $extension); $extension = sprintf("%-48s", $extension);
while(mb_strlen($extension, 'utf-8')>14) {$extension = mb_substr("$extension", 0, -1,'utf8');} while(mb_strlen($extension, 'utf-8')>14) {$extension = mb_substr("$extension", 0, -1,'utf8');}
} }
@@ -2597,7 +2598,7 @@ $talking_to_print = mysql_num_rows($rslt);
else else
{$pausecode='';} {$pausecode='';}
if (eregi("INCALL",$Lstatus)) if (preg_match("/INCALL/i",$Lstatus))
{ {
$stmtP="select count(*) from parked_channels where channel_group='$Acallerid[$i]';"; $stmtP="select count(*) from parked_channels where channel_group='$Acallerid[$i]';";
$rsltP=mysql_query($stmtP,$link); $rsltP=mysql_query($stmtP,$link);
@@ -2612,7 +2613,7 @@ $talking_to_print = mysql_num_rows($rslt);
} }
else else
{ {
if (!ereg("$Acallerid[$i]\|",$callerids) && !eregi("EMAIL",$comments)) if (!preg_match("/$Acallerid[$i]\|/",$callerids) && !preg_match("/EMAIL/i",$comments))
{ {
$Acall_time[$i]=$Astate_change[$i]; $Acall_time[$i]=$Astate_change[$i];
@@ -2622,13 +2623,13 @@ $talking_to_print = mysql_num_rows($rslt);
} }
} }
if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) ) if ( (preg_match("/AUTO/i",$comments)) or (strlen($comments)<1) )
{$CM='A';} {$CM='A';}
else else
{ {
if (eregi("INBOUND",$comments)) if (preg_match("/INBOUND/i",$comments))
{$CM='I';} {$CM='I';}
else if (eregi("EMAIL",$comments)) else if (preg_match("/EMAIL/i",$comments))
{$CM='E';} {$CM='E';}
else else
{$CM='M';} {$CM='M';}
@@ -2662,9 +2663,9 @@ $talking_to_print = mysql_num_rows($rslt);
while(mb_strlen($user, 'utf-8')>20) {$user = mb_substr("$user", 0, -1,'utf8');} while(mb_strlen($user, 'utf-8')>20) {$user = mb_substr("$user", 0, -1,'utf8');}
} }
} }
if (!eregi("INCALL|QUEUE|PARK|3-WAY",$Astatus[$i])) if (!preg_match("/INCALL|QUEUE|PARK|3-WAY/i",$Astatus[$i]))
{$call_time_S = ($STARTtime - $Astate_change[$i]);} {$call_time_S = ($STARTtime - $Astate_change[$i]);}
else if (eregi("3-WAY",$Astatus[$i])) else if (preg_match("/3-WAY/i",$Astatus[$i]))
{$call_time_S = ($STARTtime - $Acall_mostrecent[$i]);} {$call_time_S = ($STARTtime - $Acall_mostrecent[$i]);}
else else
{$call_time_S = ($STARTtime - $Acall_time[$i]);} {$call_time_S = ($STARTtime - $Acall_time[$i]);}
@@ -2736,9 +2737,9 @@ $talking_to_print = mysql_num_rows($rslt);
# if ( (strlen($Acall_server_ip[$i])> 4) and ($Acall_server_ip[$i] != "$Aserver_ip[$i]") ) # if ( (strlen($Acall_server_ip[$i])> 4) and ($Acall_server_ip[$i] != "$Aserver_ip[$i]") )
# {$G='<SPAN class="orange"><B>'; $EG='</B></SPAN>';} # {$G='<SPAN class="orange"><B>'; $EG='</B></SPAN>';}
if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) or (eregi("3-WAY",$status)) or (eregi("PARK",$status))) {$agent_incall++; $agent_total++;} if ( (preg_match("/INCALL/i",$status)) or (preg_match("/QUEUE/i",$status)) or (preg_match("/3-WAY/i",$status)) or (preg_match('/PARK/i',$status))) {$agent_incall++; $agent_total++;}
if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} if ( (preg_match("/READY/i",$status)) or (preg_match("/CLOSER/i",$status)) ) {$agent_ready++; $agent_total++;}
if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) if ( (preg_match("/READY/i",$status)) or (preg_match("/CLOSER/i",$status)) )
{ {
$G='<SPAN class="lightblue"><B>'; $EG='</B></SPAN>'; $G='<SPAN class="lightblue"><B>'; $EG='</B></SPAN>';
if ($call_time_S >= 60) {$G='<SPAN class="blue"><B>'; $EG='</B></SPAN>';} if ($call_time_S >= 60) {$G='<SPAN class="blue"><B>'; $EG='</B></SPAN>';}
@@ -2788,7 +2789,7 @@ $talking_to_print = mysql_num_rows($rslt);
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$vac_campaign = sprintf("%-20s", "$row[0] - $row[2]"); $vac_campaign = sprintf("%-20s", "$row[0] - $row[2]");
$row[1] = eregi_replace(".*-",'',$row[1]); $row[1] = preg_replace('/.*\-/i', '',$row[1]);
$vac_stage = sprintf("%-4s", $row[1]); $vac_stage = sprintf("%-4s", $row[1]);
} }
@@ -1,7 +1,7 @@
<?php <?php
# AST_timeonVDADallREC.php # AST_timeonVDADallREC.php
# #
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# live real-time stats for the VICIDIAL Auto-Dialer all servers # live real-time stats for the VICIDIAL Auto-Dialer all servers
# #
@@ -27,6 +27,7 @@
# 70123-1151 - Added non_latin options for substr in display variables, thanks Marin Blu # 70123-1151 - Added non_latin options for substr in display variables, thanks Marin Blu
# 70206-1140 - Added call-type statuses to display(A-Auto, M-Manual, I-Inbound/Closer) # 70206-1140 - Added call-type statuses to display(A-Auto, M-Manual, I-Inbound/Closer)
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 130610-1126 - Finalized changing of all ereg instances to preg
# #
header ("Content-type: text/html; charset=utf-8"); header ("Content-type: text/html; charset=utf-8");
@@ -115,8 +116,8 @@ return false;
$load_ave = get_server_load(true); $load_ave = get_server_load(true);
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -370,7 +371,7 @@ $CALLtime = $row[16];
$DIALtimeout = $row[17]; $DIALtimeout = $row[17];
$DIALstatuses = $row[18]; $DIALstatuses = $row[18];
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses)); $DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses)); $DIALstatuses = (preg_replace('/\s/', ', ', $DIALstatuses));
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';"; $stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
if ($group=='XXXX-ALL-ACTIVE-XXXX') if ($group=='XXXX-ALL-ACTIVE-XXXX')
@@ -510,7 +511,7 @@ echo "</FORM>\n\n";
################################################################################### ###################################################################################
###### OUTBOUND CALLS ###### OUTBOUND CALLS
################################################################################### ###################################################################################
if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) if (preg_match('/(CLOSER|BLEND|INBND|_C$|_B$|_I$)/i',$group))
{ {
$stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';"; $stmt="select closer_campaigns from vicidial_campaigns where campaign_id='" . mysql_real_escape_string($group) . "';";
if ($non_latin > 0) if ($non_latin > 0)
@@ -549,11 +550,11 @@ $parked_to_print = mysql_num_rows($rslt);
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("LIVE",$row[0])) if (preg_match("/LIVE/i",$row[0]))
{$out_live++;} {$out_live++;}
else else
{ {
if (eregi("CLOSER",$row[0])) if (preg_match("/CLOSER/i",$row[0]))
{$nothing=1;} {$nothing=1;}
else else
{$out_ring++;} {$out_ring++;}
@@ -567,7 +568,7 @@ $parked_to_print = mysql_num_rows($rslt);
if ($out_live > 9) {$F='<FONT class="r3">'; $FG='</FONT>';} if ($out_live > 9) {$F='<FONT class="r3">'; $FG='</FONT>';}
if ($out_live > 14) {$F='<FONT class="r4">'; $FG='</FONT>';} if ($out_live > 14) {$F='<FONT class="r4">'; $FG='</FONT>';}
if (eregi("(CLOSER|BLEND|INBND|_C$|_B$|_I$)",$group)) if (preg_match('/(CLOSER|BLEND|INBND|_C$|_B$|_I$)/i',$group))
{echo "$NFB$out_total$NFE current active calls&nbsp; &nbsp; &nbsp; \n";} {echo "$NFB$out_total$NFE current active calls&nbsp; &nbsp; &nbsp; \n";}
else else
{echo "$NFB$out_total$NFE calls being placed &nbsp; &nbsp; &nbsp; \n";} {echo "$NFB$out_total$NFE calls being placed &nbsp; &nbsp; &nbsp; \n";}
@@ -695,21 +696,21 @@ $talking_to_print = mysql_num_rows($rslt);
while ($i < $talking_to_print) while ($i < $talking_to_print)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("READY|PAUSED",$row[3])) if (preg_match("/READY|PAUSED/i",$row[3]))
{ {
$row[5]=$row[6]; $row[5]=$row[6];
} }
if ($non_latin < 1) if ($non_latin < 1)
{ {
$extension = eregi_replace('Local/',"",$row[0]); $extension = preg_replace('/Local\//i', '',$row[0]);
$extension = eregi_replace('IAX2/',"",$row[0]); $extension = preg_replace('/IAX2\//i', '',$row[0]);
$extension = sprintf("%-10s", $extension); $extension = sprintf("%-10s", $extension);
while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);} while(strlen($extension)>10) {$extension = substr("$extension", 0, -1);}
} }
else else
{ {
$extension = eregi_replace('Local/',"",$row[0]); $extension = preg_replace('/Local\//i', '',$row[0]);
$extension = eregi_replace('IAX2/',"",$row[0]); $extension = preg_replace('/IAX2\//i', '',$row[0]);
$extension = sprintf("%-40s", $extension); $extension = sprintf("%-40s", $extension);
while(mb_strlen($extension, 'utf-8')>10) {$extension = mb_substr("$extension", 0, -1,'utf8');} while(mb_strlen($extension, 'utf-8')>10) {$extension = mb_substr("$extension", 0, -1,'utf8');}
} }
@@ -730,13 +731,13 @@ $talking_to_print = mysql_num_rows($rslt);
$user_pass = $row[13]; $user_pass = $row[13];
if (eregi("INCALL",$Lstatus)) if (preg_match("/INCALL/i",$Lstatus))
{ {
if ( (eregi("AUTO",$comments)) or (strlen($comments)<1) ) if ( (preg_match("/AUTO/i",$comments)) or (strlen($comments)<1) )
{$CM='A';} {$CM='A';}
else else
{ {
if (eregi("INBOUND",$comments)) if (preg_match("/INBOUND/i",$comments))
{$CM='I';} {$CM='I';}
else else
{$CM='M';} {$CM='M';}
@@ -770,7 +771,7 @@ $talking_to_print = mysql_num_rows($rslt);
while(mb_strlen($user, 'utf-8')>18) {$user = mb_substr("$user", 0, -1,'utf8');} while(mb_strlen($user, 'utf-8')>18) {$user = mb_substr("$user", 0, -1,'utf8');}
} }
} }
if (!eregi("INCALL|QUEUE",$row[3])) if (!preg_match("/INCALL|QUEUE/i",$row[3]))
{$call_time_S = ($STARTtime - $row[6]);} {$call_time_S = ($STARTtime - $row[6]);}
else else
{$call_time_S = ($STARTtime - $row[5]);} {$call_time_S = ($STARTtime - $row[5]);}
@@ -792,7 +793,7 @@ $talking_to_print = mysql_num_rows($rslt);
if ($call_time_M_int >= 5) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';} if ($call_time_M_int >= 5) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
# if ($call_time_M_int >= 10) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';} # if ($call_time_M_int >= 10) {$G='<SPAN class="purple"><B>'; $EG='</B></SPAN>';}
} }
if (eregi("PAUSED",$row[3])) if (preg_match("/PAUSED/i",$row[3]))
{ {
if ($call_time_M_int >= 30) if ($call_time_M_int >= 30)
{$i++; continue;} {$i++; continue;}
@@ -808,9 +809,9 @@ $talking_to_print = mysql_num_rows($rslt);
# if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") ) # if ( (strlen($row[7])> 4) and ($row[7] != "$row[4]") )
# {$G='<SPAN class="orange"><B>'; $EG='</B></SPAN>';} # {$G='<SPAN class="orange"><B>'; $EG='</B></SPAN>';}
if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} if ( (preg_match("/INCALL/i",$status)) or (preg_match("/QUEUE/i",$status)) ) {$agent_incall++; $agent_total++;}
if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} if ( (preg_match("/READY/i",$status)) or (preg_match("/CLOSER/i",$status)) ) {$agent_ready++; $agent_total++;}
if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) if ( (preg_match("/READY/i",$status)) or (preg_match("/CLOSER/i",$status)) )
{ {
$G='<SPAN class="lightblue"><B>'; $EG='</B></SPAN>'; $G='<SPAN class="lightblue"><B>'; $EG='</B></SPAN>';
if ($call_time_M_int >= 1) {$G='<SPAN class="blue"><B>'; $EG='</B></SPAN>';} if ($call_time_M_int >= 1) {$G='<SPAN class="blue"><B>'; $EG='</B></SPAN>';}
@@ -1,7 +1,7 @@
<?php <?php
# AST_timeonVDADallSUMMARY.php # AST_timeonVDADallSUMMARY.php
# #
# Copyright (C) 2011 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers # Summary for all campaigns live real-time stats for the VICIDIAL Auto-Dialer all servers
# #
@@ -23,6 +23,7 @@
# 110110-1327 - Changed campaign real-time link to the new realtime_report.php # 110110-1327 - Changed campaign real-time link to the new realtime_report.php
# 110517-0059 - Added campaign type display option # 110517-0059 - Added campaign type display option
# 110703-1854 - Added doanload option # 110703-1854 - Added doanload option
# 130610-1120 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -78,8 +79,8 @@ if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_
} }
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
if ($DB) {$MAIN.="|$stmt|\n";} if ($DB) {$MAIN.="|$stmt|\n";}
@@ -127,7 +128,7 @@ $STARTtime = date("U");
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -268,7 +269,7 @@ $CALLtime = $row[16];
$DIALtimeout = $row[17]; $DIALtimeout = $row[17];
$DIALstatuses = $row[18]; $DIALstatuses = $row[18];
$DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses)); $DIALstatuses = (preg_replace("/ -$|^ /","",$DIALstatuses));
$DIALstatuses = (ereg_replace(' ',', ',$DIALstatuses)); $DIALstatuses = (preg_replace('/\s/', ', ', $DIALstatuses));
$stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';"; $stmt="select count(*) from vicidial_hopper where campaign_id='" . mysql_real_escape_string($group) . "';";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -372,13 +373,13 @@ $CSV_text.="\"LEADS IN HOPPER:\",\"$VDhop\",\"DROPPED PERCENT:\",\"$drpctTODAY%\
$MAIN.="<TR>"; $MAIN.="<TR>";
$MAIN.="<TD ALIGN=LEFT COLSPAN=8>"; $MAIN.="<TD ALIGN=LEFT COLSPAN=8>";
if ( (!eregi('NULL',$VSCcat1)) and (strlen($VSCcat1)>0) ) if ( (!preg_match('/NULL/i',$VSCcat1)) and (strlen($VSCcat1)>0) )
{$MAIN.="<font size=2><B>$VSCcat1:</B> &nbsp; $VSCcat1tally &nbsp; &nbsp; &nbsp; \n";} {$MAIN.="<font size=2><B>$VSCcat1:</B> &nbsp; $VSCcat1tally &nbsp; &nbsp; &nbsp; \n";}
if ( (!eregi('NULL',$VSCcat2)) and (strlen($VSCcat2)>0) ) if ( (!preg_match('/NULL/i',$VSCcat2)) and (strlen($VSCcat2)>0) )
{$MAIN.="<font size=2><B>$VSCcat2:</B> &nbsp; $VSCcat2tally &nbsp; &nbsp; &nbsp; \n";} {$MAIN.="<font size=2><B>$VSCcat2:</B> &nbsp; $VSCcat2tally &nbsp; &nbsp; &nbsp; \n";}
if ( (!eregi('NULL',$VSCcat3)) and (strlen($VSCcat3)>0) ) if ( (!preg_match('/NULL/i',$VSCcat3)) and (strlen($VSCcat3)>0) )
{$MAIN.="<font size=2><B>$VSCcat3:</B> &nbsp; $VSCcat3tally &nbsp; &nbsp; &nbsp; \n";} {$MAIN.="<font size=2><B>$VSCcat3:</B> &nbsp; $VSCcat3tally &nbsp; &nbsp; &nbsp; \n";}
if ( (!eregi('NULL',$VSCcat4)) and (strlen($VSCcat4)>0) ) if ( (!preg_match('/NULL/i',$VSCcat4)) and (strlen($VSCcat4)>0) )
{$MAIN.="<font size=2><B>$VSCcat4:</B> &nbsp; $VSCcat4tally &nbsp; &nbsp; &nbsp; \n";} {$MAIN.="<font size=2><B>$VSCcat4:</B> &nbsp; $VSCcat4tally &nbsp; &nbsp; &nbsp; \n";}
$MAIN.="</TD></TR>"; $MAIN.="</TD></TR>";
$CSV_text.="\"$VSCcat1:\",\"$VSCcat1tally\",\"$VSCcat2:\",\"$VSCcat2tally\",\"$VSCcat3:\",\"$VSCcat3tally\",\"$VSCcat4:\",\"$VSCcat4tally\"\n"; $CSV_text.="\"$VSCcat1:\",\"$VSCcat1tally\",\"$VSCcat2:\",\"$VSCcat2tally\",\"$VSCcat3:\",\"$VSCcat3tally\",\"$VSCcat4:\",\"$VSCcat4tally\"\n";
@@ -478,13 +479,13 @@ $parked_to_print = mysql_num_rows($rslt);
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("LIVE",$row[0])) if (preg_match("/LIVE/i",$row[0]))
{$out_live++;} {$out_live++;}
else else
{ {
if (eregi("IVR",$row[0])) if (preg_match("/IVR/i",$row[0]))
{$in_ivr++;} {$in_ivr++;}
if (eregi("CLOSER",$row[0])) if (preg_match("/CLOSER/i",$row[0]))
{$nothing=1;} {$nothing=1;}
else else
{$out_ring++;} {$out_ring++;}
@@ -541,13 +542,13 @@ $talking_to_print = mysql_num_rows($rslt);
while ($i < $talking_to_print) while ($i < $talking_to_print)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("READY|PAUSED",$row[3])) if (preg_match("/READY|PAUSED/i",$row[3]))
{ {
$row[5]=$row[6]; $row[5]=$row[6];
} }
$Lstatus = $row[3]; $Lstatus = $row[3];
$status = sprintf("%-6s", $row[3]); $status = sprintf("%-6s", $row[3]);
if (!eregi("INCALL|QUEUE",$row[3])) if (!preg_match("/INCALL|QUEUE/i",$row[3]))
{$call_time_S = ($STARTtime - $row[6]);} {$call_time_S = ($STARTtime - $row[6]);}
else else
{$call_time_S = ($STARTtime - $row[5]);} {$call_time_S = ($STARTtime - $row[5]);}
@@ -562,7 +563,7 @@ $talking_to_print = mysql_num_rows($rslt);
$call_time_MS = "$call_time_M_int:$call_time_SEC"; $call_time_MS = "$call_time_M_int:$call_time_SEC";
$call_time_MS = sprintf("%7s", $call_time_MS); $call_time_MS = sprintf("%7s", $call_time_MS);
$G = ''; $EG = ''; $G = ''; $EG = '';
if (eregi("PAUSED",$row[3])) if (preg_match("/PAUSED/i",$row[3]))
{ {
if ($call_time_M_int >= 30) if ($call_time_M_int >= 30)
{$i++; continue;} {$i++; continue;}
@@ -572,8 +573,8 @@ $talking_to_print = mysql_num_rows($rslt);
} }
} }
if ( (eregi("INCALL",$status)) or (eregi("QUEUE",$status)) ) {$agent_incall++; $agent_total++;} if ( (preg_match("/INCALL/i",$status)) or (preg_match("/QUEUE/i",$status)) ) {$agent_incall++; $agent_total++;}
if ( (eregi("READY",$status)) or (eregi("CLOSER",$status)) ) {$agent_ready++; $agent_total++;} if ( (preg_match("/READY/i",$status)) or (preg_match("/CLOSER/i",$status)) ) {$agent_ready++; $agent_total++;}
$agentcount++; $agentcount++;
@@ -1,13 +1,14 @@
<?php <?php
# AST_timeonpark.php # AST_timeonpark.php
# #
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# CHANGES # CHANGES
# #
# 60620-1042 - Added variable filtering to eliminate SQL injection attack threat # 60620-1042 - Added variable filtering to eliminate SQL injection attack threat
# - Added required user/pass to gain access to this page # - Added required user/pass to gain access to this page
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 130610-1132 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -24,8 +25,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -10,6 +10,7 @@
# #
# 120526-0803 - First build # 120526-0803 - First build
# 130414-0145 - Added report logging # 130414-0145 - Added report logging
# 130610-0957 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -54,8 +55,8 @@ if ($qm_conf_ct > 0)
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
if ($DB) {$HTML_text.="|$stmt|\n";} if ($DB) {$HTML_text.="|$stmt|\n";}
@@ -132,7 +133,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -143,7 +144,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
####################################### #######################################
for ($i=0; $i<count($user_group); $i++) for ($i=0; $i<count($user_group); $i++)
{ {
if (eregi("--ALL--", $user_group[$i])) {$all_user_groups=1; $user_group="";} if (preg_match('/\-\-ALL\-\-/', $user_group[$i])) {$all_user_groups=1; $user_group="";}
} }
$stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;"; $stmt="select user_group from vicidial_user_groups $whereLOGadmin_viewable_groupsSQL order by user_group;";
@@ -177,11 +178,11 @@ while($i < $user_group_ct)
$i++; $i++;
} }
if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$user_group_string) ) or ($user_group_ct < 1) )
{$user_group_SQL = "";} {$user_group_SQL = "";}
else else
{ {
$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = preg_replace('/,$/i', '',$user_group_SQL);
#$user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)"; #$user_group_SQL = "and vicidial_agent_log.user_group IN($user_group_SQL)";
} }
###################################### ######################################
@@ -213,14 +214,14 @@ $HTML_text.="<INPUT TYPE=HIDDEN NAME=type VALUE=\"$type\">\n";
$HTML_text.="</TD><TD VALIGN=TOP>Teams/User Groups:<BR>"; $HTML_text.="</TD><TD VALIGN=TOP>Teams/User Groups:<BR>";
$HTML_text.="<SELECT SIZE=5 NAME=user_group[] multiple>\n"; $HTML_text.="<SELECT SIZE=5 NAME=user_group[] multiple>\n";
if (eregi("--ALL--",$user_group_string)) if (preg_match('/\-\-ALL\-\-/',$user_group_string))
{$HTML_text.="<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";} {$HTML_text.="<option value=\"--ALL--\" selected>-- ALL USER GROUPS --</option>\n";}
else else
{$HTML_text.="<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";} {$HTML_text.="<option value=\"--ALL--\">-- ALL USER GROUPS --</option>\n";}
$o=0; $o=0;
while ($user_groups_to_print > $o) while ($user_groups_to_print > $o)
{ {
if (eregi("\|$user_groups[$o]\|",$user_group_string)) if (preg_match("/\|$user_groups[$o]\|/i",$user_group_string))
{$HTML_text.="<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";} {$HTML_text.="<option selected value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
else else
{$HTML_text.="<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";} {$HTML_text.="<option value=\"$user_groups[$o]\">$user_groups[$o]</option>\n";}
@@ -1,16 +1,17 @@
<?php <?php
# QM_live_monitor.php # QM_live_monitor.php
# #
# Copyright (C) 2009 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# Script to initiate live monitoring from QueueMetrics link # Script to initiate live monitoring from QueueMetrics link
# #
# CHANGELOG: # CHANGELOG:
# 90529-2115 - First Build # 90529-2115 - First Build
# 130610-1130 - Finalized changing of all ereg instances to preg
# #
$version = '2.2.0-1'; $version = '2.8-2';
$build = '90529-2115'; $build = '130610-1130';
header ("Content-type: text/html; charset=utf-8"); header ("Content-type: text/html; charset=utf-8");
@@ -87,16 +88,16 @@ if ($enable_queuemetrics_logging > 0)
$script_name = getenv("SCRIPT_NAME"); $script_name = getenv("SCRIPT_NAME");
$server_name = getenv("SERVER_NAME"); $server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT"); $server_port = getenv("SERVER_PORT");
if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';} else {$HTTPprotocol = 'http://';}
$admDIR = "$HTTPprotocol$server_name$script_name"; $admDIR = "$HTTPprotocol$server_name$script_name";
$admDIR = eregi_replace('QM_live_monitor.php','',$admDIR); $admDIR = preg_replace('/QM_live_monitor\.php/i', '',$admDIR);
$monitor_script = 'non_agent_api.php'; $monitor_script = 'non_agent_api.php';
$monitorURL = "$admDIR$monitor_script?source=queuemetrics&function=blind_monitor&user=$user&pass=$call&phone_login=$extension&session_id=$session&server_ip=$server_ip&stage=$stage"; $monitorURL = "$admDIR$monitor_script?source=queuemetrics&function=blind_monitor&user=$user&pass=$call&phone_login=$extension&session_id=$session&server_ip=$server_ip&stage=$stage";
$monitorCONTENTS = file("$monitorURL"); $monitorCONTENTS = file("$monitorURL");
if (eregi('SUCCESS',$monitorCONTENTS[0])) if (preg_match('/SUCCESS/i',$monitorCONTENTS[0]))
{ {
echo "<HTML><BODY BGCOLOR=\"E6E6E6\" onLoad=\"javascript:window.close();\">\n"; echo "<HTML><BODY BGCOLOR=\"E6E6E6\" onLoad=\"javascript:window.close();\">\n";
} }
File diff suppressed because it is too large Load Diff
@@ -1,7 +1,7 @@
<?php <?php
# admin_campaign_multi_alt.php # admin_campaign_multi_alt.php
# #
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# this screen will control the campaign settings needed for alternate number # this screen will control the campaign settings needed for alternate number
# dialing using multiple leads with the same account number and different phone # dialing using multiple leads with the same account number and different phone
@@ -13,10 +13,11 @@
# 110317-1219 - First Build # 110317-1219 - First Build
# 110406-1818 - Updated logging # 110406-1818 - Updated logging
# 120223-2335 - Removed logging of good login passwords if webroot writable is enabled # 120223-2335 - Removed logging of good login passwords if webroot writable is enabled
# 130610-1116 - Finalized changing of all ereg instances to preg
# #
$admin_version = '2.4-3'; $admin_version = '2.8-4';
$build = '120223-2335'; $build = '130610-1116';
require("dbconnect.php"); require("dbconnect.php");
@@ -61,16 +62,16 @@ if ($ss_conf_ct > 0)
if ($non_latin < 1) if ($non_latin < 1)
{ {
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_PW);
$campaign_id = ereg_replace("[^-_0-9a-zA-Z]","",$campaign_id); $campaign_id = preg_replace('/[^-_0-9a-zA-Z]/','',$campaign_id);
$lead_order_randomize = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_randomize); $lead_order_randomize = preg_replace('/[^-_0-9a-zA-Z]/','',$lead_order_randomize);
$lead_order_secondary = ereg_replace("[^-_0-9a-zA-Z]","",$lead_order_secondary); $lead_order_secondary = preg_replace('/[^-_0-9a-zA-Z]/','',$lead_order_secondary);
} # end of non_latin } # end of non_latin
else else
{ {
$PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW);
} }
$STARTtime = date("U"); $STARTtime = date("U");
@@ -189,7 +190,7 @@ $o=0;
while ($lists_to_print > $o) while ($lists_to_print > $o)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (ereg('Y',$row[1])) if (preg_match('/Y/',$row[1]))
{ {
$active_lists++; $active_lists++;
$camp_lists .= "'$row[0]',"; $camp_lists .= "'$row[0]',";
@@ -201,7 +202,7 @@ while ($lists_to_print > $o)
} }
$o++; $o++;
} }
$camp_lists = eregi_replace(".$","",$camp_lists); $camp_lists = preg_replace('/.$/i','',$camp_lists);;
@@ -266,7 +267,7 @@ if ($action == "ALT_MULTI_SUBMIT")
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$filter_stmt|$update_stmts|"; $SQL_log = "$stmt|$filter_stmt|$update_stmts|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='MODIFY CAMPAIGN MULTI LEAD', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CAMPAIGNS', event_type='MODIFY', record_id='$campaign_id', event_code='MODIFY CAMPAIGN MULTI LEAD', event_sql=\"$SQL_log\", event_notes='';";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -376,7 +377,7 @@ if ($action == "BLANK")
while (list($owner,) = each($lead_list[$since_reset])) while (list($owner,) = each($lead_list[$since_reset]))
{ {
$owner_var = preg_replace('/ |\n|\r|\t/','',$owner); $owner_var = preg_replace('/ |\n|\r|\t/','',$owner);
if (eregi("1$|3$|5$|7$|9$", $o)) if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -9,10 +9,11 @@
# 121214-2245 - First Build # 121214-2245 - First Build
# 130102-1131 - Small admin log change # 130102-1131 - Small admin log change
# 130221-1754 - Added level 8 disable add feature # 130221-1754 - Added level 8 disable add feature
# 130610-1041 - Changed all ereg to preg
# #
$admin_version = '2.6-3'; $admin_version = '2.8-4';
$build = '130221-1754'; $build = '130610-1041';
$sh="emails"; $sh="emails";
@@ -123,24 +124,24 @@ if ($qm_conf_ct > 0)
if ($non_latin < 1) if ($non_latin < 1)
{ {
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace("/[^-_0-9a-zA-Z]/", "",$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace("/[^-_0-9a-zA-Z]/", "",$PHP_AUTH_PW);
$email_account_id = ereg_replace("[^_0-9a-zA-Z]","",$email_account_id); $email_account_id = preg_replace("/[^_0-9a-zA-Z]/","",$email_account_id);
$email_account_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$email_account_name); $email_account_name = preg_replace("/[^ \.\,-\_0-9a-zA-Z]/","",$email_account_name);
$email_account_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$email_account_description); $email_account_description = preg_replace("/[^ \.\,-\_0-9a-zA-Z]/","",$email_account_description);
$user_group = ereg_replace("[^_0-9a-zA-Z]","",$user_group); $user_group = preg_replace("/[^_0-9a-zA-Z]/","",$user_group);
$protocol = ereg_replace("[^_0-9a-zA-Z]","",$protocol); $protocol = preg_replace("/[^_0-9a-zA-Z]/","",$protocol);
$email_account_server = ereg_replace("[^\.\-\_0-9a-zA-Z]","",$email_account_server); $email_account_server = preg_replace("/[^\.\-\_0-9a-zA-Z]/","",$email_account_server);
$active = ereg_replace("[^_0-9a-zA-Z]","",$active); $active = preg_replace("/[^_0-9a-zA-Z]/","",$active);
$email_frequency_check_mins = preg_replace("/^0-9/","",$email_frequency_check_mins); $email_frequency_check_mins = preg_replace("/[^0-9]/","",$email_frequency_check_mins);
$list_id = ereg_replace("[^0-9]","",$list_id); $list_id = preg_replace("/[^0-9]/","",$list_id);
} # end of non_latin } # end of non_latin
else else
{ {
$PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW);
} }
$STARTtime = date("U"); $STARTtime = date("U");
@@ -198,7 +199,7 @@ else
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
$valLOGadmin_viewable_groupsSQL=''; $valLOGadmin_viewable_groupsSQL='';
$vmLOGadmin_viewable_groupsSQL=''; $vmLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match("/\-\-ALL\-\-/i",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -364,7 +365,7 @@ if (($SUBMIT=="SUBMIT" || $SUBMIT=="UPDATE") && $email_account_id)
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$ins_stmt|"; $SQL_log = "$ins_stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/','',$SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date=now(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='EMAIL', event_type='ADD', record_id='$user', event_code='NEW EMAIL ACCOUNT ADDED', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date=now(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='EMAIL', event_type='ADD', record_id='$user', event_code='NEW EMAIL ACCOUNT ADDED', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -388,7 +389,7 @@ if (($SUBMIT=="SUBMIT" || $SUBMIT=="UPDATE") && $email_account_id)
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$upd_stmt|"; $SQL_log = "$upd_stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/','',$SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date=now(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='EMAIL', event_type='MODIFY', record_id='$email_account_id', event_code='EMAIL ACCOUNT MODIFIED', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date=now(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='EMAIL', event_type='MODIFY', record_id='$email_account_id', event_code='EMAIL ACCOUNT MODIFIED', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -424,7 +425,7 @@ else if ($SUBMIT=="COPY")
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$ins_stmt|"; $SQL_log = "$ins_stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/','',$SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date=now(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='EMAIL', event_type='ADD', record_id='$user', event_code='NEW EMAIL ACCOUNT ADDED', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date=now(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='EMAIL', event_type='ADD', record_id='$user', event_code='NEW EMAIL ACCOUNT ADDED', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -470,7 +471,7 @@ if ($eact == "COPY")
echo "$accounts_list"; echo "$accounts_list";
echo "</select></td></tr>\n"; echo "</select></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>New Account ID: </td><td align=left><input type=text name=new_account_id value='$new_account_id' size=10 maxlength=20></td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>New Account ID: </td><td align=left><input type=text name=new_account_id value='$new_account_id' size=10 maxlength=20></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>New Account Name: </td><td align=left><input type=text name=email_account_name size=40 maxlength=100>$NWB#vicidial_email_accounts-carrier_name$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>New Account Name: </td><td align=left><input type=text name=email_account_name size=40 maxlength=100>$NWB#email_accounts-carrier_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value='COPY'></td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value='COPY'></td></tr>\n";
echo "</TABLE></center>\n"; echo "</TABLE></center>\n";
echo "</TD></TR></TABLE>\n"; echo "</TD></TR></TABLE>\n";
@@ -583,20 +584,20 @@ else if ($eact == "ADD")
echo "<br>ADD NEW INBOUND EMAIL ACCOUNT<form action='$PHP_SELF' method='GET'>\n"; echo "<br>ADD NEW INBOUND EMAIL ACCOUNT<form action='$PHP_SELF' method='GET'>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account ID: </td><td align=left><input type=text name=email_account_id size=15 maxlength=20 value='$email_account_id'>$NWB#vicidial_email_accounts-email_account_id$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account ID: </td><td align=left><input type=text name=email_account_id size=15 maxlength=20 value='$email_account_id'>$NWB#email_accounts-email_account_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Name: </td><td align=left><input type=text name=email_account_name size=40 maxlength=100 value='$email_account_name'>$NWB#vicidial_email_accounts-email_account_name$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Name: </td><td align=left><input type=text name=email_account_name size=40 maxlength=100 value='$email_account_name'>$NWB#email_accounts-email_account_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option SELECTED>N</option></select>$NWB#vicidial_email_accounts-email_account_active$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active><option>Y</option><option SELECTED>N</option></select>$NWB#email_accounts-email_account_active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Description: </td><td align=left><input type=text name=email_account_description size=70 maxlength=255 value='$email_account_description'>$NWB#vicidial_email_accounts-email_account_description$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Description: </td><td align=left><input type=text name=email_account_description size=70 maxlength=255 value='$email_account_description'>$NWB#email_accounts-email_account_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Type: </td><td align=left><select size=1 name=email_account_type><option>INBOUND</option></select>$NWB#vicidial_email_accounts-email_account_type$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Type: </td><td align=left><select size=1 name=email_account_type><option>INBOUND</option></select>$NWB#email_accounts-email_account_type$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Admin User Group: </td><td align=left><select size=1 name=user_group>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Admin User Group: </td><td align=left><select size=1 name=user_group>\n";
echo "$UUgroups_list"; echo "$UUgroups_list";
echo "<option SELECTED value=\"---ALL---\">All Admin User Groups</option>\n"; echo "<option SELECTED value=\"---ALL---\">All Admin User Groups</option>\n";
echo "</select>$NWB#vicidial_email_accounts-admin_user_group$NWE</td></tr>\n"; echo "</select>$NWB#email_accounts-admin_user_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Protocol: </td><td align=left><select size=1 name=protocol><option SELECTED>IMAP</option><option>POP3</option></select>$NWB#vicidial_email_accounts-protocol$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Protocol: </td><td align=left><select size=1 name=protocol><option SELECTED>IMAP</option><option>POP3</option></select>$NWB#email_accounts-protocol$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Reply-to Address: </td><td align=left><input type=text name=email_replyto_address size=70 maxlength=255 value='$email_replyto_address'>$NWB#vicidial_email_accounts-email_replyto_address$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Reply-to Address: </td><td align=left><input type=text name=email_replyto_address size=70 maxlength=255 value='$email_replyto_address'>$NWB#email_accounts-email_replyto_address$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Server: </td><td align=left><input type=text name=email_account_server size=70 maxlength=255 value='$email_account_server'>$NWB#vicidial_email_accounts-email_account_server$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Server: </td><td align=left><input type=text name=email_account_server size=70 maxlength=255 value='$email_account_server'>$NWB#email_accounts-email_account_server$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account User: </td><td align=left><input type=text name=email_account_user size=30 maxlength=255 value='$email_account_user'>$NWB#vicidial_email_accounts-email_account_user$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account User: </td><td align=left><input type=text name=email_account_user size=30 maxlength=255 value='$email_account_user'>$NWB#email_accounts-email_account_user$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Password: </td><td align=left><input type=text name=email_account_pass size=30 maxlength=100 value='$email_account_pass'>$NWB#vicidial_email_accounts-email_account_pass$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Password: </td><td align=left><input type=text name=email_account_pass size=30 maxlength=100 value='$email_account_pass'>$NWB#email_accounts-email_account_pass$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Frequency Check Rate (mins): </td><td align=left><select name='email_frequency_check_mins'>"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Frequency Check Rate (mins): </td><td align=left><select name='email_frequency_check_mins'>";
$i=5; $i=5;
while ($i<=60) while ($i<=60)
@@ -604,20 +605,20 @@ else if ($eact == "ADD")
echo "<option value='$i'>$i</option>"; echo "<option value='$i'>$i</option>";
$i+=5; $i+=5;
} }
echo "</select>$NWB#vicidial_email_accounts-email_frequency_check_mins$NWE</td></tr>\n"; echo "</select>$NWB#email_accounts-email_frequency_check_mins$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"admin.php?ADD=1000\">In-Group ID</a>: </td><td align=left><select size=1 name=group_id>"; echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"admin.php?ADD=1000\">In-Group ID</a>: </td><td align=left><select size=1 name=group_id>";
echo "$Dgroups_menu"; echo "$Dgroups_menu";
echo "</select>$NWB#vicidial_email_accounts-in_group$NWE</td></tr>\n"; echo "</select>$NWB#email_accounts-in_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"admin.php?ADD=1000\">Default List ID</a>: </td><td align=left><input type=text name=default_list_id size=20 maxlength=255 value='$default_list_id'>$NWB#vicidial_email_accounts-default_list_id$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"admin.php?ADD=1000\">Default List ID</a>: </td><td align=left><input type=text name=default_list_id size=20 maxlength=255 value='$default_list_id'>$NWB#email_accounts-default_list_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Call Handle Method: </td><td align=left><select size=1 name=call_handle_method><option>EMAIL</option><option>EMAILLOOKUP</option><option>EMAILLOOKUPRL</option><option>EMAILLOOKUPRC</option><option SELECTED>$call_handle_method</option></select>$NWB#vicidial_email_accounts-call_handle_method$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Call Handle Method: </td><td align=left><select size=1 name=call_handle_method><option>EMAIL</option><option>EMAILLOOKUP</option><option>EMAILLOOKUPRL</option><option>EMAILLOOKUPRC</option><option SELECTED>$call_handle_method</option></select>$NWB#email_accounts-call_handle_method$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Agent Search Method: </td><td align=left><select size=1 name=agent_search_method><option value=\"LB\">LB - Load Balanced</option><option value=\"LO\">LO - Load Balanced Overflow</option><option value=\"SO\">SO - Server Only</option><option SELECTED>$agent_search_method</option></select>$NWB#vicidial_email_accounts-agent_search_method$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Agent Search Method: </td><td align=left><select size=1 name=agent_search_method><option value=\"LB\">LB - Load Balanced</option><option value=\"LO\">LO - Load Balanced Overflow</option><option value=\"SO\">SO - Server Only</option><option SELECTED>$agent_search_method</option></select>$NWB#email_accounts-agent_search_method$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group List ID: </td><td align=left><input type=text name=list_id size=14 maxlength=14 value=\"$list_id\">$NWB#vicidial_email_accounts-ingroup_list_id$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>In-Group List ID: </td><td align=left><input type=text name=list_id size=14 maxlength=14 value=\"$list_id\">$NWB#email_accounts-ingroup_list_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Campaign ID: </td><td align=left><select size=1 name=campaign_id>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Campaign ID: </td><td align=left><select size=1 name=campaign_id>\n";
echo "$campaigns_list"; echo "$campaigns_list";
echo "<option SELECTED>$campaign_id</option>\n"; echo "<option SELECTED>$campaign_id</option>\n";
echo "</select>$NWB#vicidial_email_accounts-ingroup_campaign_id$NWE</td></tr>\n"; echo "</select>$NWB#email_accounts-ingroup_campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT VALUE=SUBMIT><input type=hidden name='eact' value='ADD'></td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT VALUE=SUBMIT><input type=hidden name='eact' value='ADD'></td></tr>\n";
echo "</TABLE></center></form>\n"; echo "</TABLE></center></form>\n";
@@ -763,23 +764,23 @@ else if (($eact=="DELETE" || $eact=="UPDATE") && $email_account_id)
echo "<br>UPDATE AN EXISTING INBOUND EMAIL ACCOUNT<form action='$PHP_SELF' method='GET'>\n"; echo "<br>UPDATE AN EXISTING INBOUND EMAIL ACCOUNT<form action='$PHP_SELF' method='GET'>\n";
echo "<center><TABLE width=$section_width cellspacing=3>\n"; echo "<center><TABLE width=$section_width cellspacing=3>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account ID: </td><td align=left><input type=hidden name=email_account_id value='$email_account_id'><B>$email_account_id$NWB#vicidial_email_accounts-email_account_id$NWE</B></td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account ID: </td><td align=left><input type=hidden name=email_account_id value='$email_account_id'><B>$email_account_id$NWB#email_accounts-email_account_id$NWE</B></td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Name: </td><td align=left><input type=text name=email_account_name size=40 maxlength=100 value='$email_account_name'>$NWB#vicidial_email_accounts-email_account_name$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Name: </td><td align=left><input type=text name=email_account_name size=40 maxlength=100 value='$email_account_name'>$NWB#email_accounts-email_account_name$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active>"; echo "<tr bgcolor=#B6D3FC><td align=right>Active: </td><td align=left><select size=1 name=active>";
echo "<option value='$active' selected>$active</option>"; echo "<option value='$active' selected>$active</option>";
echo "<option>Y</option><option>N</option></select>$NWB#vicidial_email_accounts-email_account_active$NWE</td></tr>\n"; echo "<option>Y</option><option>N</option></select>$NWB#email_accounts-email_account_active$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Description: </td><td align=left><input type=text name=email_account_description size=70 maxlength=255 value='$email_account_description'>$NWB#vicidial_email_accounts-email_account_description$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Description: </td><td align=left><input type=text name=email_account_description size=70 maxlength=255 value='$email_account_description'>$NWB#email_accounts-email_account_description$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Type: </td><td align=left><select size=1 name=email_account_type><option value='$email_account_type' selected>$email_account_type</option><option>INBOUND</option></select>$NWB#vicidial_email_accounts-email_account_type$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Type: </td><td align=left><select size=1 name=email_account_type><option value='$email_account_type' selected>$email_account_type</option><option>INBOUND</option></select>$NWB#email_accounts-email_account_type$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Admin User Group: </td><td align=left><select size=1 name=user_group>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Admin User Group: </td><td align=left><select size=1 name=user_group>\n";
echo "<option value='$user_group' selected>$user_group</option>"; echo "<option value='$user_group' selected>$user_group</option>";
echo "$UUgroups_list"; echo "$UUgroups_list";
echo "<option SELECTED value=\"---ALL---\">All Admin User Groups</option>\n"; echo "<option SELECTED value=\"---ALL---\">All Admin User Groups</option>\n";
echo "</select>$NWB#vicidial_email_accounts-admin_user_group$NWE</td></tr>\n"; echo "</select>$NWB#email_accounts-admin_user_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Protocol: </td><td align=left><select size=1 name=protocol><option>IMAP</option><option>POP3</option><option SELECTED>$protocol</option></select>$NWB#vicidial_email_accounts-protocol$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Protocol: </td><td align=left><select size=1 name=protocol><option>IMAP</option><option>POP3</option><option SELECTED>$protocol</option></select>$NWB#email_accounts-protocol$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Reply-to Address: </td><td align=left><input type=text name=email_replyto_address size=70 maxlength=255 value='$email_replyto_address'>$NWB#vicidial_email_accounts-email_replyto_address$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Reply-to Address: </td><td align=left><input type=text name=email_replyto_address size=70 maxlength=255 value='$email_replyto_address'>$NWB#email_accounts-email_replyto_address$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Server: </td><td align=left><input type=text name=email_account_server size=70 maxlength=255 value='$email_account_server'>$NWB#vicidial_email_accounts-email_account_server$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Server: </td><td align=left><input type=text name=email_account_server size=70 maxlength=255 value='$email_account_server'>$NWB#email_accounts-email_account_server$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account User: </td><td align=left><input type=text name=email_account_user size=30 maxlength=255 value='$email_account_user'>$NWB#vicidial_email_accounts-email_account_user$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account User: </td><td align=left><input type=text name=email_account_user size=30 maxlength=255 value='$email_account_user'>$NWB#email_accounts-email_account_user$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Password: </td><td align=left><input type=text name=email_account_pass size=30 maxlength=100 value='$email_account_pass'>$NWB#vicidial_email_accounts-email_account_pass$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Account Password: </td><td align=left><input type=text name=email_account_pass size=30 maxlength=100 value='$email_account_pass'>$NWB#email_accounts-email_account_pass$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Email Frequency Check Rate (mins): </td><td align=left><select name='email_frequency_check_mins'>"; echo "<tr bgcolor=#B6D3FC><td align=right>Email Frequency Check Rate (mins): </td><td align=left><select name='email_frequency_check_mins'>";
echo "<option value='$email_frequency_check_mins' selected>$email_frequency_check_mins</option>"; echo "<option value='$email_frequency_check_mins' selected>$email_frequency_check_mins</option>";
$i=5; $i=5;
@@ -788,21 +789,21 @@ else if (($eact=="DELETE" || $eact=="UPDATE") && $email_account_id)
echo "<option value='$i'>$i</option>"; echo "<option value='$i'>$i</option>";
$i+=5; $i+=5;
} }
echo "</select>$NWB#vicidial_email_accounts-email_frequency_check_mins$NWE</td></tr>\n"; echo "</select>$NWB#email_accounts-email_frequency_check_mins$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"admin.php?ADD=3811&group_id=$group_id\">In-Group ID</a>: </td><td align=left><select size=1 name=group_id>"; echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"admin.php?ADD=3811&group_id=$group_id\">In-Group ID</a>: </td><td align=left><select size=1 name=group_id>";
echo "$Dgroups_menu"; echo "$Dgroups_menu";
echo "<option value='$group_id' selected>$group_id</option></select>$NWB#vicidial_email_accounts-in_group$NWE</td></tr>\n"; echo "<option value='$group_id' selected>$group_id</option></select>$NWB#email_accounts-in_group$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"admin.php?ADD=1000\">Default List ID</a>: </td><td align=left><input type=text name=default_list_id size=20 maxlength=255 value='$default_list_id'>$NWB#vicidial_email_accounts-default_list_id$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right><a href=\"admin.php?ADD=1000\">Default List ID</a>: </td><td align=left><input type=text name=default_list_id size=20 maxlength=255 value='$default_list_id'>$NWB#email_accounts-default_list_id$NWE</td></tr>\n";
############### ###############
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Call Handle Method: </td><td align=left><select size=1 name=call_handle_method><option>EMAIL</option><option>EMAILLOOKUP</option><option>EMAILLOOKUPRL</option><option>EMAILLOOKUPRC</option><option SELECTED>$call_handle_method</option></select>$NWB#vicidial_email_accounts-call_handle_method$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Call Handle Method: </td><td align=left><select size=1 name=call_handle_method><option>EMAIL</option><option>EMAILLOOKUP</option><option>EMAILLOOKUPRL</option><option>EMAILLOOKUPRC</option><option SELECTED>$call_handle_method</option></select>$NWB#email_accounts-call_handle_method$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Agent Search Method: </td><td align=left><select size=1 name=agent_search_method><option value=\"LB\">LB - Load Balanced</option><option value=\"LO\">LO - Load Balanced Overflow</option><option value=\"SO\">SO - Server Only</option><option SELECTED>$agent_search_method</option></select>$NWB#vicidial_email_accounts-agent_search_method$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Agent Search Method: </td><td align=left><select size=1 name=agent_search_method><option value=\"LB\">LB - Load Balanced</option><option value=\"LO\">LO - Load Balanced Overflow</option><option value=\"SO\">SO - Server Only</option><option SELECTED>$agent_search_method</option></select>$NWB#email_accounts-agent_search_method$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group List ID: </td><td align=left><input type=text name=list_id size=14 maxlength=14 value=\"$list_id\">$NWB#vicidial_email_accounts-ingroup_list_id$NWE</td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>In-Group List ID: </td><td align=left><input type=text name=list_id size=14 maxlength=14 value=\"$list_id\">$NWB#email_accounts-ingroup_list_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Campaign ID: </td><td align=left><select size=1 name=campaign_id>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>In-Group Campaign ID: </td><td align=left><select size=1 name=campaign_id>\n";
echo "$campaigns_list"; echo "$campaigns_list";
echo "<option SELECTED>$campaign_id</option>\n"; echo "<option SELECTED>$campaign_id</option>\n";
echo "</select>$NWB#vicidial_email_accounts-ingroup_campaign_id$NWE</td></tr>\n"; echo "</select>$NWB#email_accounts-ingroup_campaign_id$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=right>Un-handled Emails: </td><td align=left><B>$unhandled_emails</B></td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=right>Un-handled Emails: </td><td align=left><B>$unhandled_emails</B></td></tr>\n";
################ ################
@@ -853,7 +854,7 @@ else
$ct_row=mysql_fetch_row($ct_rslt); $ct_row=mysql_fetch_row($ct_rslt);
$unhandled_emails=$ct_row[0]; $unhandled_emails=$ct_row[0];
if (eregi("1$|3$|5$|7$|9$", $o)) if (preg_match("/1$|3$|5$|7$|9$/i", $o))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
+5 -4
View File
@@ -41,6 +41,7 @@
# 121123-0911 - Added Call Times Holidays Inbound functionality # 121123-0911 - Added Call Times Holidays Inbound functionality
# 121214-2238 - Added email menus # 121214-2238 - Added email menus
# 130221-1830 - Added Level 8 disable add option # 130221-1830 - Added Level 8 disable add option
# 130610-1040 - Finalized changing of all ereg instances to preg
# #
@@ -49,7 +50,7 @@ if($short_header)
{ {
?> ?>
<TABLE CELLPADDING=0 CELLSPACING=0 BGCOLOR="#015B91"><TR> <TABLE CELLPADDING=0 CELLSPACING=0 BGCOLOR="#015B91"><TR>
<TD><IMG SRC="vicidial_admin_web_logo_small.gif" WIDTH=71 HEIGHT=22> &nbsp; </TD> <TD><IMG SRC="vicidial_admin_web_logo_small.gif" WIDTH=71 HEIGHT=22 ALT="System logo"> &nbsp; </TD>
<?php if ($reports_only_user < 1) { <?php if ($reports_only_user < 1) {
?> ?>
<TD> &nbsp; <A HREF="admin.php" ALT="Users"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Users</B></A> &nbsp; </TD> <TD> &nbsp; <A HREF="admin.php" ALT="Users"><FONT FACE="ARIAL,HELVETICA" COLOR=WHITE SIZE=2><B>Users</B></A> &nbsp; </TD>
@@ -206,7 +207,7 @@ if ($TCedit_javascript > 0)
###################### ######################
# ADD=31 or 34 and SUB=29 for list mixes # ADD=31 or 34 and SUB=29 for list mixes
###################### ######################
if ( ( ($ADD==34) or ($ADD==31) or ($ADD==49) ) and ($SUB==29) and ($LOGmodify_campaigns==1) and ( (eregi("$campaign_id",$LOGallowed_campaigns)) or (eregi("ALL-CAMPAIGNS",$LOGallowed_campaigns)) ) ) if ( ( ($ADD==34) or ($ADD==31) or ($ADD==49) ) and ($SUB==29) and ($LOGmodify_campaigns==1) and ( (preg_match("/$campaign_id/i", $LOGallowed_campaigns)) or (preg_match("/ALL\-CAMPAIGNS/i",$LOGallowed_campaigns)) ) )
{ {
?> ?>
@@ -1076,7 +1077,7 @@ $SSlevel_8_disable_add = $row[5];
<TABLE BGCOLOR=white cellpadding=0 cellspacing=0> <TABLE BGCOLOR=white cellpadding=0 cellspacing=0>
<!-- BEGIN SIDEBAR NAVIGATION --> <!-- BEGIN SIDEBAR NAVIGATION -->
<TR><TD VALIGN=TOP WIDTH=170 BGCOLOR=#015B91 ALIGN=CENTER> <TR><TD VALIGN=TOP WIDTH=170 BGCOLOR=#015B91 ALIGN=CENTER>
<IMG SRC="./vicidial_admin_web_logo.gif" WIDTH=170 HEIGHT=45 ALT="VICIDIAL logo"> <IMG SRC="./vicidial_admin_web_logo.gif" WIDTH=170 HEIGHT=45 ALT="System logo">
<B><FONT FACE="ARIAL,HELVETICA" COLOR=white>ADMINISTRATION</FONT></B><BR> <B><FONT FACE="ARIAL,HELVETICA" COLOR=white>ADMINISTRATION</FONT></B><BR>
<TABLE CELLPADDING=2 CELLSPACING=0 BGCOLOR=#015B91 WIDTH=160> <TABLE CELLPADDING=2 CELLSPACING=0 BGCOLOR=#015B91 WIDTH=160>
<?php if ($reports_only_user < 1) { <?php if ($reports_only_user < 1) {
@@ -1577,7 +1578,7 @@ $SSlevel_8_disable_add = $row[5];
?> ?>
<TR BGCOLOR=<?php echo $cts_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Contacts </a> &nbsp; |<?php if ($add_copy_disabled < 1) { ?> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=191111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A Contact </a><?php } ?></TD></TR> <TR BGCOLOR=<?php echo $cts_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=190000000000"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Contacts </a> &nbsp; |<?php if ($add_copy_disabled < 1) { ?> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=191111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Add A Contact </a><?php } ?></TD></TR>
<?php } <?php }
if ( (strlen($status_sh) > 1) and (!eregi('campaign',$hh) ) ) { if ( (strlen($status_sh) > 1) and (!preg_match('/campaign/i',$hh) ) ) {
?> ?>
<TR BGCOLOR=<?php echo $status_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> System Statuses </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=331111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Status Categories </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=341111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> QC Status Codes </a></TD></TR> <TR BGCOLOR=<?php echo $status_color ?>><TD ALIGN=LEFT COLSPAN=2> &nbsp; <a href="<?php echo $ADMIN ?>?ADD=321111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> System Statuses </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=331111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> Status Categories </a> &nbsp; | &nbsp; <a href="<?php echo $ADMIN ?>?ADD=341111111111111"><FONT FACE="ARIAL,HELVETICA" COLOR=BLACK SIZE=<?php echo $subheader_font_size ?>> QC Status Codes </a></TD></TR>
<?php } <?php }
@@ -48,6 +48,7 @@
# 120525-1038 - Added uploaded filename filtering # 120525-1038 - Added uploaded filename filtering
# 120529-1348 - Filename filter fix # 120529-1348 - Filename filter fix
# 130420-2056 - Added NANPA prefix validation and timezone options # 130420-2056 - Added NANPA prefix validation and timezone options
# 130610-0920 - Finalized changing of all ereg instances to preg
# #
$version = '2.6-47'; $version = '2.6-47';
@@ -178,14 +179,14 @@ if ($qm_conf_ct > 0)
if ($non_latin < 1) if ($non_latin < 1)
{ {
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$list_id_override = ereg_replace("[^0-9]","",$list_id_override); $list_id_override = preg_replace('/[^0-9]/','',$list_id_override);
} }
else else
{ {
$PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW);
$PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
} }
$STARTtime = date("U"); $STARTtime = date("U");
@@ -269,7 +270,7 @@ $LOGadmin_viewable_call_times = $row[3];
$camp_lists=''; $camp_lists='';
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if (!eregi("-ALL",$LOGallowed_campaigns)) if (!preg_match('/\-ALL/i', $LOGallowed_campaigns))
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -281,10 +282,10 @@ $regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
$script_name = getenv("SCRIPT_NAME"); $script_name = getenv("SCRIPT_NAME");
$server_name = getenv("SERVER_NAME"); $server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT"); $server_port = getenv("SERVER_PORT");
if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';} else {$HTTPprotocol = 'http://';}
$admDIR = "$HTTPprotocol$server_name$script_name"; $admDIR = "$HTTPprotocol$server_name$script_name";
$admDIR = eregi_replace('admin_listloader_fourth_gen.php','',$admDIR); $admDIR = preg_replace('/admin_listloader_fourth_gen\.php/i', '',$admDIR);
$admDIR = "/vicidial/"; $admDIR = "/vicidial/";
$admSCR = 'admin.php'; $admSCR = 'admin.php';
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; $NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
@@ -322,7 +323,7 @@ if ($gmt_recs > 0)
else else
{ {
$SERVER_GMT = date("O"); $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 + 0);
$SERVER_GMT = ($SERVER_GMT / 100); $SERVER_GMT = ($SERVER_GMT / 100);
} }
@@ -342,7 +343,7 @@ function macfontfix($fontsize)
{ {
$browser = getenv("HTTP_USER_AGENT"); $browser = getenv("HTTP_USER_AGENT");
$pctype = explode("(", $browser); $pctype = explode("(", $browser);
if (ereg("Mac",$pctype[1])) if (preg_match('/Mac/',$pctype[1]))
{ {
/* Browser is a Mac. If not Netscape 6, raise fonts */ /* Browser is a Mac. If not Netscape 6, raise fonts */
$blownbrowser = explode('/', $browser); $blownbrowser = explode('/', $browser);
@@ -665,7 +666,7 @@ if ($OK_to_process)
if (strlen($buffer)>0) if (strlen($buffer)>0)
{ {
$row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); $row=explode($delimiter, preg_replace('/[\'\"]/i', '', $buffer));
$pulldate=date("Y-m-d H:i:s"); $pulldate=date("Y-m-d H:i:s");
$entry_date = "$pulldate"; $entry_date = "$pulldate";
@@ -678,8 +679,8 @@ if ($OK_to_process)
$list_id = $row[$list_id_field]; $list_id = $row[$list_id_field];
$gmt_offset = '0'; $gmt_offset = '0';
$called_since_last_reset='N'; $called_since_last_reset='N';
$phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_code = preg_replace('/[^0-9]/i', '', $row[$phone_code_field]);
$phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); $phone_number = preg_replace('/[^0-9]/i', '', $row[$phone_number_field]);
$title = $row[$title_field]; $title = $row[$title_field];
$first_name = $row[$first_name_field]; $first_name = $row[$first_name_field];
$middle_initial = $row[$middle_initial_field]; $middle_initial = $row[$middle_initial_field];
@@ -694,7 +695,7 @@ if ($OK_to_process)
$country_code = $row[$country_code_field]; $country_code = $row[$country_code_field];
$gender = $row[$gender_field]; $gender = $row[$gender_field];
$date_of_birth = $row[$date_of_birth_field]; $date_of_birth = $row[$date_of_birth_field];
$alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); $alt_phone = preg_replace('/[^0-9]/i', '', $row[$alt_phone_field]);
$email = $row[$email_field]; $email = $row[$email_field];
$security_phrase = $row[$security_phrase_field]; $security_phrase = $row[$security_phrase_field];
$comments = trim($row[$comments_field]); $comments = trim($row[$comments_field]);
@@ -702,32 +703,32 @@ if ($OK_to_process)
$owner = $row[$owner_field]; $owner = $row[$owner_field];
# replace ' " ` \ ; with nothing # replace ' " ` \ ; with nothing
$vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); $vendor_lead_code = preg_replace("/$field_regx/i", "", $vendor_lead_code);
$source_code = eregi_replace($field_regx, "", $source_code); $source_code = preg_replace("/$field_regx/i", "", $source_code);
$source_id = eregi_replace($field_regx, "", $source_id); $source_id = preg_replace("/$field_regx/i", "", $source_id);
$list_id = eregi_replace($field_regx, "", $list_id); $list_id = preg_replace("/$field_regx/i", "", $list_id);
$phone_code = eregi_replace($field_regx, "", $phone_code); $phone_code = preg_replace("/$field_regx/i", "", $phone_code);
$phone_number = eregi_replace($field_regx, "", $phone_number); $phone_number = preg_replace("/$field_regx/i", "", $phone_number);
$title = eregi_replace($field_regx, "", $title); $title = preg_replace("/$field_regx/i", "", $title);
$first_name = eregi_replace($field_regx, "", $first_name); $first_name = preg_replace("/$field_regx/i", "", $first_name);
$middle_initial = eregi_replace($field_regx, "", $middle_initial); $middle_initial = preg_replace("/$field_regx/i", "", $middle_initial);
$last_name = eregi_replace($field_regx, "", $last_name); $last_name = preg_replace("/$field_regx/i", "", $last_name);
$address1 = eregi_replace($field_regx, "", $address1); $address1 = preg_replace("/$field_regx/i", "", $address1);
$address2 = eregi_replace($field_regx, "", $address2); $address2 = preg_replace("/$field_regx/i", "", $address2);
$address3 = eregi_replace($field_regx, "", $address3); $address3 = preg_replace("/$field_regx/i", "", $address3);
$city = eregi_replace($field_regx, "", $city); $city = preg_replace("/$field_regx/i", "", $city);
$state = eregi_replace($field_regx, "", $state); $state = preg_replace("/$field_regx/i", "", $state);
$province = eregi_replace($field_regx, "", $province); $province = preg_replace("/$field_regx/i", "", $province);
$postal_code = eregi_replace($field_regx, "", $postal_code); $postal_code = preg_replace("/$field_regx/i", "", $postal_code);
$country_code = eregi_replace($field_regx, "", $country_code); $country_code = preg_replace("/$field_regx/i", "", $country_code);
$gender = eregi_replace($field_regx, "", $gender); $gender = preg_replace("/$field_regx/i", "", $gender);
$date_of_birth = eregi_replace($field_regx, "", $date_of_birth); $date_of_birth = preg_replace("/$field_regx/i", "", $date_of_birth);
$alt_phone = eregi_replace($field_regx, "", $alt_phone); $alt_phone = preg_replace("/$field_regx/i", "", $alt_phone);
$email = eregi_replace($field_regx, "", $email); $email = preg_replace("/$field_regx/i", "", $email);
$security_phrase = eregi_replace($field_regx, "", $security_phrase); $security_phrase = preg_replace("/$field_regx/i", "", $security_phrase);
$comments = eregi_replace($field_regx, "", $comments); $comments = preg_replace("/$field_regx/i", "", $comments);
$rank = eregi_replace($field_regx, "", $rank); $rank = preg_replace("/$field_regx/i", "", $rank);
$owner = eregi_replace($field_regx, "", $owner); $owner = preg_replace("/$field_regx/i", "", $owner);
$USarea = substr($phone_number, 0, 3); $USarea = substr($phone_number, 0, 3);
$USprefix = substr($phone_number, 3, 3); $USprefix = substr($phone_number, 3, 3);
@@ -769,7 +770,7 @@ if ($OK_to_process)
{ {
$A_field_value[$o] = $row[$form_field_value]; $A_field_value[$o] = $row[$form_field_value];
# replace ' " ` \ ; with nothing # replace ' " ` \ ; with nothing
$A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); $A_field_value[$o] = preg_replace("/$field_regx/i", "", $A_field_value[$o]);
$custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',";
} }
@@ -786,7 +787,7 @@ if ($OK_to_process)
##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign #####
if (eregi("DUPCAMP",$dupcheck)) if (preg_match("/DUPCAMP/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$dup_lists=''; $dup_lists='';
@@ -810,7 +811,7 @@ if ($OK_to_process)
$dup_lists .= "'$row[0]',"; $dup_lists .= "'$row[0]',";
$L++; $L++;
} }
$dup_lists = eregi_replace(",$",'',$dup_lists); $dup_lists = preg_replace('/,$/i', '',$dup_lists);
$stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -823,7 +824,7 @@ if ($OK_to_process)
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
@@ -831,7 +832,7 @@ if ($OK_to_process)
} }
##### Check for duplicate phone numbers in vicidial_list table entire database ##### ##### Check for duplicate phone numbers in vicidial_list table entire database #####
if (eregi("DUPSYS",$dupcheck)) if (preg_match("/DUPSYS/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select list_id from vicidial_list where phone_number='$phone_number';"; $stmt="select list_id from vicidial_list where phone_number='$phone_number';";
@@ -845,13 +846,13 @@ if ($OK_to_process)
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### ##### Check for duplicate phone numbers in vicidial_list table for one list_id #####
if (eregi("DUPLIST",$dupcheck)) if (preg_match("/DUPLIST/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';";
@@ -865,13 +866,13 @@ if ($OK_to_process)
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id #####
if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) if (preg_match("/DUPTITLEALTPHONELIST/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';";
@@ -885,13 +886,13 @@ if ($OK_to_process)
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$alt_phone$title$US$list_id",$phone_list)) if (preg_match("/$alt_phone$title$US$list_id/i",$phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate phone numbers in vicidial_list table entire database ##### ##### Check for duplicate phone numbers in vicidial_list table entire database #####
if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) if (preg_match("/DUPTITLEALTPHONESYS/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';";
@@ -905,7 +906,7 @@ if ($OK_to_process)
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$alt_phone$title$US$list_id",$phone_list)) if (preg_match("/$alt_phone$title$US$list_id/i",$phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
@@ -959,7 +960,7 @@ if ($OK_to_process)
{ {
if (strlen($phone_code)<1) {$phone_code = '1';} if (strlen($phone_code)<1) {$phone_code = '1';}
if (eregi("TITLEALTPHONE",$dupcheck)) if (preg_match("/TITLEALTPHONE/i",$dupcheck))
{$phone_list .= "$alt_phone$title$US$list_id|";} {$phone_list .= "$alt_phone$title$US$list_id|";}
else else
{$phone_list .= "$phone_number$US$list_id|";} {$phone_list .= "$phone_number$US$list_id|";}
@@ -1119,7 +1120,7 @@ if (($leadfile) && ($LF_path))
# csv xls xlsx ods sxc conversion # csv xls xlsx ods sxc conversion
if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name))
{ {
$leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); $leadfile_name = preg_replace('/[^-\.\_0-9a-zA-Z]/','_',$leadfile_name);
copy($LF_path, "/tmp/$leadfile_name"); copy($LF_path, "/tmp/$leadfile_name");
$new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name);
$convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename";
@@ -1183,7 +1184,7 @@ if (($leadfile) && ($LF_path))
if (strlen($buffer)>0) if (strlen($buffer)>0)
{ {
$row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); $row=explode($delimiter, preg_replace('/[\'\"]/i', '', $buffer));
$custom_fields_row=$row; $custom_fields_row=$row;
$pulldate=date("Y-m-d H:i:s"); $pulldate=date("Y-m-d H:i:s");
$entry_date = "$pulldate"; $entry_date = "$pulldate";
@@ -1196,8 +1197,8 @@ if (($leadfile) && ($LF_path))
$list_id = $row[$list_id_field]; $list_id = $row[$list_id_field];
$gmt_offset = '0'; $gmt_offset = '0';
$called_since_last_reset='N'; $called_since_last_reset='N';
$phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_code = preg_replace('/[^0-9]/i', '', $row[$phone_code_field]);
$phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); $phone_number = preg_replace('/[^0-9]/i', '', $row[$phone_number_field]);
$title = $row[$title_field]; $title = $row[$title_field];
$first_name = $row[$first_name_field]; $first_name = $row[$first_name_field];
$middle_initial = $row[$middle_initial_field]; $middle_initial = $row[$middle_initial_field];
@@ -1212,7 +1213,7 @@ if (($leadfile) && ($LF_path))
$country_code = $row[$country_code_field]; $country_code = $row[$country_code_field];
$gender = $row[$gender_field]; $gender = $row[$gender_field];
$date_of_birth = $row[$date_of_birth_field]; $date_of_birth = $row[$date_of_birth_field];
$alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); $alt_phone = preg_replace('/[^0-9]/i', '', $row[$alt_phone_field]);
$email = $row[$email_field]; $email = $row[$email_field];
$security_phrase = $row[$security_phrase_field]; $security_phrase = $row[$security_phrase_field];
$comments = trim($row[$comments_field]); $comments = trim($row[$comments_field]);
@@ -1220,32 +1221,32 @@ if (($leadfile) && ($LF_path))
$owner = $row[$owner_field]; $owner = $row[$owner_field];
# replace ' " ` \ ; with nothing # replace ' " ` \ ; with nothing
$vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); $vendor_lead_code = preg_replace("/$field_regx/i", "", $vendor_lead_code);
$source_code = eregi_replace($field_regx, "", $source_code); $source_code = preg_replace("/$field_regx/i", "", $source_code);
$source_id = eregi_replace($field_regx, "", $source_id); $source_id = preg_replace("/$field_regx/i", "", $source_id);
$list_id = eregi_replace($field_regx, "", $list_id); $list_id = preg_replace("/$field_regx/i", "", $list_id);
$phone_code = eregi_replace($field_regx, "", $phone_code); $phone_code = preg_replace("/$field_regx/i", "", $phone_code);
$phone_number = eregi_replace($field_regx, "", $phone_number); $phone_number = preg_replace("/$field_regx/i", "", $phone_number);
$title = eregi_replace($field_regx, "", $title); $title = preg_replace("/$field_regx/i", "", $title);
$first_name = eregi_replace($field_regx, "", $first_name); $first_name = preg_replace("/$field_regx/i", "", $first_name);
$middle_initial = eregi_replace($field_regx, "", $middle_initial); $middle_initial = preg_replace("/$field_regx/i", "", $middle_initial);
$last_name = eregi_replace($field_regx, "", $last_name); $last_name = preg_replace("/$field_regx/i", "", $last_name);
$address1 = eregi_replace($field_regx, "", $address1); $address1 = preg_replace("/$field_regx/i", "", $address1);
$address2 = eregi_replace($field_regx, "", $address2); $address2 = preg_replace("/$field_regx/i", "", $address2);
$address3 = eregi_replace($field_regx, "", $address3); $address3 = preg_replace("/$field_regx/i", "", $address3);
$city = eregi_replace($field_regx, "", $city); $city = preg_replace("/$field_regx/i", "", $city);
$state = eregi_replace($field_regx, "", $state); $state = preg_replace("/$field_regx/i", "", $state);
$province = eregi_replace($field_regx, "", $province); $province = preg_replace("/$field_regx/i", "", $province);
$postal_code = eregi_replace($field_regx, "", $postal_code); $postal_code = preg_replace("/$field_regx/i", "", $postal_code);
$country_code = eregi_replace($field_regx, "", $country_code); $country_code = preg_replace("/$field_regx/i", "", $country_code);
$gender = eregi_replace($field_regx, "", $gender); $gender = preg_replace("/$field_regx/i", "", $gender);
$date_of_birth = eregi_replace($field_regx, "", $date_of_birth); $date_of_birth = preg_replace("/$field_regx/i", "", $date_of_birth);
$alt_phone = eregi_replace($field_regx, "", $alt_phone); $alt_phone = preg_replace("/$field_regx/i", "", $alt_phone);
$email = eregi_replace($field_regx, "", $email); $email = preg_replace("/$field_regx/i", "", $email);
$security_phrase = eregi_replace($field_regx, "", $security_phrase); $security_phrase = preg_replace("/$field_regx/i", "", $security_phrase);
$comments = eregi_replace($field_regx, "", $comments); $comments = preg_replace("/$field_regx/i", "", $comments);
$rank = eregi_replace($field_regx, "", $rank); $rank = preg_replace("/$field_regx/i", "", $rank);
$owner = eregi_replace($field_regx, "", $owner); $owner = preg_replace("/$field_regx/i", "", $owner);
$USarea = substr($phone_number, 0, 3); $USarea = substr($phone_number, 0, 3);
$USprefix = substr($phone_number, 3, 3); $USprefix = substr($phone_number, 3, 3);
@@ -1260,7 +1261,7 @@ if (($leadfile) && ($LF_path))
} }
##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign #####
if (eregi("DUPCAMP",$dupcheck)) if (preg_match("/DUPCAMP/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$dup_lists=''; $dup_lists='';
@@ -1284,7 +1285,7 @@ if (($leadfile) && ($LF_path))
$dup_lists .= "'$row[0]',"; $dup_lists .= "'$row[0]',";
$L++; $L++;
} }
$dup_lists = eregi_replace(",$",'',$dup_lists); $dup_lists = preg_replace('/,$/i', '',$dup_lists);
$stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -1297,7 +1298,7 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
@@ -1305,7 +1306,7 @@ if (($leadfile) && ($LF_path))
} }
##### Check for duplicate phone numbers in vicidial_list table entire database ##### ##### Check for duplicate phone numbers in vicidial_list table entire database #####
if (eregi("DUPSYS",$dupcheck)) if (preg_match("/DUPSYS/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select list_id from vicidial_list where phone_number='$phone_number';"; $stmt="select list_id from vicidial_list where phone_number='$phone_number';";
@@ -1319,13 +1320,13 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### ##### Check for duplicate phone numbers in vicidial_list table for one list_id #####
if (eregi("DUPLIST",$dupcheck)) if (preg_match("/DUPLIST/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';";
@@ -1338,13 +1339,13 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id #####
if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) if (preg_match("/DUPTITLEALTPHONELIST/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';";
@@ -1358,13 +1359,13 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$alt_phone$title$US$list_id",$phone_list)) if (preg_match("/$alt_phone$title$US$list_id/i",$phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate phone numbers in vicidial_list table entire database ##### ##### Check for duplicate phone numbers in vicidial_list table entire database #####
if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) if (preg_match("/DUPTITLEALTPHONESYS/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';";
@@ -1378,7 +1379,7 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$alt_phone$title$US$list_id",$phone_list)) if (preg_match("/$alt_phone$title$US$list_id/i",$phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
@@ -1432,7 +1433,7 @@ if (($leadfile) && ($LF_path))
{ {
if (strlen($phone_code)<1) {$phone_code = '1';} if (strlen($phone_code)<1) {$phone_code = '1';}
if (eregi("TITLEALTPHONE",$dupcheck)) if (preg_match("/TITLEALTPHONE/i",$dupcheck))
{$phone_list .= "$alt_phone$title$US$list_id|";} {$phone_list .= "$alt_phone$title$US$list_id|";}
else else
{$phone_list .= "$phone_number$US$list_id|";} {$phone_list .= "$phone_number$US$list_id|";}
@@ -1581,7 +1582,7 @@ if (($leadfile) && ($LF_path))
# csv xls xlsx ods sxc conversion # csv xls xlsx ods sxc conversion
if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name))
{ {
$leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); $leadfile_name = preg_replace('/[^-\.\_0-9a-zA-Z]/','_',$leadfile_name);
copy($LF_path, "/tmp/$leadfile_name"); copy($LF_path, "/tmp/$leadfile_name");
$new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name);
$convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename";
@@ -1645,7 +1646,7 @@ if (($leadfile) && ($LF_path))
if (strlen($buffer)>0) if (strlen($buffer)>0)
{ {
$row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); $row=explode($delimiter, preg_replace('/[\'\"]/i', '', $buffer));
$pulldate=date("Y-m-d H:i:s"); $pulldate=date("Y-m-d H:i:s");
$entry_date = "$pulldate"; $entry_date = "$pulldate";
@@ -1658,8 +1659,8 @@ if (($leadfile) && ($LF_path))
$list_id = $row[2]; $list_id = $row[2];
$gmt_offset = '0'; $gmt_offset = '0';
$called_since_last_reset='N'; $called_since_last_reset='N';
$phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_code = preg_replace('/[^0-9]/i', '', $row[3]);
$phone_number = eregi_replace("[^0-9]", "", $row[4]); $phone_number = preg_replace('/[^0-9]/i', '', $row[4]);
$title = $row[5]; $title = $row[5];
$first_name = $row[6]; $first_name = $row[6];
$middle_initial = $row[7]; $middle_initial = $row[7];
@@ -1674,7 +1675,7 @@ if (($leadfile) && ($LF_path))
$country_code = $row[16]; $country_code = $row[16];
$gender = $row[17]; $gender = $row[17];
$date_of_birth = $row[18]; $date_of_birth = $row[18];
$alt_phone = eregi_replace("[^0-9]", "", $row[19]); $alt_phone = preg_replace('/[^0-9]/i', '', $row[19]);
$email = $row[20]; $email = $row[20];
$security_phrase = $row[21]; $security_phrase = $row[21];
$comments = trim($row[22]); $comments = trim($row[22]);
@@ -1682,32 +1683,32 @@ if (($leadfile) && ($LF_path))
$owner = $row[24]; $owner = $row[24];
# replace ' " ` \ ; with nothing # replace ' " ` \ ; with nothing
$vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); $vendor_lead_code = preg_replace("/$field_regx/i", "", $vendor_lead_code);
$source_code = eregi_replace($field_regx, "", $source_code); $source_code = preg_replace("/$field_regx/i", "", $source_code);
$source_id = eregi_replace($field_regx, "", $source_id); $source_id = preg_replace("/$field_regx/i", "", $source_id);
$list_id = eregi_replace($field_regx, "", $list_id); $list_id = preg_replace("/$field_regx/i", "", $list_id);
$phone_code = eregi_replace($field_regx, "", $phone_code); $phone_code = preg_replace("/$field_regx/i", "", $phone_code);
$phone_number = eregi_replace($field_regx, "", $phone_number); $phone_number = preg_replace("/$field_regx/i", "", $phone_number);
$title = eregi_replace($field_regx, "", $title); $title = preg_replace("/$field_regx/i", "", $title);
$first_name = eregi_replace($field_regx, "", $first_name); $first_name = preg_replace("/$field_regx/i", "", $first_name);
$middle_initial = eregi_replace($field_regx, "", $middle_initial); $middle_initial = preg_replace("/$field_regx/i", "", $middle_initial);
$last_name = eregi_replace($field_regx, "", $last_name); $last_name = preg_replace("/$field_regx/i", "", $last_name);
$address1 = eregi_replace($field_regx, "", $address1); $address1 = preg_replace("/$field_regx/i", "", $address1);
$address2 = eregi_replace($field_regx, "", $address2); $address2 = preg_replace("/$field_regx/i", "", $address2);
$address3 = eregi_replace($field_regx, "", $address3); $address3 = preg_replace("/$field_regx/i", "", $address3);
$city = eregi_replace($field_regx, "", $city); $city = preg_replace("/$field_regx/i", "", $city);
$state = eregi_replace($field_regx, "", $state); $state = preg_replace("/$field_regx/i", "", $state);
$province = eregi_replace($field_regx, "", $province); $province = preg_replace("/$field_regx/i", "", $province);
$postal_code = eregi_replace($field_regx, "", $postal_code); $postal_code = preg_replace("/$field_regx/i", "", $postal_code);
$country_code = eregi_replace($field_regx, "", $country_code); $country_code = preg_replace("/$field_regx/i", "", $country_code);
$gender = eregi_replace($field_regx, "", $gender); $gender = preg_replace("/$field_regx/i", "", $gender);
$date_of_birth = eregi_replace($field_regx, "", $date_of_birth); $date_of_birth = preg_replace("/$field_regx/i", "", $date_of_birth);
$alt_phone = eregi_replace($field_regx, "", $alt_phone); $alt_phone = preg_replace("/$field_regx/i", "", $alt_phone);
$email = eregi_replace($field_regx, "", $email); $email = preg_replace("/$field_regx/i", "", $email);
$security_phrase = eregi_replace($field_regx, "", $security_phrase); $security_phrase = preg_replace("/$field_regx/i", "", $security_phrase);
$comments = eregi_replace($field_regx, "", $comments); $comments = preg_replace("/$field_regx/i", "", $comments);
$rank = eregi_replace($field_regx, "", $rank); $rank = preg_replace("/$field_regx/i", "", $rank);
$owner = eregi_replace($field_regx, "", $owner); $owner = preg_replace("/$field_regx/i", "", $owner);
$USarea = substr($phone_number, 0, 3); $USarea = substr($phone_number, 0, 3);
$USprefix = substr($phone_number, 3, 3); $USprefix = substr($phone_number, 3, 3);
@@ -1722,7 +1723,7 @@ if (($leadfile) && ($LF_path))
} }
##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign #####
if (eregi("DUPCAMP",$dupcheck)) if (preg_match("/DUPCAMP/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$dup_lists=''; $dup_lists='';
@@ -1746,7 +1747,7 @@ if (($leadfile) && ($LF_path))
$dup_lists .= "'$row[0]',"; $dup_lists .= "'$row[0]',";
$L++; $L++;
} }
$dup_lists = eregi_replace(",$",'',$dup_lists); $dup_lists = preg_replace('/,$/i', '',$dup_lists);
$stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -1759,7 +1760,7 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
@@ -1767,7 +1768,7 @@ if (($leadfile) && ($LF_path))
} }
##### Check for duplicate phone numbers in vicidial_list table entire database ##### ##### Check for duplicate phone numbers in vicidial_list table entire database #####
if (eregi("DUPSYS",$dupcheck)) if (preg_match("/DUPSYS/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select list_id from vicidial_list where phone_number='$phone_number';"; $stmt="select list_id from vicidial_list where phone_number='$phone_number';";
@@ -1781,13 +1782,13 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### ##### Check for duplicate phone numbers in vicidial_list table for one list_id #####
if (eregi("DUPLIST",$dupcheck)) if (preg_match("/DUPLIST/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';";
@@ -1800,13 +1801,13 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id #####
if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) if (preg_match("/DUPTITLEALTPHONELIST/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';";
@@ -1820,13 +1821,13 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$alt_phone$title$US$list_id",$phone_list)) if (preg_match("/$alt_phone$title$US$list_id/i",$phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate phone numbers in vicidial_list table entire database ##### ##### Check for duplicate phone numbers in vicidial_list table entire database #####
if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) if (preg_match("/DUPTITLEALTPHONESYS/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';";
@@ -1840,7 +1841,7 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$alt_phone$title$US$list_id",$phone_list)) if (preg_match("/$alt_phone$title$US$list_id/i",$phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
@@ -1894,7 +1895,7 @@ if (($leadfile) && ($LF_path))
{ {
if (strlen($phone_code)<1) {$phone_code = '1';} if (strlen($phone_code)<1) {$phone_code = '1';}
if (eregi("TITLEALTPHONE",$dupcheck)) if (preg_match("/TITLEALTPHONE/i",$dupcheck))
{$phone_list .= "$alt_phone$title$US$list_id|";} {$phone_list .= "$alt_phone$title$US$list_id|";}
else else
{$phone_list .= "$phone_number$US$list_id|";} {$phone_list .= "$phone_number$US$list_id|";}
@@ -2041,7 +2042,7 @@ if (($leadfile) && ($LF_path))
$delim_set=0; $delim_set=0;
if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name))
{ {
$leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); $leadfile_name = preg_replace('/[^-\.\_0-9a-zA-Z]/','_',$leadfile_name);
copy($LF_path, "/tmp/$leadfile_name"); copy($LF_path, "/tmp/$leadfile_name");
$new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name);
$convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename";
@@ -2096,7 +2097,7 @@ if (($leadfile) && ($LF_path))
} }
$buffer=rtrim(fgets($file, 4096)); $buffer=rtrim(fgets($file, 4096));
$buffer=stripslashes($buffer); $buffer=stripslashes($buffer);
$row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); $row=explode($delimiter, preg_replace('/[\'\"]/i', '', $buffer));
for ($i=0; $i<mysql_num_fields($rslt); $i++) for ($i=0; $i<mysql_num_fields($rslt); $i++)
{ {
@@ -2107,13 +2108,13 @@ if (($leadfile) && ($LF_path))
else else
{ {
print " <tr bgcolor=#D9E6FE>\r\n"; print " <tr bgcolor=#D9E6FE>\r\n";
print " <td align=right><font class=standard>".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).": </font></td>\r\n"; print " <td align=right><font class=standard>".strtoupper(preg_replace('/_/i', ' ', mysql_field_name($rslt, $i))).": </font></td>\r\n";
print " <td align=center><select name='".mysql_field_name($rslt, $i)."_field'>\r\n"; print " <td align=center><select name='".mysql_field_name($rslt, $i)."_field'>\r\n";
print " <option value='-1'>(none)</option>\r\n"; print " <option value='-1'>(none)</option>\r\n";
for ($j=0; $j<count($row); $j++) for ($j=0; $j<count($row); $j++)
{ {
eregi_replace("\"", "", $row[$j]); preg_replace('/\"/i', '', $row[$j]);
print " <option value='$j'>\"$row[$j]\"</option>\r\n"; print " <option value='$j'>\"$row[$j]\"</option>\r\n";
} }
@@ -2158,7 +2159,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
global $link; global $link;
$postalgmt_found=0; $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)) if (preg_match('/^1$/', $phone_code))
{ {
@@ -2168,7 +2169,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[3];
$dst_range = $row[4]; $dst_range = $row[4];
$PC_processed++; $PC_processed++;
@@ -2189,7 +2190,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); $gmt_offset = $row[0]; $gmt_offset = preg_replace('/\+/i', '',$gmt_offset);
$PC_processed++; $PC_processed++;
$postalgmt_found++; $postalgmt_found++;
$post++; $post++;
@@ -2205,7 +2206,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if (strlen($dst_range)>2) {$dst = 'Y';} if (strlen($dst_range)>2) {$dst = 'Y';}
} }
} }
if ( (eregi("NANPA",$tz_method)) && (strlen($USarea)>2) && (strlen($USprefix)>2) ) if ( (preg_match("/NANPA/i",$tz_method)) && (strlen($USarea)>2) && (strlen($USprefix)>2) )
{ {
$stmt="select GMT_offset,DST from vicidial_nanpa_prefix_codes where areacode='$USarea' and prefix='$USprefix';"; $stmt="select GMT_offset,DST from vicidial_nanpa_prefix_codes where areacode='$USarea' and prefix='$USprefix';";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -2213,7 +2214,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); $gmt_offset = $row[0]; $gmt_offset = preg_replace('/\+/i', '',$gmt_offset);
$dst = $row[1]; $dst = $row[1];
$dst_range = ''; $dst_range = '';
if ($dst == 'Y') if ($dst == 'Y')
@@ -2236,7 +2237,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[5];
$dst_range = $row[6]; $dst_range = $row[6];
$PC_processed++; $PC_processed++;
@@ -2251,7 +2252,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[5];
$dst_range = $row[6]; $dst_range = $row[6];
$PC_processed++; $PC_processed++;
@@ -2266,7 +2267,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[5];
$dst_range = $row[6]; $dst_range = $row[6];
$PC_processed++; $PC_processed++;
@@ -2282,7 +2283,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[5];
$dst_range = $row[6]; $dst_range = $row[6];
$PC_processed++; $PC_processed++;
@@ -1,5 +1,5 @@
<?php <?php
# admin_listloader_third_gen.php - version 2.4 # admin_listloader_third_gen.php - version 2.8
# (based upon - new_listloader_superL.php script) # (based upon - new_listloader_superL.php script)
# #
# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
@@ -46,10 +46,11 @@
# 120223-2318 - Removed logging of good login passwords if webroot writable is enabled # 120223-2318 - Removed logging of good login passwords if webroot writable is enabled
# 120525-1037 - Added uploaded filename filtering # 120525-1037 - Added uploaded filename filtering
# 120529-1347 - Filename filter fix # 120529-1347 - Filename filter fix
# 130610-1055 - Finalized changing of all ereg instances to preg
# #
$version = '2.4-45'; $version = '2.8-46';
$build = '120529-1347'; $build = '130610-1055';
require("dbconnect.php"); require("dbconnect.php");
@@ -174,14 +175,14 @@ if ($qm_conf_ct > 0)
if ($non_latin < 1) if ($non_latin < 1)
{ {
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$list_id_override = ereg_replace("[^0-9]","",$list_id_override); $list_id_override = preg_replace('/[^0-9]/','',$list_id_override);
} }
else else
{ {
$PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW);
$PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
} }
$STARTtime = date("U"); $STARTtime = date("U");
@@ -264,7 +265,7 @@ $LOGadmin_viewable_call_times = $row[3];
$camp_lists=''; $camp_lists='';
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if (!eregi("-ALL",$LOGallowed_campaigns)) if (!preg_match('/\-ALL/i', $LOGallowed_campaigns))
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -276,10 +277,10 @@ $regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
$script_name = getenv("SCRIPT_NAME"); $script_name = getenv("SCRIPT_NAME");
$server_name = getenv("SERVER_NAME"); $server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT"); $server_port = getenv("SERVER_PORT");
if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';} else {$HTTPprotocol = 'http://';}
$admDIR = "$HTTPprotocol$server_name$script_name"; $admDIR = "$HTTPprotocol$server_name$script_name";
$admDIR = eregi_replace('admin_listloader_third_gen.php','',$admDIR); $admDIR = preg_replace('/admin_listloader_third_gen\.php/i', '',$admDIR);
$admSCR = 'admin.php'; $admSCR = 'admin.php';
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; $NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; $NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
@@ -316,7 +317,7 @@ if ($gmt_recs > 0)
else else
{ {
$SERVER_GMT = date("O"); $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 + 0);
$SERVER_GMT = ($SERVER_GMT / 100); $SERVER_GMT = ($SERVER_GMT / 100);
} }
@@ -336,7 +337,7 @@ function macfontfix($fontsize)
{ {
$browser = getenv("HTTP_USER_AGENT"); $browser = getenv("HTTP_USER_AGENT");
$pctype = explode("(", $browser); $pctype = explode("(", $browser);
if (ereg("Mac",$pctype[1])) if (preg_match('/Mac/',$pctype[1]))
{ {
/* Browser is a Mac. If not Netscape 6, raise fonts */ /* Browser is a Mac. If not Netscape 6, raise fonts */
$blownbrowser = explode('/', $browser); $blownbrowser = explode('/', $browser);
@@ -621,7 +622,7 @@ if ($OK_to_process)
if (strlen($buffer)>0) if (strlen($buffer)>0)
{ {
$row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); $row=explode($delimiter, preg_replace('/[\'\"]/i', '', $buffer));
$pulldate=date("Y-m-d H:i:s"); $pulldate=date("Y-m-d H:i:s");
$entry_date = "$pulldate"; $entry_date = "$pulldate";
@@ -634,8 +635,8 @@ if ($OK_to_process)
$list_id = $row[$list_id_field]; $list_id = $row[$list_id_field];
$gmt_offset = '0'; $gmt_offset = '0';
$called_since_last_reset='N'; $called_since_last_reset='N';
$phone_code = eregi_replace("[^0-9]", "", $row[$phone_code_field]); $phone_code = preg_replace('/[^0-9]/i', '', $row[$phone_code_field]);
$phone_number = eregi_replace("[^0-9]", "", $row[$phone_number_field]); $phone_number = preg_replace('/[^0-9]/i', '', $row[$phone_number_field]);
$title = $row[$title_field]; $title = $row[$title_field];
$first_name = $row[$first_name_field]; $first_name = $row[$first_name_field];
$middle_initial = $row[$middle_initial_field]; $middle_initial = $row[$middle_initial_field];
@@ -650,7 +651,7 @@ if ($OK_to_process)
$country_code = $row[$country_code_field]; $country_code = $row[$country_code_field];
$gender = $row[$gender_field]; $gender = $row[$gender_field];
$date_of_birth = $row[$date_of_birth_field]; $date_of_birth = $row[$date_of_birth_field];
$alt_phone = eregi_replace("[^0-9]", "", $row[$alt_phone_field]); $alt_phone = preg_replace('/[^0-9]/i', '', $row[$alt_phone_field]);
$email = $row[$email_field]; $email = $row[$email_field];
$security_phrase = $row[$security_phrase_field]; $security_phrase = $row[$security_phrase_field];
$comments = trim($row[$comments_field]); $comments = trim($row[$comments_field]);
@@ -658,32 +659,32 @@ if ($OK_to_process)
$owner = $row[$owner_field]; $owner = $row[$owner_field];
# replace ' " ` \ ; with nothing # replace ' " ` \ ; with nothing
$vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); $vendor_lead_code = preg_replace("/$field_regx/i", "", $vendor_lead_code);
$source_code = eregi_replace($field_regx, "", $source_code); $source_code = preg_replace("/$field_regx/i", "", $source_code);
$source_id = eregi_replace($field_regx, "", $source_id); $source_id = preg_replace("/$field_regx/i", "", $source_id);
$list_id = eregi_replace($field_regx, "", $list_id); $list_id = preg_replace("/$field_regx/i", "", $list_id);
$phone_code = eregi_replace($field_regx, "", $phone_code); $phone_code = preg_replace("/$field_regx/i", "", $phone_code);
$phone_number = eregi_replace($field_regx, "", $phone_number); $phone_number = preg_replace("/$field_regx/i", "", $phone_number);
$title = eregi_replace($field_regx, "", $title); $title = preg_replace("/$field_regx/i", "", $title);
$first_name = eregi_replace($field_regx, "", $first_name); $first_name = preg_replace("/$field_regx/i", "", $first_name);
$middle_initial = eregi_replace($field_regx, "", $middle_initial); $middle_initial = preg_replace("/$field_regx/i", "", $middle_initial);
$last_name = eregi_replace($field_regx, "", $last_name); $last_name = preg_replace("/$field_regx/i", "", $last_name);
$address1 = eregi_replace($field_regx, "", $address1); $address1 = preg_replace("/$field_regx/i", "", $address1);
$address2 = eregi_replace($field_regx, "", $address2); $address2 = preg_replace("/$field_regx/i", "", $address2);
$address3 = eregi_replace($field_regx, "", $address3); $address3 = preg_replace("/$field_regx/i", "", $address3);
$city = eregi_replace($field_regx, "", $city); $city = preg_replace("/$field_regx/i", "", $city);
$state = eregi_replace($field_regx, "", $state); $state = preg_replace("/$field_regx/i", "", $state);
$province = eregi_replace($field_regx, "", $province); $province = preg_replace("/$field_regx/i", "", $province);
$postal_code = eregi_replace($field_regx, "", $postal_code); $postal_code = preg_replace("/$field_regx/i", "", $postal_code);
$country_code = eregi_replace($field_regx, "", $country_code); $country_code = preg_replace("/$field_regx/i", "", $country_code);
$gender = eregi_replace($field_regx, "", $gender); $gender = preg_replace("/$field_regx/i", "", $gender);
$date_of_birth = eregi_replace($field_regx, "", $date_of_birth); $date_of_birth = preg_replace("/$field_regx/i", "", $date_of_birth);
$alt_phone = eregi_replace($field_regx, "", $alt_phone); $alt_phone = preg_replace("/$field_regx/i", "", $alt_phone);
$email = eregi_replace($field_regx, "", $email); $email = preg_replace("/$field_regx/i", "", $email);
$security_phrase = eregi_replace($field_regx, "", $security_phrase); $security_phrase = preg_replace("/$field_regx/i", "", $security_phrase);
$comments = eregi_replace($field_regx, "", $comments); $comments = preg_replace("/$field_regx/i", "", $comments);
$rank = eregi_replace($field_regx, "", $rank); $rank = preg_replace("/$field_regx/i", "", $rank);
$owner = eregi_replace($field_regx, "", $owner); $owner = preg_replace("/$field_regx/i", "", $owner);
$USarea = substr($phone_number, 0, 3); $USarea = substr($phone_number, 0, 3);
@@ -724,7 +725,7 @@ if ($OK_to_process)
{ {
$A_field_value[$o] = $row[$form_field_value]; $A_field_value[$o] = $row[$form_field_value];
# replace ' " ` \ ; with nothing # replace ' " ` \ ; with nothing
$A_field_value[$o] = eregi_replace($field_regx, "", $A_field_value[$o]); $A_field_value[$o] = preg_replace("/$field_regx/i", "", $A_field_value[$o]);
$custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',"; $custom_SQL .= "$A_field_label[$o]='$A_field_value[$o]',";
} }
@@ -741,7 +742,7 @@ if ($OK_to_process)
##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign #####
if (eregi("DUPCAMP",$dupcheck)) if (preg_match("/DUPCAMP/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$dup_lists=''; $dup_lists='';
@@ -765,7 +766,7 @@ if ($OK_to_process)
$dup_lists .= "'$row[0]',"; $dup_lists .= "'$row[0]',";
$L++; $L++;
} }
$dup_lists = eregi_replace(",$",'',$dup_lists); $dup_lists = preg_replace('/,$/i', '',$dup_lists);
$stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -778,7 +779,7 @@ if ($OK_to_process)
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
@@ -786,7 +787,7 @@ if ($OK_to_process)
} }
##### Check for duplicate phone numbers in vicidial_list table entire database ##### ##### Check for duplicate phone numbers in vicidial_list table entire database #####
if (eregi("DUPSYS",$dupcheck)) if (preg_match("/DUPSYS/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select list_id from vicidial_list where phone_number='$phone_number';"; $stmt="select list_id from vicidial_list where phone_number='$phone_number';";
@@ -800,13 +801,13 @@ if ($OK_to_process)
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### ##### Check for duplicate phone numbers in vicidial_list table for one list_id #####
if (eregi("DUPLIST",$dupcheck)) if (preg_match("/DUPLIST/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';";
@@ -820,13 +821,13 @@ if ($OK_to_process)
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id #####
if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) if (preg_match("/DUPTITLEALTPHONELIST/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';";
@@ -840,13 +841,13 @@ if ($OK_to_process)
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$alt_phone$title$US$list_id",$phone_list)) if (preg_match("/$alt_phone$title$US$list_id/i",$phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate phone numbers in vicidial_list table entire database ##### ##### Check for duplicate phone numbers in vicidial_list table entire database #####
if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) if (preg_match("/DUPTITLEALTPHONESYS/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';";
@@ -860,7 +861,7 @@ if ($OK_to_process)
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$alt_phone$title$US$list_id",$phone_list)) if (preg_match("/$alt_phone$title$US$list_id/i",$phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
@@ -899,7 +900,7 @@ if ($OK_to_process)
{ {
if (strlen($phone_code)<1) {$phone_code = '1';} if (strlen($phone_code)<1) {$phone_code = '1';}
if (eregi("TITLEALTPHONE",$dupcheck)) if (preg_match("/TITLEALTPHONE/i",$dupcheck))
{$phone_list .= "$alt_phone$title$US$list_id|";} {$phone_list .= "$alt_phone$title$US$list_id|";}
else else
{$phone_list .= "$phone_number$US$list_id|";} {$phone_list .= "$phone_number$US$list_id|";}
@@ -1019,7 +1020,7 @@ if (($leadfile) && ($LF_path))
# csv xls xlsx ods sxc conversion # csv xls xlsx ods sxc conversion
if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name))
{ {
$leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); $leadfile_name = preg_replace('/[^-\.\_0-9a-zA-Z]/','_',$leadfile_name);
copy($LF_path, "/tmp/$leadfile_name"); copy($LF_path, "/tmp/$leadfile_name");
$new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name);
$convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename";
@@ -1083,7 +1084,7 @@ if (($leadfile) && ($LF_path))
if (strlen($buffer)>0) if (strlen($buffer)>0)
{ {
$row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); $row=explode($delimiter, preg_replace('/[\'\"]/i', '', $buffer));
$pulldate=date("Y-m-d H:i:s"); $pulldate=date("Y-m-d H:i:s");
$entry_date = "$pulldate"; $entry_date = "$pulldate";
@@ -1096,8 +1097,8 @@ if (($leadfile) && ($LF_path))
$list_id = $row[2]; $list_id = $row[2];
$gmt_offset = '0'; $gmt_offset = '0';
$called_since_last_reset='N'; $called_since_last_reset='N';
$phone_code = eregi_replace("[^0-9]", "", $row[3]); $phone_code = preg_replace('/[^0-9]/i', '', $row[3]);
$phone_number = eregi_replace("[^0-9]", "", $row[4]); $phone_number = preg_replace('/[^0-9]/i', '', $row[4]);
$title = $row[5]; $title = $row[5];
$first_name = $row[6]; $first_name = $row[6];
$middle_initial = $row[7]; $middle_initial = $row[7];
@@ -1112,7 +1113,7 @@ if (($leadfile) && ($LF_path))
$country_code = $row[16]; $country_code = $row[16];
$gender = $row[17]; $gender = $row[17];
$date_of_birth = $row[18]; $date_of_birth = $row[18];
$alt_phone = eregi_replace("[^0-9]", "", $row[19]); $alt_phone = preg_replace('/[^0-9]/i', '', $row[19]);
$email = $row[20]; $email = $row[20];
$security_phrase = $row[21]; $security_phrase = $row[21];
$comments = trim($row[22]); $comments = trim($row[22]);
@@ -1120,32 +1121,32 @@ if (($leadfile) && ($LF_path))
$owner = $row[24]; $owner = $row[24];
# replace ' " ` \ ; with nothing # replace ' " ` \ ; with nothing
$vendor_lead_code = eregi_replace($field_regx, "", $vendor_lead_code); $vendor_lead_code = preg_replace("/$field_regx/i", "", $vendor_lead_code);
$source_code = eregi_replace($field_regx, "", $source_code); $source_code = preg_replace("/$field_regx/i", "", $source_code);
$source_id = eregi_replace($field_regx, "", $source_id); $source_id = preg_replace("/$field_regx/i", "", $source_id);
$list_id = eregi_replace($field_regx, "", $list_id); $list_id = preg_replace("/$field_regx/i", "", $list_id);
$phone_code = eregi_replace($field_regx, "", $phone_code); $phone_code = preg_replace("/$field_regx/i", "", $phone_code);
$phone_number = eregi_replace($field_regx, "", $phone_number); $phone_number = preg_replace("/$field_regx/i", "", $phone_number);
$title = eregi_replace($field_regx, "", $title); $title = preg_replace("/$field_regx/i", "", $title);
$first_name = eregi_replace($field_regx, "", $first_name); $first_name = preg_replace("/$field_regx/i", "", $first_name);
$middle_initial = eregi_replace($field_regx, "", $middle_initial); $middle_initial = preg_replace("/$field_regx/i", "", $middle_initial);
$last_name = eregi_replace($field_regx, "", $last_name); $last_name = preg_replace("/$field_regx/i", "", $last_name);
$address1 = eregi_replace($field_regx, "", $address1); $address1 = preg_replace("/$field_regx/i", "", $address1);
$address2 = eregi_replace($field_regx, "", $address2); $address2 = preg_replace("/$field_regx/i", "", $address2);
$address3 = eregi_replace($field_regx, "", $address3); $address3 = preg_replace("/$field_regx/i", "", $address3);
$city = eregi_replace($field_regx, "", $city); $city = preg_replace("/$field_regx/i", "", $city);
$state = eregi_replace($field_regx, "", $state); $state = preg_replace("/$field_regx/i", "", $state);
$province = eregi_replace($field_regx, "", $province); $province = preg_replace("/$field_regx/i", "", $province);
$postal_code = eregi_replace($field_regx, "", $postal_code); $postal_code = preg_replace("/$field_regx/i", "", $postal_code);
$country_code = eregi_replace($field_regx, "", $country_code); $country_code = preg_replace("/$field_regx/i", "", $country_code);
$gender = eregi_replace($field_regx, "", $gender); $gender = preg_replace("/$field_regx/i", "", $gender);
$date_of_birth = eregi_replace($field_regx, "", $date_of_birth); $date_of_birth = preg_replace("/$field_regx/i", "", $date_of_birth);
$alt_phone = eregi_replace($field_regx, "", $alt_phone); $alt_phone = preg_replace("/$field_regx/i", "", $alt_phone);
$email = eregi_replace($field_regx, "", $email); $email = preg_replace("/$field_regx/i", "", $email);
$security_phrase = eregi_replace($field_regx, "", $security_phrase); $security_phrase = preg_replace("/$field_regx/i", "", $security_phrase);
$comments = eregi_replace($field_regx, "", $comments); $comments = preg_replace("/$field_regx/i", "", $comments);
$rank = eregi_replace($field_regx, "", $rank); $rank = preg_replace("/$field_regx/i", "", $rank);
$owner = eregi_replace($field_regx, "", $owner); $owner = preg_replace("/$field_regx/i", "", $owner);
$USarea = substr($phone_number, 0, 3); $USarea = substr($phone_number, 0, 3);
@@ -1159,7 +1160,7 @@ if (($leadfile) && ($LF_path))
} }
##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign ##### ##### Check for duplicate phone numbers in vicidial_list table for all lists in a campaign #####
if (eregi("DUPCAMP",$dupcheck)) if (preg_match("/DUPCAMP/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$dup_lists=''; $dup_lists='';
@@ -1183,7 +1184,7 @@ if (($leadfile) && ($LF_path))
$dup_lists .= "'$row[0]',"; $dup_lists .= "'$row[0]',";
$L++; $L++;
} }
$dup_lists = eregi_replace(",$",'',$dup_lists); $dup_lists = preg_replace('/,$/i', '',$dup_lists);
$stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;"; $stmt="select list_id from vicidial_list where phone_number='$phone_number' and list_id IN($dup_lists) limit 1;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -1196,7 +1197,7 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
@@ -1204,7 +1205,7 @@ if (($leadfile) && ($LF_path))
} }
##### Check for duplicate phone numbers in vicidial_list table entire database ##### ##### Check for duplicate phone numbers in vicidial_list table entire database #####
if (eregi("DUPSYS",$dupcheck)) if (preg_match("/DUPSYS/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select list_id from vicidial_list where phone_number='$phone_number';"; $stmt="select list_id from vicidial_list where phone_number='$phone_number';";
@@ -1218,13 +1219,13 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate phone numbers in vicidial_list table for one list_id ##### ##### Check for duplicate phone numbers in vicidial_list table for one list_id #####
if (eregi("DUPLIST",$dupcheck)) if (preg_match("/DUPLIST/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';"; $stmt="select count(*) from vicidial_list where phone_number='$phone_number' and list_id='$list_id';";
@@ -1237,13 +1238,13 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$phone_number$US$list_id",$phone_list)) if (preg_match("/$phone_number$US$list_id/i", $phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate title and alt-phone in vicidial_list table for one list_id ##### ##### Check for duplicate title and alt-phone in vicidial_list table for one list_id #####
if (eregi("DUPTITLEALTPHONELIST",$dupcheck)) if (preg_match("/DUPTITLEALTPHONELIST/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';"; $stmt="select count(*) from vicidial_list where title='$title' and alt_phone='$alt_phone' and list_id='$list_id';";
@@ -1257,13 +1258,13 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$alt_phone$title$US$list_id",$phone_list)) if (preg_match("/$alt_phone$title$US$list_id/i",$phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
##### Check for duplicate phone numbers in vicidial_list table entire database ##### ##### Check for duplicate phone numbers in vicidial_list table entire database #####
if (eregi("DUPTITLEALTPHONESYS",$dupcheck)) if (preg_match("/DUPTITLEALTPHONESYS/i",$dupcheck))
{ {
$dup_lead=0; $dup_lead=0;
$stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';"; $stmt="select list_id from vicidial_list where title='$title' and alt_phone='$alt_phone';";
@@ -1277,7 +1278,7 @@ if (($leadfile) && ($LF_path))
} }
if ($dup_lead < 1) if ($dup_lead < 1)
{ {
if (eregi("$alt_phone$title$US$list_id",$phone_list)) if (preg_match("/$alt_phone$title$US$list_id/i",$phone_list))
{$dup_lead++; $dup++;} {$dup_lead++; $dup++;}
} }
} }
@@ -1316,7 +1317,7 @@ if (($leadfile) && ($LF_path))
{ {
if (strlen($phone_code)<1) {$phone_code = '1';} if (strlen($phone_code)<1) {$phone_code = '1';}
if (eregi("TITLEALTPHONE",$dupcheck)) if (preg_match("/TITLEALTPHONE/i",$dupcheck))
{$phone_list .= "$alt_phone$title$US$list_id|";} {$phone_list .= "$alt_phone$title$US$list_id|";}
else else
{$phone_list .= "$phone_number$US$list_id|";} {$phone_list .= "$phone_number$US$list_id|";}
@@ -1463,7 +1464,7 @@ if (($leadfile) && ($LF_path))
$delim_set=0; $delim_set=0;
if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name)) if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $leadfile_name))
{ {
$leadfile_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$leadfile_name); $leadfile_name = preg_replace('/[^-\.\_0-9a-zA-Z]/','_',$leadfile_name);
copy($LF_path, "/tmp/$leadfile_name"); copy($LF_path, "/tmp/$leadfile_name");
$new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name); $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $leadfile_name);
$convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename"; $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$leadfile_name /tmp/$new_filename";
@@ -1518,7 +1519,7 @@ if (($leadfile) && ($LF_path))
} }
$buffer=rtrim(fgets($file, 4096)); $buffer=rtrim(fgets($file, 4096));
$buffer=stripslashes($buffer); $buffer=stripslashes($buffer);
$row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); $row=explode($delimiter, preg_replace('/[\'\"]/i', '', $buffer));
for ($i=0; $i<mysql_num_fields($rslt); $i++) for ($i=0; $i<mysql_num_fields($rslt); $i++)
{ {
@@ -1529,13 +1530,13 @@ if (($leadfile) && ($LF_path))
else else
{ {
print " <tr bgcolor=#D9E6FE>\r\n"; print " <tr bgcolor=#D9E6FE>\r\n";
print " <td align=right><font class=standard>".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).": </font></td>\r\n"; print " <td align=right><font class=standard>".strtoupper(preg_replace('/_/i', ' ', mysql_field_name($rslt, $i))).": </font></td>\r\n";
print " <td align=center><select name='".mysql_field_name($rslt, $i)."_field'>\r\n"; print " <td align=center><select name='".mysql_field_name($rslt, $i)."_field'>\r\n";
print " <option value='-1'>(none)</option>\r\n"; print " <option value='-1'>(none)</option>\r\n";
for ($j=0; $j<count($row); $j++) for ($j=0; $j<count($row); $j++)
{ {
eregi_replace("\"", "", $row[$j]); preg_replace('/\"/i', '', $row[$j]);
print " <option value='$j'>\"$row[$j]\"</option>\r\n"; print " <option value='$j'>\"$row[$j]\"</option>\r\n";
} }
@@ -1580,7 +1581,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
global $link; global $link;
$postalgmt_found=0; $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)) if (preg_match('/^1$/', $phone_code))
{ {
@@ -1590,7 +1591,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[3];
$dst_range = $row[4]; $dst_range = $row[4];
$PC_processed++; $PC_processed++;
@@ -1611,7 +1612,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); $gmt_offset = $row[0]; $gmt_offset = preg_replace('/\+/i', '',$gmt_offset);
$PC_processed++; $PC_processed++;
$postalgmt_found++; $postalgmt_found++;
$post++; $post++;
@@ -1640,7 +1641,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[5];
$dst_range = $row[6]; $dst_range = $row[6];
$PC_processed++; $PC_processed++;
@@ -1655,7 +1656,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[5];
$dst_range = $row[6]; $dst_range = $row[6];
$PC_processed++; $PC_processed++;
@@ -1670,7 +1671,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[5];
$dst_range = $row[6]; $dst_range = $row[6];
$PC_processed++; $PC_processed++;
@@ -1686,7 +1687,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[5];
$dst_range = $row[6]; $dst_range = $row[6];
$PC_processed++; $PC_processed++;
@@ -25,10 +25,11 @@
# 120713-2101 - Added extended_vl_fields option # 120713-2101 - Added extended_vl_fields option
# 120907-1209 - Raised extended fields up to 99 # 120907-1209 - Raised extended fields up to 99
# 130508-1020 - Added default field and length check validation, made errors appear in bold red text # 130508-1020 - Added default field and length check validation, made errors appear in bold red text
# 130606-0545 - Finalized changing of all ereg instances to preg
# #
$admin_version = '2.6-19'; $admin_version = '2.8-19';
$build = '130508-1020'; $build = '130606-0545';
require("dbconnect.php"); require("dbconnect.php");
@@ -120,36 +121,36 @@ if ( (strlen($field_max) < 1) or ($field_max < 1) )
if ($non_latin < 1) if ($non_latin < 1)
{ {
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_PW);
$list_id = ereg_replace("[^0-9]","",$list_id); $list_id = preg_replace('/[^0-9]/','',$list_id);
$field_id = ereg_replace("[^0-9]","",$field_id); $field_id = preg_replace('/[^0-9]/','',$field_id);
$field_rank = ereg_replace("[^0-9]","",$field_rank); $field_rank = preg_replace('/[^0-9]/','',$field_rank);
$field_size = ereg_replace("[^0-9]","",$field_size); $field_size = preg_replace('/[^0-9]/','',$field_size);
$field_max = ereg_replace("[^0-9]","",$field_max); $field_max = preg_replace('/[^0-9]/','',$field_max);
$field_order = ereg_replace("[^0-9]","",$field_order); $field_order = preg_replace('/[^0-9]/','',$field_order);
$source_list_id = ereg_replace("[^0-9]","",$source_list_id); $source_list_id = preg_replace('/[^0-9]/','',$source_list_id);
$field_required = ereg_replace("[^NY]","",$field_required); $field_required = preg_replace('/[^NY]/','',$field_required);
$field_type = ereg_replace("[^0-9a-zA-Z]","",$field_type); $field_type = preg_replace('/[^0-9a-zA-Z]/','',$field_type);
$ConFiRm = ereg_replace("[^0-9a-zA-Z]","",$ConFiRm); $ConFiRm = preg_replace('/[^0-9a-zA-Z]/','',$ConFiRm);
$name_position = ereg_replace("[^0-9a-zA-Z]","",$name_position); $name_position = preg_replace('/[^0-9a-zA-Z]/','',$name_position);
$multi_position = ereg_replace("[^0-9a-zA-Z]","",$multi_position); $multi_position = preg_replace('/[^0-9a-zA-Z]/','',$multi_position);
$field_label = ereg_replace("[^_0-9a-zA-Z]","",$field_label); $field_label = preg_replace('/[^_0-9a-zA-Z]/','',$field_label);
$copy_option = ereg_replace("[^_0-9a-zA-Z]","",$copy_option); $copy_option = preg_replace('/[^_0-9a-zA-Z]/','',$copy_option);
$field_name = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$field_name); $field_name = preg_replace('/[^ \.\,-\_0-9a-zA-Z]/','',$field_name);
$field_description = ereg_replace("[^ \.\,-\_0-9a-zA-Z]","",$field_description); $field_description = preg_replace('/[^ \.\,-\_0-9a-zA-Z]/','',$field_description);
$field_options = ereg_replace("[^ \.\n\,-\_0-9a-zA-Z]","",$field_options); $field_options = preg_replace('/[^ \.\n\,-\_0-9a-zA-Z]/', '',$field_options);
$field_default = ereg_replace("[^ \.\n\,-\_0-9a-zA-Z]","",$field_default); $field_default = preg_replace('/[^ \.\n\,-\_0-9a-zA-Z]/', '',$field_default);
} # end of non_latin } # end of non_latin
else else
{ {
$PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW);
} }
$STARTtime = date("U"); $STARTtime = date("U");
@@ -266,86 +267,86 @@ if ($action == "HELP")
<center> <center>
<TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=4><TR><TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2> <TABLE WIDTH=98% BGCOLOR=#E6E6E6 cellpadding=2 cellspacing=4><TR><TD ALIGN=LEFT><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>
<BR> <BR>
<B>ViciDial Lists Custom Fields Help</B> <B>Lists Custom Fields Help</B>
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-field_label"> <A NAME="lists_fields-field_label">
<BR> <BR>
<B>Field Label -</B> This is the database field identifier for this field. This needs to be a unique identifier within the custom fields for this list. Do not use any spaces or punctuation for this field. max 50 characters, minimum of 2 characters. You can also include the default ViciDial fields in a custom field setup, and you will see them in red in the list. These fields will not be added to the custom list database table, the agent interface will instead reference the vicidial_list table directly. The labels that you can use to include the default fieds are - <B>Field Label -</B> This is the database field identifier for this field. This needs to be a unique identifier within the custom fields for this list. Do not use any spaces or punctuation for this field. max 50 characters, minimum of 2 characters. You can also include the default fields in a custom field setup, and you will see them in red in the list. These fields will not be added to the custom list database table, the agent interface will instead reference the list table directly. The labels that you can use to include the default fieds are -
lead_id, vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner lead_id, vendor_lead_code, source_id, list_id, gmt_offset_now, called_since_last_reset, phone_code, phone_number, title, first_name, middle_initial, last_name, address1, address2, address3, city, state, province, postal_code, country_code, gender, date_of_birth, alt_phone, email, security_phrase, comments, called_count, last_local_call_time, rank, owner
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-field_name"> <A NAME="lists_fields-field_name">
<BR> <BR>
<B>Field Name -</B> This is the name of the field as it will appear to an agent through their interface. You can use spaces in this field, but no punctuation characters, maximum of 50 characters and minimum of 2 characters. <B>Field Name -</B> This is the name of the field as it will appear to an agent through their interface. You can use spaces in this field, but no punctuation characters, maximum of 50 characters and minimum of 2 characters.
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-field_description"> <A NAME="lists_fields-field_description">
<BR> <BR>
<B>Field Description -</B> The description of this field as it will appear in the administration interface. This is an optional field with a maximum of 100 characters. <B>Field Description -</B> The description of this field as it will appear in the administration interface. This is an optional field with a maximum of 100 characters.
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-field_rank"> <A NAME="lists_fields-field_rank">
<BR> <BR>
<B>Field Rank -</B> The order in which these fields is displayed to the agent from lowest on top to highest on the bottom. <B>Field Rank -</B> The order in which these fields is displayed to the agent from lowest on top to highest on the bottom.
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-field_order"> <A NAME="lists_fields-field_order">
<BR> <BR>
<B>Field Order -</B> If more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right. <B>Field Order -</B> If more than one field has the same rank, they will be placed on the same line and they will be placed in order by this value from lowest to highest, left to right.
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-field_help"> <A NAME="lists_fields-field_help">
<BR> <BR>
<B>Field Help -</B> Optional field, if you fill it in, the agent will be able to see this text when they click on a help link next to the field in their agent interface. <B>Field Help -</B> Optional field, if you fill it in, the agent will be able to see this text when they click on a help link next to the field in their agent interface.
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-field_type"> <A NAME="lists_fields-field_type">
<BR> <BR>
<B>Field Type -</B> This option defines the type of field that will be displayed. TEXT is a standard single-line entry form, AREA is a multi-line text box, SELECT is a single-selection pull-down menu, MULTI is a multiple-select box, RADIO is a list of radio buttons where only one option can be selected, CHECKBOX is a list of checkboxes where multiple options can be selected, DATE is a year month day calendar popup where the agent can select the date and TIME is a time selection box. The default is TEXT. For the SELECT, MULTI, RADIO and CHECKBOX options you must define the option values below in the Field Options box. DISPLAY will display only and not allow for modification by the agent. SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does. HIDDEN will not show the agent the field, but will allow the field to have data imported into it and exported from it, as well as have it available to the script tab and web form address. READONLY will display the value of the data in the field, but will not allow the agent to alter the data. HIDEBLOB is similar to HIDDEN except the data storage type on the database is a BLOB type, suitable for binary data or data that needs to be secured. <B>Field Type -</B> This option defines the type of field that will be displayed. TEXT is a standard single-line entry form, AREA is a multi-line text box, SELECT is a single-selection pull-down menu, MULTI is a multiple-select box, RADIO is a list of radio buttons where only one option can be selected, CHECKBOX is a list of checkboxes where multiple options can be selected, DATE is a year month day calendar popup where the agent can select the date and TIME is a time selection box. The default is TEXT. For the SELECT, MULTI, RADIO and CHECKBOX options you must define the option values below in the Field Options box. DISPLAY will display only and not allow for modification by the agent. SCRIPT will also display only, but you are able to use script variables just like in the Scripts feature. SCRIPT fields will also only display the content in the Options, and not the field name like the DISPLAY type does. HIDDEN will not show the agent the field, but will allow the field to have data imported into it and exported from it, as well as have it available to the script tab and web form address. READONLY will display the value of the data in the field, but will not allow the agent to alter the data. HIDEBLOB is similar to HIDDEN except the data storage type on the database is a BLOB type, suitable for binary data or data that needs to be secured.
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-field_options"> <A NAME="lists_fields-field_options">
<BR> <BR>
<B>Field Options -</B> For the SELECT, MULTI, RADIO and CHECKBOX field types, you must define the option values in this box. You must put a list of comma separated option label and option text here with each option one its own line. The first value should have no spaces in it, and neither values should have any punctuation. For example - electric_meter, Electric Meter <B>Field Options -</B> For the SELECT, MULTI, RADIO and CHECKBOX field types, you must define the option values in this box. You must put a list of comma separated option label and option text here with each option one its own line. The first value should have no spaces in it, and neither values should have any punctuation. For example - electric_meter, Electric Meter
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-multi_position"> <A NAME="lists_fields-multi_position">
<BR> <BR>
<B>Option Position -</B> For CHECKBOX and RADIO field types only, if set to HORIZONTAL the options will appear on the same line possibly wrapping to the line below if there are many options. If set to VERTICAL there will be only one option per line. Default is HORIZONTAL. <B>Option Position -</B> For CHECKBOX and RADIO field types only, if set to HORIZONTAL the options will appear on the same line possibly wrapping to the line below if there are many options. If set to VERTICAL there will be only one option per line. Default is HORIZONTAL.
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-field_size"> <A NAME="lists_fields-field_size">
<BR> <BR>
<B>Field Size -</B> This setting will mean different things depending on what the field type is. For TEXT fields, the size is the number of characters that will show in the field. For AREA fields, the size is the width of the text box in characters. For MULTI fields, this setting defines the number of options to be shown in the multi select list. For SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored. <B>Field Size -</B> This setting will mean different things depending on what the field type is. For TEXT fields, the size is the number of characters that will show in the field. For AREA fields, the size is the width of the text box in characters. For MULTI fields, this setting defines the number of options to be shown in the multi select list. For SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored.
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-field_max"> <A NAME="lists_fields-field_max">
<BR> <BR>
<B>Field Max -</B> This setting will mean different things depending on what the field type is. For TEXT, HIDDEN and READONLY fields, the size is the maximum number of characters that are allowed in the field. For AREA fields, this field defines the number of rows of text visible in the text box. For MULTI, SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored. <B>Field Max -</B> This setting will mean different things depending on what the field type is. For TEXT, HIDDEN and READONLY fields, the size is the maximum number of characters that are allowed in the field. For AREA fields, this field defines the number of rows of text visible in the text box. For MULTI, SELECT, RADIO, CHECKBOX, DATE and TIME this setting is ignored.
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-field_default"> <A NAME="lists_fields-field_default">
<BR> <BR>
<B>Field Default -</B> This optional field lets you define what value to assign to a field if nothing is loaded into that field. Default is NULL which disables the default function. For DATE field types, the default is always set to today unless a number is put in in which case the date will be that many days plus or minus today. For TIME field types, the default is always set to the current server time unless a number is put in in which case the time will be that many minutes plus or minus current time. <B>Field Default -</B> This optional field lets you define what value to assign to a field if nothing is loaded into that field. Default is NULL which disables the default function. For DATE field types, the default is always set to today unless a number is put in in which case the date will be that many days plus or minus today. For TIME field types, the default is always set to the current server time unless a number is put in in which case the time will be that many minutes plus or minus current time.
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-field_cost"> <A NAME="lists_fields-field_cost">
<BR> <BR>
<B>Field Cost -</B> This read only field tells you what the cost of this field is in the custom field table for this list. There is no hard limit for the number of custom fields you can have in a list, but the total of the cost of all fields for the list must be below 65000. This typically allows for hundreds of fields, but if you specify several TEXT fields that are hundreds or thousands of characters in length then you may hit this limit quickly. If you need that much text in a field you should choose an AREA type, which are stored differently and do not use as much table space. <B>Field Cost -</B> This read only field tells you what the cost of this field is in the custom field table for this list. There is no hard limit for the number of custom fields you can have in a list, but the total of the cost of all fields for the list must be below 65000. This typically allows for hundreds of fields, but if you specify several TEXT fields that are hundreds or thousands of characters in length then you may hit this limit quickly. If you need that much text in a field you should choose an AREA type, which are stored differently and do not use as much table space.
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-field_required"> <A NAME="lists_fields-field_required">
<BR> <BR>
<B>Field Required -</B> If set to Y, this field will force the agent to enter text or select an option for this field. Default is N. <B>Field Required -</B> If set to Y, this field will force the agent to enter text or select an option for this field. Default is N.
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-name_position"> <A NAME="lists_fields-name_position">
<BR> <BR>
<B>Field Name Position -</B> If set to LEFT, this field name will appear to the left of the field, if set to TOP the field name will take up the entire line and appear above the field. Default is LEFT. <B>Field Name Position -</B> If set to LEFT, this field name will appear to the left of the field, if set to TOP the field name will take up the entire line and appear above the field. Default is LEFT.
<BR><BR> <BR><BR>
<A NAME="vicidial_lists_fields-copy_option"> <A NAME="lists_fields-copy_option">
<BR> <BR>
<B>Copy Option -</B> When copying field definitions from one list to another, you have a few options for how the copying process works. APPEND will add the fields that are not present in the destination list, if there are matching field labels those will remained untouched, no custom field data will be deleted or modified using this option. UPDATE will update the common field_label fields in the destination list to the field definitions from the source list. custom field data may be modified or lost using this option. REPLACE will remove all existing custom fields in the destination list and replace them with the custom fields from the source list, all custom field data will be deleted using this option. <B>Copy Option -</B> When copying field definitions from one list to another, you have a few options for how the copying process works. APPEND will add the fields that are not present in the destination list, if there are matching field labels those will remained untouched, no custom field data will be deleted or modified using this option. UPDATE will update the common field_label fields in the destination list to the field definitions from the source list. custom field data may be modified or lost using this option. REPLACE will remove all existing custom fields in the destination list and replace them with the custom fields from the source list, all custom field data will be deleted using this option.
<BR><BR> <BR><BR>
@@ -442,7 +443,7 @@ if ($action == "COPY_FIELDS_FORM")
echo "<option selected>APPEND</option>"; echo "<option selected>APPEND</option>";
echo "<option>UPDATE</option>"; echo "<option>UPDATE</option>";
echo "<option>REPLACE</option>"; echo "<option>REPLACE</option>";
echo "</select> $NWB#vicidial_lists_fields-copy_option$NWE</td></tr>\n"; echo "</select> $NWB#lists_fields-copy_option$NWE</td></tr>\n";
echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n"; echo "<tr bgcolor=#B6D3FC><td align=center colspan=2><input type=submit name=SUBMIT value=SUBMIT></td></tr>\n";
echo "</TABLE></center>\n"; echo "</TABLE></center>\n";
echo "</TD></TR></TABLE>\n"; echo "</TD></TR></TABLE>\n";
@@ -995,7 +996,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
$LcolorB='<font color=red>'; $LcolorB='<font color=red>';
$LcolorE='</font>'; $LcolorE='</font>';
} }
if (eregi("1$|3$|5$|7$|9$", $o)) if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -1232,7 +1233,7 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
$LcolorB='<font color=red>'; $LcolorB='<font color=red>';
$LcolorE='</font>'; $LcolorE='</font>';
} }
if (eregi("1$|3$|5$|7$|9$", $o)) if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -1244,11 +1245,11 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
echo "<input type=hidden name=field_label value=\"$A_field_label[$o]\">\n"; echo "<input type=hidden name=field_label value=\"$A_field_label[$o]\">\n";
echo "<a name=\"ANCHOR_$A_field_label[$o]\">\n"; echo "<a name=\"ANCHOR_$A_field_label[$o]\">\n";
echo "<center><TABLE width=$section_width cellspacing=3 cellpadding=1>\n"; echo "<center><TABLE width=$section_width cellspacing=3 cellpadding=1>\n";
echo "<tr $bgcolor><td align=right>Field Label $A_field_rank[$o]: </td><td align=left> $LcolorB<B>$A_field_label[$o]</B>$LcolorE $NWB#vicidial_lists_fields-field_label$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Label $A_field_rank[$o]: </td><td align=left> $LcolorB<B>$A_field_label[$o]</B>$LcolorE $NWB#lists_fields-field_label$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Rank $A_field_rank[$o]: </td><td align=left><select size=1 name=field_rank>\n"; echo "<tr $bgcolor><td align=right>Field Rank $A_field_rank[$o]: </td><td align=left><select size=1 name=field_rank>\n";
echo "$rank_select\n"; echo "$rank_select\n";
echo "<option selected>$A_field_rank[$o]</option>\n"; echo "<option selected>$A_field_rank[$o]</option>\n";
echo "</select> &nbsp; $NWB#vicidial_lists_fields-field_rank$NWE \n"; echo "</select> &nbsp; $NWB#lists_fields-field_rank$NWE \n";
echo " &nbsp; &nbsp; &nbsp; &nbsp; Field Order: <select size=1 name=field_order>\n"; echo " &nbsp; &nbsp; &nbsp; &nbsp; Field Order: <select size=1 name=field_order>\n";
echo "<option>1</option>\n"; echo "<option>1</option>\n";
echo "<option>2</option>\n"; echo "<option>2</option>\n";
@@ -1256,15 +1257,15 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
echo "<option>4</option>\n"; echo "<option>4</option>\n";
echo "<option>5</option>\n"; echo "<option>5</option>\n";
echo "<option selected>$A_field_order[$o]</option>\n"; echo "<option selected>$A_field_order[$o]</option>\n";
echo "</select> &nbsp; $NWB#vicidial_lists_fields-field_order$NWE </td></tr>\n"; echo "</select> &nbsp; $NWB#lists_fields-field_order$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Name $A_field_rank[$o]: </td><td align=left><textarea name=field_name rows=2 cols=60>$A_field_name[$o]</textarea> $NWB#vicidial_lists_fields-field_name$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Name $A_field_rank[$o]: </td><td align=left><textarea name=field_name rows=2 cols=60>$A_field_name[$o]</textarea> $NWB#lists_fields-field_name$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Name Position $A_field_rank[$o]: </td><td align=left><select size=1 name=name_position>\n"; echo "<tr $bgcolor><td align=right>Field Name Position $A_field_rank[$o]: </td><td align=left><select size=1 name=name_position>\n";
echo "<option value=\"LEFT\">LEFT</option>\n"; echo "<option value=\"LEFT\">LEFT</option>\n";
echo "<option value=\"TOP\">TOP</option>\n"; echo "<option value=\"TOP\">TOP</option>\n";
echo "<option selected>$A_name_position[$o]</option>\n"; echo "<option selected>$A_name_position[$o]</option>\n";
echo "</select> $NWB#vicidial_lists_fields-name_position$NWE </td></tr>\n"; echo "</select> $NWB#lists_fields-name_position$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Description $A_field_rank[$o]: </td><td align=left><input type=text name=field_description size=70 maxlength=100 value=\"$A_field_description[$o]\"> $NWB#vicidial_lists_fields-field_description$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Description $A_field_rank[$o]: </td><td align=left><input type=text name=field_description size=70 maxlength=100 value=\"$A_field_description[$o]\"> $NWB#lists_fields-field_description$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Help $A_field_rank[$o]: </td><td align=left><textarea name=field_help rows=2 cols=60>$A_field_help[$o]</textarea> $NWB#vicidial_lists_fields-field_help$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Help $A_field_rank[$o]: </td><td align=left><textarea name=field_help rows=2 cols=60>$A_field_help[$o]</textarea> $NWB#lists_fields-field_help$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Type $A_field_rank[$o]: </td><td align=left><select size=1 name=field_type>\n"; echo "<tr $bgcolor><td align=right>Field Type $A_field_rank[$o]: </td><td align=left><select size=1 name=field_type>\n";
echo "<option>TEXT</option>\n"; echo "<option>TEXT</option>\n";
echo "<option>AREA</option>\n"; echo "<option>AREA</option>\n";
@@ -1280,21 +1281,21 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
echo "<option>HIDEBLOB</option>\n"; echo "<option>HIDEBLOB</option>\n";
echo "<option>READONLY</option>\n"; echo "<option>READONLY</option>\n";
echo "<option selected>$A_field_type[$o]</option>\n"; echo "<option selected>$A_field_type[$o]</option>\n";
echo "</select> $NWB#vicidial_lists_fields-field_type$NWE </td></tr>\n"; echo "</select> $NWB#lists_fields-field_type$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Options $A_field_rank[$o]: </td><td align=left><textarea name=field_options ROWS=5 COLS=60>$A_field_options[$o]</textarea> $NWB#vicidial_lists_fields-field_options$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Options $A_field_rank[$o]: </td><td align=left><textarea name=field_options ROWS=5 COLS=60>$A_field_options[$o]</textarea> $NWB#lists_fields-field_options$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Option Position $A_field_rank[$o]: </td><td align=left><select size=1 name=multi_position>\n"; echo "<tr $bgcolor><td align=right>Option Position $A_field_rank[$o]: </td><td align=left><select size=1 name=multi_position>\n";
echo "<option value=\"HORIZONTAL\">HORIZONTAL</option>\n"; echo "<option value=\"HORIZONTAL\">HORIZONTAL</option>\n";
echo "<option value=\"VERTICAL\">VERTICAL</option>\n"; echo "<option value=\"VERTICAL\">VERTICAL</option>\n";
echo "<option selected>$A_multi_position[$o]</option>\n"; echo "<option selected>$A_multi_position[$o]</option>\n";
echo "</select> $NWB#vicidial_lists_fields-multi_position$NWE </td></tr>\n"; echo "</select> $NWB#lists_fields-multi_position$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Size $A_field_rank[$o]: </td><td align=left><input type=text name=field_size size=5 maxlength=3 value=\"$A_field_size[$o]\"> $NWB#vicidial_lists_fields-field_size$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Size $A_field_rank[$o]: </td><td align=left><input type=text name=field_size size=5 maxlength=3 value=\"$A_field_size[$o]\"> $NWB#lists_fields-field_size$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Max $A_field_rank[$o]: </td><td align=left><input type=text name=field_max size=5 maxlength=3 value=\"$A_field_max[$o]\"> $NWB#vicidial_lists_fields-field_max$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Max $A_field_rank[$o]: </td><td align=left><input type=text name=field_max size=5 maxlength=3 value=\"$A_field_max[$o]\"> $NWB#lists_fields-field_max$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Default $A_field_rank[$o]: </td><td align=left><input type=text name=field_default size=50 maxlength=255 value=\"$A_field_default[$o]\"> $NWB#vicidial_lists_fields-field_default$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Default $A_field_rank[$o]: </td><td align=left><input type=text name=field_default size=50 maxlength=255 value=\"$A_field_default[$o]\"> $NWB#lists_fields-field_default$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Required $A_field_rank[$o]: </td><td align=left><select size=1 name=field_required>\n"; echo "<tr $bgcolor><td align=right>Field Required $A_field_rank[$o]: </td><td align=left><select size=1 name=field_required>\n";
echo "<option value=\"Y\">YES</option>\n"; echo "<option value=\"Y\">YES</option>\n";
echo "<option value=\"N\">NO</option>\n"; echo "<option value=\"N\">NO</option>\n";
echo "<option selected>$A_field_required[$o]</option>\n"; echo "<option selected>$A_field_required[$o]</option>\n";
echo "</select> $NWB#vicidial_lists_fields-field_required$NWE </td></tr>\n"; echo "</select> $NWB#lists_fields-field_required$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=center colspan=2><input type=submit name=submit value=\"SUBMIT\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n"; echo "<tr $bgcolor><td align=center colspan=2><input type=submit name=submit value=\"SUBMIT\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\n";
echo "<B><a href=\"$PHP_SELF?action=DELETE_CUSTOM_FIELD_CONFIRMATION&list_id=$list_id&field_id=$A_field_id[$o]&field_label=$A_field_label[$o]&DB=$DB\">DELETE THIS CUSTOM FIELD</a></B>"; echo "<B><a href=\"$PHP_SELF?action=DELETE_CUSTOM_FIELD_CONFIRMATION&list_id=$list_id&field_id=$A_field_id[$o]&field_label=$A_field_label[$o]&DB=$DB\">DELETE THIS CUSTOM FIELD</a></B>";
echo "</td></tr>\n"; echo "</td></tr>\n";
@@ -1315,22 +1316,22 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
echo "<tr $bgcolor><td align=right>New Field Rank: </td><td align=left><select size=1 name=field_rank>\n"; echo "<tr $bgcolor><td align=right>New Field Rank: </td><td align=left><select size=1 name=field_rank>\n";
echo "$rank_select\n"; echo "$rank_select\n";
echo "<option selected>$last_rank</option>\n"; echo "<option selected>$last_rank</option>\n";
echo "</select> &nbsp; $NWB#vicidial_lists_fields-field_rank$NWE \n"; echo "</select> &nbsp; $NWB#lists_fields-field_rank$NWE \n";
echo " &nbsp; &nbsp; &nbsp; &nbsp; Field Order: <select size=1 name=field_order>\n"; echo " &nbsp; &nbsp; &nbsp; &nbsp; Field Order: <select size=1 name=field_order>\n";
echo "<option selected>1</option>\n"; echo "<option selected>1</option>\n";
echo "<option>2</option>\n"; echo "<option>2</option>\n";
echo "<option>3</option>\n"; echo "<option>3</option>\n";
echo "<option>4</option>\n"; echo "<option>4</option>\n";
echo "<option>5</option>\n"; echo "<option>5</option>\n";
echo "</select> &nbsp; $NWB#vicidial_lists_fields-field_order$NWE </td></tr>\n"; echo "</select> &nbsp; $NWB#lists_fields-field_order$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Label: </td><td align=left><input type=text name=field_label size=20 maxlength=50> $NWB#vicidial_lists_fields-field_label$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Label: </td><td align=left><input type=text name=field_label size=20 maxlength=50> $NWB#lists_fields-field_label$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Name: </td><td align=left><textarea name=field_name rows=2 cols=60></textarea> $NWB#vicidial_lists_fields-field_name$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Name: </td><td align=left><textarea name=field_name rows=2 cols=60></textarea> $NWB#lists_fields-field_name$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Name Position: </td><td align=left><select size=1 name=name_position>\n"; echo "<tr $bgcolor><td align=right>Field Name Position: </td><td align=left><select size=1 name=name_position>\n";
echo "<option value=\"LEFT\">LEFT</option>\n"; echo "<option value=\"LEFT\">LEFT</option>\n";
echo "<option value=\"TOP\">TOP</option>\n"; echo "<option value=\"TOP\">TOP</option>\n";
echo "</select> $NWB#vicidial_lists_fields-name_position$NWE </td></tr>\n"; echo "</select> $NWB#lists_fields-name_position$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Description: </td><td align=left><input name=field_description type=text size=70 maxlength=100> $NWB#vicidial_lists_fields-field_description$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Description: </td><td align=left><input name=field_description type=text size=70 maxlength=100> $NWB#lists_fields-field_description$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Help: </td><td align=left><textarea name=field_help rows=2 cols=60></textarea> $NWB#vicidial_lists_fields-field_help$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Help: </td><td align=left><textarea name=field_help rows=2 cols=60></textarea> $NWB#lists_fields-field_help$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Type: </td><td align=left><select size=1 name=field_type>\n"; echo "<tr $bgcolor><td align=right>Field Type: </td><td align=left><select size=1 name=field_type>\n";
echo "<option>TEXT</option>\n"; echo "<option>TEXT</option>\n";
echo "<option>AREA</option>\n"; echo "<option>AREA</option>\n";
@@ -1346,19 +1347,19 @@ if ( ($action == "MODIFY_CUSTOM_FIELDS") and ($list_id > 99) )
echo "<option>HIDEBLOB</option>\n"; echo "<option>HIDEBLOB</option>\n";
echo "<option>READONLY</option>\n"; echo "<option>READONLY</option>\n";
echo "<option selected>TEXT</option>\n"; echo "<option selected>TEXT</option>\n";
echo "</select> $NWB#vicidial_lists_fields-field_type$NWE </td></tr>\n"; echo "</select> $NWB#lists_fields-field_type$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Options: </td><td align=left><textarea name=field_options ROWS=5 COLS=60></textarea> $NWB#vicidial_lists_fields-field_options$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Options: </td><td align=left><textarea name=field_options ROWS=5 COLS=60></textarea> $NWB#lists_fields-field_options$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Option Position: </td><td align=left><select size=1 name=multi_position>\n"; echo "<tr $bgcolor><td align=right>Option Position: </td><td align=left><select size=1 name=multi_position>\n";
echo "<option selected value=\"HORIZONTAL\">HORIZONTAL</option>\n"; echo "<option selected value=\"HORIZONTAL\">HORIZONTAL</option>\n";
echo "<option value=\"VERTICAL\">VERTICAL</option>\n"; echo "<option value=\"VERTICAL\">VERTICAL</option>\n";
echo "</select> $NWB#vicidial_lists_fields-multi_position$NWE </td></tr>\n"; echo "</select> $NWB#lists_fields-multi_position$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Size: </td><td align=left><input type=text name=field_size size=5 maxlength=3> $NWB#vicidial_lists_fields-field_size$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Size: </td><td align=left><input type=text name=field_size size=5 maxlength=3> $NWB#lists_fields-field_size$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Max: </td><td align=left><input type=text name=field_max size=5 maxlength=3> $NWB#vicidial_lists_fields-field_max$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Max: </td><td align=left><input type=text name=field_max size=5 maxlength=3> $NWB#lists_fields-field_max$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Default: </td><td align=left><input type=text name=field_default size=50 maxlength=255 value=\"NULL\"> $NWB#vicidial_lists_fields-field_default$NWE </td></tr>\n"; echo "<tr $bgcolor><td align=right>Field Default: </td><td align=left><input type=text name=field_default size=50 maxlength=255 value=\"NULL\"> $NWB#lists_fields-field_default$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=right>Field Required: </td><td align=left><select size=1 name=field_required>\n"; echo "<tr $bgcolor><td align=right>Field Required: </td><td align=left><select size=1 name=field_required>\n";
echo "<option value=\"Y\">YES</option>\n"; echo "<option value=\"Y\">YES</option>\n";
echo "<option value=\"N\" SELECTED>NO</option>\n"; echo "<option value=\"N\" SELECTED>NO</option>\n";
echo "</select> $NWB#vicidial_lists_fields-field_required$NWE </td></tr>\n"; echo "</select> $NWB#lists_fields-field_required$NWE </td></tr>\n";
echo "<tr $bgcolor><td align=center colspan=2><input type=submit name=submit value=\"Submit\"></td></tr>\n"; echo "<tr $bgcolor><td align=center colspan=2><input type=submit name=submit value=\"Submit\"></td></tr>\n";
echo "</table></center></form><BR><BR>\n"; echo "</table></center></form><BR><BR>\n";
echo "</table></center><BR><BR>\n"; echo "</table></center><BR><BR>\n";
@@ -1415,7 +1416,7 @@ if ($action == "LIST")
$rowx=mysql_fetch_row($rslt); $rowx=mysql_fetch_row($rslt);
$A_list_fields_count[$o] = $rowx[0]; $A_list_fields_count[$o] = $rowx[0];
} }
if (eregi("1$|3$|5$|7$|9$", $o)) if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -1470,27 +1471,27 @@ if ($action == "ADMIN_LOG")
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("USER|AGENT",$row[4])) {$record_link = "ADD=3&user=$row[6]";} if (preg_match('/USER|AGENT/i', $row[4])) {$record_link = "ADD=3&user=$row[6]";}
if (eregi('CAMPAIGN',$row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";} if (preg_match('/CAMPAIGN/i', $row[4])) {$record_link = "ADD=31&campaign_id=$row[6]";}
if (eregi('LIST',$row[4])) {$record_link = "ADD=311&list_id=$row[6]";} if (preg_match('/LIST/i', $row[4])) {$record_link = "ADD=311&list_id=$row[6]";}
if (eregi('SCRIPT',$row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";} if (preg_match('/SCRIPT/i', $row[4])) {$record_link = "ADD=3111111&script_id=$row[6]";}
if (eregi('FILTER',$row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";} if (preg_match('/FILTER/i', $row[4])) {$record_link = "ADD=31111111&lead_filter_id=$row[6]";}
if (eregi('INGROUP',$row[4])) {$record_link = "ADD=3111&group_id=$row[6]";} if (preg_match('/INGROUP/i', $row[4])) {$record_link = "ADD=3111&group_id=$row[6]";}
if (eregi('DID',$row[4])) {$record_link = "ADD=3311&did_id=$row[6]";} if (preg_match('/DID/i', $row[4])) {$record_link = "ADD=3311&did_id=$row[6]";}
if (eregi('USERGROUP',$row[4])) {$record_link = "ADD=311111&user_group=$row[6]";} if (preg_match('/USERGROUP/i', $row[4])) {$record_link = "ADD=311111&user_group=$row[6]";}
if (eregi('REMOTEAGENT',$row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";} if (preg_match('/REMOTEAGENT/i', $row[4])) {$record_link = "ADD=31111&remote_agent_id=$row[6]";}
if (eregi('PHONE',$row[4])) {$record_link = "ADD=10000000000";} if (preg_match('/PHONE/i', $row[4])) {$record_link = "ADD=10000000000";}
if (eregi('CALLTIME',$row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";} if (preg_match('/CALLTIME/i', $row[4])) {$record_link = "ADD=311111111&call_time_id=$row[6]";}
if (eregi('SHIFT',$row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";} if (preg_match('/SHIFT/i', $row[4])) {$record_link = "ADD=331111111&shift_id=$row[6]";}
if (eregi('CONFTEMPLATE',$row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";} if (preg_match('/CONFTEMPLATE/i', $row[4])) {$record_link = "ADD=331111111111&template_id=$row[6]";}
if (eregi('CARRIER',$row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";} if (preg_match('/CARRIER/i', $row[4])) {$record_link = "ADD=341111111111&carrier_id=$row[6]";}
if (eregi('SERVER',$row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";} if (preg_match('/SERVER/i', $row[4])) {$record_link = "ADD=311111111111&server_id=$row[6]";}
if (eregi('CONFERENCE',$row[4])) {$record_link = "ADD=1000000000000";} if (preg_match('/CONFERENCE/i', $row[4])) {$record_link = "ADD=1000000000000";}
if (eregi('SYSTEM',$row[4])) {$record_link = "ADD=311111111111111";} if (preg_match('/SYSTEM/i', $row[4])) {$record_link = "ADD=311111111111111";}
if (eregi('CATEGOR',$row[4])) {$record_link = "ADD=331111111111111";} if (preg_match('/CATEGOR/i', $row[4])) {$record_link = "ADD=331111111111111";}
if (eregi('GROUPALIAS',$row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";} if (preg_match('/GROUPALIAS/i', $row[4])) {$record_link = "ADD=33111111111&group_alias_id=$row[6]";}
if (eregi("1$|3$|5$|7$|9$", $o)) if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -1655,7 +1656,7 @@ function add_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$field
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtCUSTOM"; $SQL_log = "$stmt|$stmtCUSTOM";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='ADD', record_id='$list_id', event_code='ADMIN ADD CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -1777,7 +1778,7 @@ function modify_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$fi
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtCUSTOM"; $SQL_log = "$stmt|$stmtCUSTOM";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN MODIFY CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -1814,7 +1815,7 @@ function delete_field_function($DB,$link,$linkCUSTOM,$ip,$user,$table_exists,$fi
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtCUSTOM"; $SQL_log = "$stmt|$stmtCUSTOM";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$user', ip_address='$ip', event_section='CUSTOM_FIELDS', event_type='DELETE', record_id='$list_id', event_code='ADMIN DELETE CUSTOM LIST FIELD', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -1,5 +1,5 @@
<?php <?php
# admin_modify_lead.php version 2.6 # admin_modify_lead.php version 2.8
# #
# ViciDial database administration modify lead in vicidial_list # ViciDial database administration modify lead in vicidial_list
# admin_modify_lead.php # admin_modify_lead.php
@@ -52,6 +52,7 @@
# 121130-1033 - Changed scheduled callback user ID field to be 20 characters, issue #467 # 121130-1033 - Changed scheduled callback user ID field to be 20 characters, issue #467
# 121222-2145 - Added email log # 121222-2145 - Added email log
# 130123-1940 - Added options.php option to allow display of non-selectable statuses # 130123-1940 - Added options.php option to allow display of non-selectable statuses
# 130610-1049 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -162,8 +163,8 @@ if (isset($_POST["appointment_time"])) {$appointment_time=$_POST["appointment_
if (isset($_GET["CBstatus"])) {$CBstatus=$_GET["CBstatus"];} if (isset($_GET["CBstatus"])) {$CBstatus=$_GET["CBstatus"];}
elseif (isset($_POST["CBstatus"])) {$CBstatus=$_POST["CBstatus"];} elseif (isset($_POST["CBstatus"])) {$CBstatus=$_POST["CBstatus"];}
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_PW);
$STARTtime = date("U"); $STARTtime = date("U");
$TODAY = date("Y-m-d"); $TODAY = date("Y-m-d");
@@ -198,17 +199,17 @@ if ($qm_conf_ct > 0)
if ($non_latin < 1) if ($non_latin < 1)
{ {
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_PW);
$old_phone = ereg_replace("[^0-9]","",$old_phone); $old_phone = preg_replace('/[^0-9]/','',$old_phone);
$phone_number = ereg_replace("[^0-9]","",$phone_number); $phone_number = preg_replace('/[^0-9]/','',$phone_number);
$alt_phone = ereg_replace("[^0-9]","",$alt_phone); $alt_phone = preg_replace('/[^0-9]/','',$alt_phone);
} # end of non_latin } # end of non_latin
else else
{ {
$PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW);
} }
if (strlen($phone_number)<6) {$phone_number=$old_phone;} if (strlen($phone_number)<6) {$phone_number=$old_phone;}
@@ -271,7 +272,7 @@ $rslt=mysql_query($stmt, $link);
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$LOGallowed_campaigns = $row[0]; $LOGallowed_campaigns = $row[0];
if (!eregi("-ALL",$LOGallowed_campaigns)) if (!preg_match('/\-ALL/i', $LOGallowed_campaigns))
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -288,7 +289,7 @@ if (!eregi("-ALL",$LOGallowed_campaigns))
$camp_lists .= "'$rowx[0]',"; $camp_lists .= "'$rowx[0]',";
$o++; $o++;
} }
$camp_lists = eregi_replace(".$","",$camp_lists); $camp_lists = preg_replace('/.$/i','',$camp_lists);;
if (strlen($camp_lists)<2) {$camp_lists="''";} if (strlen($camp_lists)<2) {$camp_lists="''";}
$LOGallowed_listsSQL = "and list_id IN($camp_lists)"; $LOGallowed_listsSQL = "and list_id IN($camp_lists)";
$whereLOGallowed_listsSQL = "where list_id IN($camp_lists)"; $whereLOGallowed_listsSQL = "where list_id IN($camp_lists)";
@@ -426,7 +427,7 @@ if ($end_call > 0)
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='MODIFY', record_id='$lead_id', event_code='ADMIN MODIFY LEAD', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='MODIFY', record_id='$lead_id', event_code='ADMIN MODIFY LEAD', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -583,7 +584,7 @@ else
while ($alts_to_print > $c) while ($alts_to_print > $c)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $c)) if (preg_match("/1$|3$|5$|7$|9$/i", $c))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -616,7 +617,7 @@ else
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (strlen($log_campaign)<1) {$log_campaign = $row[3];} if (strlen($log_campaign)<1) {$log_campaign = $row[3];}
if (eregi("1$|3$|5$|7$|9$", $u)) if (preg_match("/1$|3$|5$|7$|9$/i", $u))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -664,7 +665,7 @@ else
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];} if (strlen($Alog_campaign)<1) {$Alog_campaign = $row[5];}
if (eregi("1$|3$|5$|7$|9$", $y)) if (preg_match("/1$|3$|5$|7$|9$/i", $y))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -698,7 +699,7 @@ else
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];} if (strlen($Clog_campaign)<1) {$Clog_campaign = $row[3];}
if (eregi("1$|3$|5$|7$|9$", $y)) if (preg_match("/1$|3$|5$|7$|9$/i", $y))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -968,7 +969,7 @@ else
while ($statuses_to_print > $o) while ($statuses_to_print > $o)
{ {
$rowx=mysql_fetch_row($rslt); $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 .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;} {$statuses_list .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else else
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";} {$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
@@ -984,7 +985,7 @@ else
while ($CAMPstatuses_to_print > $o) while ($CAMPstatuses_to_print > $o)
{ {
$rowx=mysql_fetch_row($rslt); $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 .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;} {$statuses_list .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else else
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";} {$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
@@ -1082,7 +1083,7 @@ else
while ($statuses_to_print > $o) while ($statuses_to_print > $o)
{ {
$rowx=mysql_fetch_row($rslt); $rowx=mysql_fetch_row($rslt);
if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) if ( (strlen($lead_status) == strlen($rowx[0])) and (preg_match("/$lead_status/i",$rowx[0])) )
{$statuses_list .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;} {$statuses_list .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else else
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";} {$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
@@ -1098,7 +1099,7 @@ else
while ($CAMPstatuses_to_print > $o) while ($CAMPstatuses_to_print > $o)
{ {
$rowx=mysql_fetch_row($rslt); $rowx=mysql_fetch_row($rslt);
if ( (strlen($lead_status) == strlen($rowx[0])) and (eregi($lead_status,$rowx[0])) ) if ( (strlen($lead_status) == strlen($rowx[0])) and (preg_match("/$lead_status/i",$rowx[0])) )
{$statuses_list .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;} {$statuses_list .= "<option SELECTED value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n"; $DS++;}
else else
{$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";} {$statuses_list .= "<option value=\"$rowx[0]\">$rowx[0] - $rowx[1]</option>\n";}
@@ -1326,7 +1327,7 @@ else
while ($logs_to_print > $u) while ($logs_to_print > $u)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $u)) if (preg_match("/1$|3$|5$|7$|9$/i", $u))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -1359,7 +1360,7 @@ else
while ($logs_to_print > $u) while ($logs_to_print > $u)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $u)) if (preg_match("/1$|3$|5$|7$|9$/i", $u))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -1397,7 +1398,7 @@ else
while ($logs_to_print > $u) while ($logs_to_print > $u)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $u)) if (preg_match("/1$|3$|5$|7$|9$/i", $u))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -1407,9 +1408,9 @@ else
if (strlen($location)>2) if (strlen($location)>2)
{ {
$URLserver_ip = $location; $URLserver_ip = $location;
$URLserver_ip = eregi_replace('http://','',$URLserver_ip); $URLserver_ip = preg_replace('/http:\/\//i', '',$URLserver_ip);
$URLserver_ip = eregi_replace('https://','',$URLserver_ip); $URLserver_ip = preg_replace('/https:\/\//i', '',$URLserver_ip);
$URLserver_ip = eregi_replace("\/.*",'',$URLserver_ip); $URLserver_ip = preg_replace('/\/.*/i', '',$URLserver_ip);
$stmt="select count(*) from servers where server_ip='$URLserver_ip';"; $stmt="select count(*) from servers where server_ip='$URLserver_ip';";
$rsltx=mysql_query($stmt, $link); $rsltx=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rsltx);
@@ -1420,13 +1421,13 @@ else
$rsltx=mysql_query($stmt, $link); $rsltx=mysql_query($stmt, $link);
$rowx=mysql_fetch_row($rsltx); $rowx=mysql_fetch_row($rsltx);
if (eregi("ALT_IP",$rowx[0])) if (preg_match("/ALT_IP/i",$rowx[0]))
{ {
$location = eregi_replace($URLserver_ip, $rowx[1], $location); $location = preg_replace("/$URLserver_ip/i", "$rowx[1]", $location);
} }
if (eregi("EXTERNAL_IP",$rowx[0])) if (preg_match("/EXTERNAL_IP/i",$rowx[0]))
{ {
$location = eregi_replace($URLserver_ip, $rowx[2], $location); $location = preg_replace("/$URLserver_ip/i", "$rowx[2]", $location);
} }
} }
} }
@@ -1435,7 +1436,7 @@ else
{$locat = substr($location,0,27); $locat = "$locat...";} {$locat = substr($location,0,27); $locat = "$locat...";}
else else
{$locat = $location;} {$locat = $location;}
if ( (eregi("ftp",$location)) or (eregi("http",$location)) ) if ( (preg_match('/ftp/i',$location)) or (preg_match('/http/i',$location)) )
{$location = "<a href=\"$location\">$locat</a>";} {$location = "<a href=\"$location\">$locat</a>";}
else else
{$location = $locat;} {$location = $locat;}
@@ -12,10 +12,11 @@
# 120209-1545 - Added phone context option # 120209-1545 - Added phone context option
# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled # 120223-2249 - Removed logging of good login passwords if webroot writable is enabled
# 120820-1026 - Added webphone option Y_API_LAUNCH # 120820-1026 - Added webphone option Y_API_LAUNCH
# 130610-1043 - Changed all ereg to preg
# #
$admin_version = '2.6-6'; $admin_version = '2.8-7';
$build = '120820-1026'; $build = '130610-1043';
require("dbconnect.php"); require("dbconnect.php");
@@ -65,28 +66,28 @@ if (strlen($DB) < 1)
if ($non_latin < 1) if ($non_latin < 1)
{ {
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace("/[^-_0-9a-zA-Z]/", "",$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace("/[^-_0-9a-zA-Z]/", "",$PHP_AUTH_PW);
$servers = ereg_replace("'|\"|\\\\|;","",$servers); $servers = preg_replace("/'|\"|\\\\|;/","",$servers);
$phones = ereg_replace("'|\"|\\\\|;","",$phones); $phones = preg_replace("/'|\"|\\\\|;/","",$phones);
$action = ereg_replace("[^-_0-9a-zA-Z]","",$action); $action = preg_replace("/[^-_0-9a-zA-Z]/", "",$action);
$conf_secret = ereg_replace("[^-_0-9a-zA-Z]","",$conf_secret); $conf_secret = preg_replace("/[^-_0-9a-zA-Z]/", "",$conf_secret);
$pass = ereg_replace("[^-_0-9a-zA-Z]","",$pass); $pass = preg_replace("/[^-_0-9a-zA-Z]/", "",$pass);
$alias_option = ereg_replace("[^-_0-9a-zA-Z]","",$alias_option); $alias_option = preg_replace("/[^-_0-9a-zA-Z]/", "",$alias_option);
$alias_suffix = ereg_replace("[^0-9a-zA-Z]","",$alias_suffix); $alias_suffix = preg_replace("/[^0-9a-zA-Z]/","",$alias_suffix);
$protocol = ereg_replace("[^-_0-9a-zA-Z]","",$protocol); $protocol = preg_replace("/[^-_0-9a-zA-Z]/", "",$protocol);
$local_gmt = ereg_replace("[^- \.\,\_0-9a-zA-Z]","",$local_gmt); $local_gmt = preg_replace("/[^- \.\,\_0-9a-zA-Z]/","",$local_gmt);
$is_webphone = ereg_replace("[^-_0-9a-zA-Z]","",$is_webphone); $is_webphone = preg_replace("/[^-_0-9a-zA-Z]/", "",$is_webphone);
$webphone_dialpad = ereg_replace("[^-_0-9a-zA-Z]","",$webphone_dialpad); $webphone_dialpad = preg_replace("/[^-_0-9a-zA-Z]/", "",$webphone_dialpad);
$webphone_auto_answer = ereg_replace("[^NY]","",$webphone_auto_answer); $webphone_auto_answer = preg_replace("/[^NY]/","",$webphone_auto_answer);
$use_external_server_ip = ereg_replace("[^NY]","",$use_external_server_ip); $use_external_server_ip = preg_replace("/[^NY]/","",$use_external_server_ip);
$phone_context = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_context); $phone_context = preg_replace("/[^-\_0-9a-zA-Z]/","",$phone_context);
} # end of non_latin } # end of non_latin
else else
{ {
$PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW);
} }
$STARTtime = date("U"); $STARTtime = date("U");
@@ -458,7 +459,7 @@ if ($action == "ADD_PHONES_SUBMIT")
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/','',$SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONES', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN BULK ADD PHONE', event_sql=\"$SQL_log\", event_notes='$SN[$s]|$PN[$p]';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONES', event_type='ADD', record_id='$PN[$p]', event_code='ADMIN BULK ADD PHONE', event_sql=\"$SQL_log\", event_notes='$SN[$s]|$PN[$p]';";
# if ($DB) {echo "|$stmt|\n";} # if ($DB) {echo "|$stmt|\n";}
@@ -497,7 +498,7 @@ if ($action == "ADD_PHONES_SUBMIT")
{ {
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/','',$SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONEALIASES', event_type='ADD', record_id='$alias_id', event_code='ADMIN ADD BULK PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='PHONEALIASES', event_type='ADD', record_id='$alias_id', event_code='ADMIN ADD BULK PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';";
# if ($DB) {echo "|$stmt|\n";} # if ($DB) {echo "|$stmt|\n";}
@@ -1,5 +1,5 @@
<?php <?php
# admin_search_lead.php version 2.6 # admin_search_lead.php version 2.8
# #
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
@@ -30,6 +30,7 @@
# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled # 120223-2249 - Removed logging of good login passwords if webroot writable is enabled
# 120409-1131 - Added option for log searches done through slave DB server # 120409-1131 - Added option for log searches done through slave DB server
# 121025-1732 - Added owner field search option # 121025-1732 - Added owner field search option
# 130610-1054 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -91,9 +92,9 @@ while ($i < $qm_conf_ct)
$report_name = 'Search Leads Logs'; $report_name = 'Search Leads Logs';
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$phone = ereg_replace("[^0-9]","",$phone); $phone = preg_replace('/[^0-9]/','',$phone);
if (strlen($alt_phone_search) < 2) {$alt_phone_search='No';} if (strlen($alt_phone_search) < 2) {$alt_phone_search='No';}
$STARTtime = date("U"); $STARTtime = date("U");
@@ -169,7 +170,7 @@ $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
$LOGallowed_listsSQL=''; $LOGallowed_listsSQL='';
$whereLOGallowed_listsSQL=''; $whereLOGallowed_listsSQL='';
if (!eregi("-ALL",$LOGallowed_campaigns)) if (!preg_match('/\-ALL/i', $LOGallowed_campaigns))
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -186,7 +187,7 @@ if (!eregi("-ALL",$LOGallowed_campaigns))
$camp_lists .= "'$rowx[0]',"; $camp_lists .= "'$rowx[0]',";
$o++; $o++;
} }
$camp_lists = eregi_replace(".$","",$camp_lists); $camp_lists = preg_replace('/.$/i','',$camp_lists);;
if (strlen($camp_lists)<2) {$camp_lists="''";} if (strlen($camp_lists)<2) {$camp_lists="''";}
$LOGallowed_listsSQL = "and list_id IN($camp_lists)"; $LOGallowed_listsSQL = "and list_id IN($camp_lists)";
$whereLOGallowed_listsSQL = "where list_id IN($camp_lists)"; $whereLOGallowed_listsSQL = "where list_id IN($camp_lists)";
@@ -419,7 +420,7 @@ else
} }
$o++; $o++;
$search_lead = $row[0]; $search_lead = $row[0];
if (eregi("1$|3$|5$|7$|9$", $o)) if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -484,7 +485,7 @@ else
} }
$o++; $o++;
$search_lead = $row[0]; $search_lead = $row[0];
if (eregi("1$|3$|5$|7$|9$", $o)) if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -546,7 +547,7 @@ else
} }
$o++; $o++;
$search_lead = $row[0]; $search_lead = $row[0];
if (eregi("1$|3$|5$|7$|9$", $o)) if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -564,7 +565,7 @@ else
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -698,7 +699,7 @@ else
### LOG INSERTION Search Log Table ### ### LOG INSERTION Search Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmtL="INSERT INTO vicidial_lead_search_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', source='admin', results='0', search_query=\"$SQL_log\";"; $stmtL="INSERT INTO vicidial_lead_search_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', source='admin', results='0', search_query=\"$SQL_log\";";
if ($DB) {echo "|$stmtL|\n";} if ($DB) {echo "|$stmtL|\n";}
@@ -794,7 +795,7 @@ else
$o++; $o++;
$search_lead = $row[0]; $search_lead = $row[0];
if (eregi("1$|3$|5$|7$|9$", $o)) if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -817,7 +818,7 @@ else
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='SEARCH', record_id='$search_lead', event_code='ADMIN SEARCH LEAD', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
+13 -12
View File
@@ -1,7 +1,7 @@
<?php <?php
# audio_store.php # audio_store.php
# #
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# Central Audio Storage script # Central Audio Storage script
# #
@@ -16,10 +16,11 @@
# 120531-1747 - Another filtering fix # 120531-1747 - Another filtering fix
# 121019-0816 - Added audio file delete process # 121019-0816 - Added audio file delete process
# 121129-1620 - Hide delete option text if not allowed # 121129-1620 - Hide delete option text if not allowed
# 130610-1052 - Finalized changing of all ereg instances to preg
# #
$version = '2.6-10'; $version = '2.8-11';
$build = '121129-1620'; $build = '130610-1052';
$MT[0]=''; $MT[0]='';
@@ -75,7 +76,7 @@ if ($ss_conf_ct > 0)
### check if sounds server matches this server IP, if not then exit with an error ### check if sounds server matches this server IP, if not then exit with an error
if ( ( (strlen($sounds_web_server)) != (strlen($server_name)) ) or (!eregi("$sounds_web_server",$server_name) ) ) if ( ( (strlen($sounds_web_server)) != (strlen($server_name)) ) or (!preg_match("/$sounds_web_server/i",$server_name) ) )
{ {
echo "ERROR: server($server_name) does not match sounds web server ip($sounds_web_server)\n"; echo "ERROR: server($server_name) does not match sounds web server ip($sounds_web_server)\n";
exit; exit;
@@ -137,9 +138,9 @@ if ( (!preg_match("/\|$ip\|/", $server_ips)) and ($formIPvalid < 1) )
$user_set=1; $user_set=1;
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_PW);
$delete_file = ereg_replace("[^-\._0-9a-zA-Z]","",$delete_file); $delete_file = preg_replace('/[^-\._0-9a-zA-Z]/','',$delete_file);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and ( (modify_campaigns='1') or (modify_audiostore='1') )"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and ( (modify_campaigns='1') or (modify_audiostore='1') )";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -290,8 +291,8 @@ if ($user_set < 1)
{ {
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER']; $PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW']; $PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_PW);
} }
##### BEGIN Set variables to make header show properly ##### ##### BEGIN Set variables to make header show properly #####
$ADD = '311111111111111'; $ADD = '311111111111111';
@@ -330,10 +331,10 @@ $browser = getenv("HTTP_USER_AGENT");
$script_name = getenv("SCRIPT_NAME"); $script_name = getenv("SCRIPT_NAME");
$server_name = getenv("SERVER_NAME"); $server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT"); $server_port = getenv("SERVER_PORT");
if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';} else {$HTTPprotocol = 'http://';}
$admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; $admDIR = "$HTTPprotocol$server_name:$server_port$script_name";
$admDIR = eregi_replace('audio_store.php','',$admDIR); $admDIR = preg_replace('/audio_store\.php/i', '',$admDIR);
$admSCR = 'admin.php'; $admSCR = 'admin.php';
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; $NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; $NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
@@ -377,7 +378,7 @@ if ($action == "MANUALUPLOAD")
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='AUDIOSTORE', event_type='LOAD', record_id='manualupload', event_code='$audiofile_name " . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "', event_sql=\"$SQL_log\", event_notes='$audiofile_name $AF_path $AF_orig';"; $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='AUDIOSTORE', event_type='LOAD', record_id='manualupload', event_code='$audiofile_name " . filesize("$WeBServeRRooT/$sounds_web_directory/$audiofile_name") . "', event_sql=\"$SQL_log\", event_notes='$audiofile_name $AF_path $AF_orig';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -34,6 +34,7 @@
# 111010-1930 - Added ALTERNATE_1 format # 111010-1930 - Added ALTERNATE_1 format
# 111104-1240 - Added user_group restrictions for selecting in-groups # 111104-1240 - Added user_group restrictions for selecting in-groups
# 130414-0122 - Added report logging # 130414-0122 - Added report logging
# 130610-0952 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -102,8 +103,8 @@ if ($qm_conf_ct > 0)
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -180,7 +181,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -191,7 +192,7 @@ $regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -201,7 +202,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -244,14 +245,14 @@ if ($run_export > 0)
} }
$i++; $i++;
} }
if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) if ( (preg_match('/\s\-\-NONE\-\-\s/',$campaign_string) ) or ($campaign_ct < 1) )
{ {
$campaign_SQL = "campaign_id IN('')"; $campaign_SQL = "campaign_id IN('')";
$RUNcampaign=0; $RUNcampaign=0;
} }
else else
{ {
$campaign_SQL = eregi_replace(",$",'',$campaign_SQL); $campaign_SQL = preg_replace('/,$/i', '',$campaign_SQL);
$campaign_SQL = "and vl.campaign_id IN($campaign_SQL)"; $campaign_SQL = "and vl.campaign_id IN($campaign_SQL)";
$RUNcampaign++; $RUNcampaign++;
} }
@@ -263,7 +264,7 @@ if ($run_export > 0)
$group_SQL .= "'$group[$i]',"; $group_SQL .= "'$group[$i]',";
$i++; $i++;
} }
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\s\-\-NONE\-\-\s/',$group_string) ) or ($group_ct < 1) )
{ {
$group_SQL = "''"; $group_SQL = "''";
$group_SQL = "campaign_id IN('')"; $group_SQL = "campaign_id IN('')";
@@ -271,7 +272,7 @@ if ($run_export > 0)
} }
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
$group_SQL = "and vl.campaign_id IN($group_SQL)"; $group_SQL = "and vl.campaign_id IN($group_SQL)";
$RUNgroup++; $RUNgroup++;
} }
@@ -283,13 +284,13 @@ if ($run_export > 0)
$user_group_SQL .= "'$user_group[$i]',"; $user_group_SQL .= "'$user_group[$i]',";
$i++; $i++;
} }
if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$user_group_string) ) or ($user_group_ct < 1) )
{ {
$user_group_SQL = ""; $user_group_SQL = "";
} }
else else
{ {
$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = preg_replace('/,$/i', '',$user_group_SQL);
$user_group_SQL = "and vl.user_group IN($user_group_SQL)"; $user_group_SQL = "and vl.user_group IN($user_group_SQL)";
} }
@@ -300,13 +301,13 @@ if ($run_export > 0)
$list_SQL .= "'$list_id[$i]',"; $list_SQL .= "'$list_id[$i]',";
$i++; $i++;
} }
if ( (ereg("--ALL--",$list_string) ) or ($list_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$list_string) ) or ($list_ct < 1) )
{ {
$list_SQL = ""; $list_SQL = "";
} }
else else
{ {
$list_SQL = eregi_replace(",$",'',$list_SQL); $list_SQL = preg_replace('/,$/i', '',$list_SQL);
$list_SQL = "and vi.list_id IN($list_SQL)"; $list_SQL = "and vi.list_id IN($list_SQL)";
} }
@@ -317,13 +318,13 @@ if ($run_export > 0)
$status_SQL .= "'$status[$i]',"; $status_SQL .= "'$status[$i]',";
$i++; $i++;
} }
if ( (ereg("--ALL--",$status_string) ) or ($status_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$status_string) ) or ($status_ct < 1) )
{ {
$status_SQL = ""; $status_SQL = "";
} }
else else
{ {
$status_SQL = eregi_replace(",$",'',$status_SQL); $status_SQL = preg_replace('/,$/i', '',$status_SQL);
$status_SQL = "and vl.status IN($status_SQL)"; $status_SQL = "and vl.status IN($status_SQL)";
} }
@@ -1010,7 +1011,7 @@ else
$o=0; $o=0;
while ($campaigns_to_print > $o) while ($campaigns_to_print > $o)
{ {
if (ereg("\|$LISTcampaigns[$o]\|",$campaign_string)) if (preg_match("/\|$LISTcampaigns[$o]\|/",$campaign_string))
{echo "<option selected value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} {echo "<option selected value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";}
else else
{echo "<option value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} {echo "<option value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";}
@@ -1026,7 +1027,7 @@ else
$o=0; $o=0;
while ($groups_to_print > $o) while ($groups_to_print > $o)
{ {
if (ereg("\|$LISTgroups[$o]\|",$group_string)) if (preg_match("/\|$LISTgroups[$o]\|/",$group_string))
{echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";}
else else
{echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";}
@@ -1040,7 +1041,7 @@ else
$o=0; $o=0;
while ($lists_to_print > $o) while ($lists_to_print > $o)
{ {
if (ereg("\|$LISTlists[$o]\|",$list_string)) if (preg_match("/\|$LISTlists[$o]\|/",$list_string))
{echo "<option selected value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} {echo "<option selected value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";}
else else
{echo "<option value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} {echo "<option value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";}
@@ -1053,7 +1054,7 @@ else
$o=0; $o=0;
while ($statuses_to_print > $o) while ($statuses_to_print > $o)
{ {
if (ereg("\|$LISTstatus[$o]\|",$list_string)) if (preg_match("/\|$LISTstatus[$o]\|/",$list_string))
{echo "<option selected value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} {echo "<option selected value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";}
else else
{echo "<option value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} {echo "<option value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";}
@@ -1068,7 +1069,7 @@ else
$o=0; $o=0;
while ($user_groups_to_print > $o) while ($user_groups_to_print > $o)
{ {
if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) if (preg_match("/\|$LISTuser_groups[$o]\|/",$user_group_string))
{echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";}
else else
{echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";}
@@ -1108,7 +1109,7 @@ if ($file_exported > 0)
{ {
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtA|"; $SQL_log = "$stmt|$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT CALLS REPORT', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT CALLS REPORT', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -6,6 +6,7 @@
# CHANGES # CHANGES
# 120819-0119 - First build # 120819-0119 - First build
# 130414-0021 - Added admin logging # 130414-0021 - Added admin logging
# 130610-0951 - Finalized changing of all ereg instances to preg
# #
header ("Content-type: text/html; charset=utf-8"); header ("Content-type: text/html; charset=utf-8");
@@ -50,8 +51,8 @@ while ($i < $qm_conf_ct)
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$StarTtimE = date("U"); $StarTtimE = date("U");
$TODAY = date("Y-m-d"); $TODAY = date("Y-m-d");
@@ -125,7 +126,7 @@ $LOGadmin_viewable_call_times = $row[3];
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -153,7 +154,7 @@ if ($SUBMIT && $old_user && $new_user && $confirm_transfer) {
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$upd_stmt|"; $SQL_log = "$upd_stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='MODIFY', record_id='$new_user', event_code='ADMIN CALLBACK BULK CHANGE', event_sql=\"$SQL_log\", event_notes='Old user: $old_user';"; $stmt="INSERT INTO vicidial_admin_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='MODIFY', record_id='$new_user', event_code='ADMIN CALLBACK BULK CHANGE', event_sql=\"$SQL_log\", event_notes='Old user: $old_user';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
+30 -29
View File
@@ -1,7 +1,7 @@
<?php <?php
# callcard_admin.php # callcard_admin.php
# #
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# This callcard script is to administer the callcard accounts in ViciDial # This callcard script is to administer the callcard accounts in ViciDial
# it is separate from the standard admin.php script. callcard_enabled in # it is separate from the standard admin.php script. callcard_enabled in
@@ -13,10 +13,11 @@
# 100616-0847 - Fixed batch issue # 100616-0847 - Fixed batch issue
# 100823-1342 - Added Search option and display for level 7 users, added pin number search # 100823-1342 - Added Search option and display for level 7 users, added pin number search
# 120117-1457 - Security fix, issue #544 # 120117-1457 - Security fix, issue #544
# 130610-1103 - Finalized changing of all ereg instances to preg
# #
$version = '2.4-5'; $version = '2.8-6';
$build = '120117-1457'; $build = '130610-1103';
$MT[0]=''; $MT[0]='';
@@ -105,22 +106,22 @@ if ($callcard_enabled < 1)
if ($non_latin < 1) if ($non_latin < 1)
{ {
### Clean Variable Values ### ### Clean Variable Values ###
$DB = ereg_replace("[^0-9]","",$DB); $DB = preg_replace('/[^0-9]/','',$DB);
$action = ereg_replace("[^\_0-9a-zA-Z]","",$action); $action = preg_replace('/[^\_0-9a-zA-Z]/','',$action);
$card_id = ereg_replace("[^-\_0-9]","",$card_id); $card_id = preg_replace('/[^-\_0-9]/','',$card_id);
$run = ereg_replace("[^0-9]","",$run); $run = preg_replace('/[^0-9]/','',$run);
$batch = ereg_replace("[^0-9]","",$batch); $batch = preg_replace('/[^0-9]/','',$batch);
$pack = ereg_replace("[^0-9]","",$pack); $pack = preg_replace('/[^0-9]/','',$pack);
$sequence = ereg_replace("[^0-9]","",$sequence); $sequence = preg_replace('/[^0-9]/','',$sequence);
$territory_description = ereg_replace("[^- \_\.\,0-9a-zA-Z]","",$territory_description); $territory_description = preg_replace('/[^- \_\.\,0-9a-zA-Z]/','',$territory_description);
$user = ereg_replace("[^-\_0-9a-zA-Z]","",$user); $user = preg_replace('/[^-\_0-9a-zA-Z]/', '',$user);
$old_territory = ereg_replace("[^-\_0-9a-zA-Z]","",$old_territory); $old_territory = preg_replace('/[^-\_0-9a-zA-Z]/', '',$old_territory);
$old_user = ereg_replace("[^-\_0-9a-zA-Z]","",$old_user); $old_user = preg_replace('/[^-\_0-9a-zA-Z]/', '',$old_user);
$accountid = ereg_replace("[^-\_0-9a-zA-Z]","",$accountid); $accountid = preg_replace('/[^-\_0-9a-zA-Z]/', '',$accountid);
$pin = ereg_replace("[^0-9a-zA-Z]","",$pin); $pin = preg_replace('/[^0-9a-zA-Z]/','',$pin);
} }
if (eregi("YES",$batch)) if (preg_match("/YES/i",$batch))
{ {
$USER='batch'; $USER='batch';
$PASS='batch'; $PASS='batch';
@@ -129,8 +130,8 @@ else
{ {
$USER=$_SERVER['PHP_AUTH_USER']; $USER=$_SERVER['PHP_AUTH_USER'];
$PASS=$_SERVER['PHP_AUTH_PW']; $PASS=$_SERVER['PHP_AUTH_PW'];
$USER = ereg_replace("[^0-9a-zA-Z]","",$USER); $USER = preg_replace('/[^0-9a-zA-Z]/','',$USER);
$PASS = ereg_replace("[^0-9a-zA-Z]","",$PASS); $PASS = preg_replace('/[^0-9a-zA-Z]/','',$PASS);
$stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 7 and callcard_admin='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$USER' and pass='$PASS' and user_level > 7 and callcard_admin='1' and active='Y';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -248,10 +249,10 @@ $browser = getenv("HTTP_USER_AGENT");
$script_name = getenv("SCRIPT_NAME"); $script_name = getenv("SCRIPT_NAME");
$server_name = getenv("SERVER_NAME"); $server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT"); $server_port = getenv("SERVER_PORT");
if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';} else {$HTTPprotocol = 'http://';}
$admDIR = "$HTTPprotocol$server_name:$server_port$script_name"; $admDIR = "$HTTPprotocol$server_name:$server_port$script_name";
$admDIR = eregi_replace('audio_store.php','',$admDIR); $admDIR = preg_replace('/callcard_admin\.php/i', '',$admDIR);
$admSCR = 'admin.php'; $admSCR = 'admin.php';
$NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999"; $NWB = " &nbsp; <a href=\"javascript:openNewWindow('$admDIR$admSCR?ADD=99999";
$NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>"; $NWE = "')\"><IMG SRC=\"help.gif\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP></A>";
@@ -313,7 +314,7 @@ if ($action == "CALLCARD_STATUS")
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='CALLCARD', event_type='MODIFY', record_id='$card_id', event_code='ADMIN MODIFY CALLCARD', event_sql=\"$SQL_log\", event_notes='$status';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$USER', ip_address='$ip', event_section='CALLCARD', event_type='MODIFY', record_id='$card_id', event_code='ADMIN MODIFY CALLCARD', event_sql=\"$SQL_log\", event_notes='$status';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -434,7 +435,7 @@ if ($action == "CALLCARD_DETAIL")
while ($vt_ct > $i) while ($vt_ct > $i)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $i)) if (preg_match("/1$|3$|5$|7$|9$/i", $i))
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
else else
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
@@ -491,7 +492,7 @@ if ($action == "CALLCARD_SUMMARY")
$Lcount[$i] = $row[0]; $Lcount[$i] = $row[0];
$Lstatus[$i] = $row[1]; $Lstatus[$i] = $row[1];
if (eregi("1$|3$|5$|7$|9$", $i)) if (preg_match("/1$|3$|5$|7$|9$/i", $i))
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
else else
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
@@ -543,7 +544,7 @@ if ($action == "CALLCARD_SUMMARY")
while ($vt_ct > $i) while ($vt_ct > $i)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $i)) if (preg_match("/1$|3$|5$|7$|9$/i", $i))
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
else else
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
@@ -595,7 +596,7 @@ if ($action == "CALLCARD_RUNS")
$Lcount[$i] = $row[0]; $Lcount[$i] = $row[0];
$Lrun[$i] = $row[1]; $Lrun[$i] = $row[1];
if (eregi("1$|3$|5$|7$|9$", $i)) if (preg_match("/1$|3$|5$|7$|9$/i", $i))
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
else else
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
@@ -640,7 +641,7 @@ if ($action == "CALLCARD_BATCHES")
$Lcount[$i] = $row[0]; $Lcount[$i] = $row[0];
$Lbatch[$i] = $row[1]; $Lbatch[$i] = $row[1];
if (eregi("1$|3$|5$|7$|9$", $i)) if (preg_match("/1$|3$|5$|7$|9$/i", $i))
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
else else
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
@@ -736,7 +737,7 @@ if ($action == "GENERATE_RESULTS")
$stmt="INSERT INTO callcard_accounts_details SET card_id='$Pcard_id',status='GENERATE',run='$run',pack='',batch='$Pbatch',sequence='$Psequence',balance_minutes='$balance_minutes',initial_value='$initial_value',initial_minutes='$initial_minutes',note_purchase_order='$note_purchase_order',note_printer='$note_printer',note_did='$note_did',inbound_group_id='$inbound_group_id',note_language='$note_language',note_name='$note_name',note_comments='$note_comments',create_time='$NOW_TIME',create_user='$USER';"; $stmt="INSERT INTO callcard_accounts_details SET card_id='$Pcard_id',status='GENERATE',run='$run',pack='',batch='$Pbatch',sequence='$Psequence',balance_minutes='$balance_minutes',initial_value='$initial_value',initial_minutes='$initial_minutes',note_purchase_order='$note_purchase_order',note_printer='$note_printer',note_did='$note_did',inbound_group_id='$inbound_group_id',note_language='$note_language',note_name='$note_name',note_comments='$note_comments',create_time='$NOW_TIME',create_user='$USER';";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if (eregi("1$|3$|5$|7$|9$", $i)) if (preg_match("/1$|3$|5$|7$|9$/i", $i))
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
else else
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
@@ -882,7 +883,7 @@ if ($action == "SEARCH_RESULTS")
$Lused_time[$i] = $row[5]; $Lused_time[$i] = $row[5];
$Lvoid_time[$i] = $row[6]; $Lvoid_time[$i] = $row[6];
if (eregi("1$|3$|5$|7$|9$", $i)) if (preg_match("/1$|3$|5$|7$|9$/i", $i))
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
else else
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
@@ -5,11 +5,12 @@
# batch, pack and date range. # batch, pack and date range.
# downloads to a flat text file that is tab delimited # downloads to a flat text file that is tab delimited
# #
# Copyright (C) 2010 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# CHANGES # CHANGES
# #
# 100312-2127 - First build # 100312-2127 - First build
# 130610-1125 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -58,8 +59,8 @@ if ($qm_conf_ct > 0)
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and callcard_admin='1';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and callcard_admin='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -145,7 +146,7 @@ if ($run_export > 0)
{ {
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtA|"; $SQL_log = "$stmt|$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLCARD', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT CALLCARD REPORT', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='CALLCARD', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT CALLCARD REPORT', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -6,6 +6,7 @@
# CHANGES # CHANGES
# 110514-1231 - First build # 110514-1231 - First build
# 130413-2342 - Added report logging # 130413-2342 - Added report logging
# 130610-0949 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -26,8 +27,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1' and modify_campaigns='1';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and view_reports='1' and modify_campaigns='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -1,7 +1,7 @@
<?php <?php
# closer-fronter_popup.php # closer-fronter_popup.php
# #
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# this is the closer popup of a specific call that starts recording the call and allows you to go and fetch info on that caller in the local CRM system. # this is the closer popup of a specific call that starts recording the call and allows you to go and fetch info on that caller in the local CRM system.
# CHANGES # CHANGES
@@ -10,6 +10,7 @@
# 61201-1114 - Added lead_id and user to recording_log entry # 61201-1114 - Added lead_id and user to recording_log entry
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled # 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
# 130610-1115 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -98,8 +99,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
#$DB = '1'; # DEBUG override #$DB = '1'; # DEBUG override
$US = '_'; $US = '_';
@@ -146,7 +147,7 @@ $browser = getenv("HTTP_USER_AGENT");
fwrite ($fp, "VD_CLOSER|GOOD|$date|$user|XXXX|$ip|$browser|$LOGfullname|\n"); fwrite ($fp, "VD_CLOSER|GOOD|$date|$user|XXXX|$ip|$browser|$LOGfullname|\n");
fclose($fp); fclose($fp);
if ( (strlen($customer_zap_channel)>2) and (eregi('zap',$customer_zap_channel)) ) if ( (strlen($customer_zap_channel)>2) and (preg_match('/zap/i',$customer_zap_channel)) )
{ {
echo "\n<!-- zap channel: $customer_zap_channel -->\n"; echo "\n<!-- zap channel: $customer_zap_channel -->\n";
echo "\n<!-- session_id: $session_id -->\n"; echo "\n<!-- session_id: $session_id -->\n";
@@ -172,7 +173,7 @@ echo "<head>\n";
echo "<title>VICIDIAL FRONTER-CLOSER: Popup</title>\n"; echo "<title>VICIDIAL FRONTER-CLOSER: Popup</title>\n";
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
if (eregi('CL_UNIV',$channel_group)) if (preg_match('/CL_UNIV/i',$channel_group))
{ {
?> ?>
<script language="Javascript1.2"> <script language="Javascript1.2">
@@ -234,8 +235,8 @@ if ($parked_count > 0)
### insert a NEW record to the vicidial_manager table to be processed ### insert a NEW record to the vicidial_manager table to be processed
$channel = $customer_zap_channel; $channel = $customer_zap_channel;
$channel = eregi_replace('Zap/', "", $channel); $channel = preg_replace('/Zap\//i', "", $channel);
$SIPexten = eregi_replace('SIP/', "", $SIPexten); $SIPexten = preg_replace('/SIP\//i', "", $SIPexten);
$filename = "$REC_TIME$US$SIPexten"; $filename = "$REC_TIME$US$SIPexten";
# $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Monitor','$DTqueryCID','Channel: Zap/$channel','File: $filename','Callerid: $DTqueryCID','','','','','','','')"; # $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Monitor','$DTqueryCID','Channel: Zap/$channel','File: $filename','Callerid: $DTqueryCID','','','','','','','')";
@@ -284,7 +285,7 @@ if ($parked_count > 0)
########################################################################################### ###########################################################################################
####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX ####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX
########################################################################################### ###########################################################################################
if (eregi('CL_TEST',$channel_group)) if (preg_match('/CL_TEST/i',$channel_group))
{ {
echo "GALLERIA TEST CLOSER GROUP: $channel_group\n"; echo "GALLERIA TEST CLOSER GROUP: $channel_group\n";
@@ -319,7 +320,7 @@ if (eregi('CL_TEST',$channel_group))
<?php <?php
} }
if ( (eregi('CL_MWCOF',$channel_group)) or (eregi('MWCOF',$group)) or (eregi('TESTCAMP',$group))) if ( (preg_match('/CL_MWCOF/i',$channel_group)) or (preg_match('/MWCOF/i',$group)) or (preg_match('/TESTCAMP/i',$group)))
{ {
echo "BUYERS EDGE INTERNAL CLOSER GROUP: $channel_group\n"; echo "BUYERS EDGE INTERNAL CLOSER GROUP: $channel_group\n";
@@ -356,27 +357,27 @@ if ( (eregi('CL_MWCOF',$channel_group)) or (eregi('MWCOF',$group)) or (eregi('TE
if (eregi('CL_GAL',$channel_group)) if (preg_match('/CL_GAL/i',$channel_group))
{ {
echo "GALLERIA CLOSER GROUP: $channel_group\n"; echo "GALLERIA CLOSER GROUP: $channel_group\n";
$group_color='#CCCCCC'; $group_color='#CCCCCC';
if (eregi('CL_GALLERIA',$channel_group)) if (preg_match('/CL_GALLERIA/i',$channel_group))
{ {
echo "<br><font color=green size=3><b>-- INTERNAL CALL GALLERIA FRONT --</b></font><br>\n"; echo "<br><font color=green size=3><b>-- INTERNAL CALL GALLERIA FRONT --</b></font><br>\n";
$group_color='#99FF99'; $group_color='#99FF99';
} }
if (eregi('CL_GALLER2',$channel_group)) if (preg_match('/CL_GALLER2/i',$channel_group))
{ {
echo "<br><font color=red size=3><b>-- TouchAsia CALL Simple Escapes FRONT --</b></font><br>\n"; echo "<br><font color=red size=3><b>-- TouchAsia CALL Simple Escapes FRONT --</b></font><br>\n";
$group_color='#FF9999'; $group_color='#FF9999';
} }
if (eregi('CL_GALLER3',$channel_group)) if (preg_match('/CL_GALLER3/i',$channel_group))
{ {
echo "<br><font color=red size=3><b>-- DebitSupplies CALL Simple Escapes FRONT --</b></font><br>\n"; echo "<br><font color=red size=3><b>-- DebitSupplies CALL Simple Escapes FRONT --</b></font><br>\n";
$group_color='#FF9999'; $group_color='#FF9999';
} }
if (eregi('CL_GALLER4',$channel_group)) if (preg_match('/CL_GALLER4/i',$channel_group))
{ {
echo "<br><font color=red size=3><b>-- Vishnu CALL Simple Escapes FRONT --</b></font><br>\n"; echo "<br><font color=red size=3><b>-- Vishnu CALL Simple Escapes FRONT --</b></font><br>\n";
$group_color='#FF9999'; $group_color='#FF9999';
@@ -428,7 +429,7 @@ if (eregi('CL_GAL',$channel_group))
} }
if (eregi('CL_UNIV',$channel_group)) if (preg_match('/CL_UNIV/i',$channel_group))
{ {
echo "UNIVERSAL CLOSER GROUP: $channel_group\n"; echo "UNIVERSAL CLOSER GROUP: $channel_group\n";
@@ -1,7 +1,7 @@
<?php <?php
# closer-fronter_popup2.php # closer-fronter_popup2.php
# #
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# this is the closer popup of a specific call that starts recording the call and allows you to go and fetch info on that caller in the local CRM system. # this is the closer popup of a specific call that starts recording the call and allows you to go and fetch info on that caller in the local CRM system.
# CHANGES # CHANGES
@@ -10,6 +10,7 @@
# 61201-1114 - Added lead_id and user to recording_log entry # 61201-1114 - Added lead_id and user to recording_log entry
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 120223-2124 - Removed logging of good login passwords if webroot writable is enabled # 120223-2124 - Removed logging of good login passwords if webroot writable is enabled
# 130610-1114 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -98,8 +99,8 @@ if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];} if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];} elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
#$DB = '1'; # DEBUG override #$DB = '1'; # DEBUG override
$US = '_'; $US = '_';
@@ -122,7 +123,7 @@ if (!isset($end_date)) {$end_date = $TODAY;}
if (!$auth) if (!$auth)
{ {
if ( (strlen($PHP_AUTH_USER)>1) and ( (eregi("tsr",$PHP_AUTH_PW)) or (eregi("sales",$PHP_AUTH_PW)) ) ) if ( (strlen($PHP_AUTH_USER)>1) and ( (preg_match('/tsr/i',$PHP_AUTH_PW)) or (preg_match('/sales/i',$PHP_AUTH_PW)) ) )
{ {
$auth=1; $auth=1;
$user = $PHP_AUTH_USER; $user = $PHP_AUTH_USER;
@@ -158,7 +159,7 @@ $browser = getenv("HTTP_USER_AGENT");
fwrite ($fp, "VD_CLOSER|GOOD|$date|$user|XXXX|$ip|$browser|$LOGfullname|\n"); fwrite ($fp, "VD_CLOSER|GOOD|$date|$user|XXXX|$ip|$browser|$LOGfullname|\n");
fclose($fp); fclose($fp);
if ( (strlen($customer_zap_channel)>2) and ( (eregi('zap',$customer_zap_channel)) or (eregi('iax',$customer_zap_channel)) ) ) if ( (strlen($customer_zap_channel)>2) and ( (preg_match('/zap/i',$customer_zap_channel)) or (preg_match('/iax/i',$customer_zap_channel)) ) )
{ {
echo "\n<!-- zap channel: $customer_zap_channel -->\n"; echo "\n<!-- zap channel: $customer_zap_channel -->\n";
echo "<!-- session_id: $session_id -->\n"; echo "<!-- session_id: $session_id -->\n";
@@ -186,7 +187,7 @@ echo "<head>\n";
echo "<title>VICIDIAL FRONTER-CLOSER: Popup</title>\n"; echo "<title>VICIDIAL FRONTER-CLOSER: Popup</title>\n";
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
if (eregi('CL_UNIV',$channel_group)) if (preg_match('/CL_UNIV/i',$channel_group))
{ {
?> ?>
<script language="Javascript1.2"> <script language="Javascript1.2">
@@ -248,8 +249,8 @@ if ($parked_count > 0)
### insert a NEW record to the vicidial_manager table to be processed ### insert a NEW record to the vicidial_manager table to be processed
$channel = $customer_zap_channel; $channel = $customer_zap_channel;
# $channel = eregi_replace('Zap/', "", $channel); # $channel = preg_replace('/Zap\//i', "", $channel);
$SIPexten = eregi_replace('SIP/', "", $SIPexten); $SIPexten = preg_replace('/SIP\//i', "", $SIPexten);
$filename = "$REC_TIME$US$SIPexten"; $filename = "$REC_TIME$US$SIPexten";
# $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Monitor','$DTqueryCID','Channel: Zap/$channel','File: $filename','Callerid: $DTqueryCID','','','','','','','')"; # $stmt="INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$server_ip','','Monitor','$DTqueryCID','Channel: Zap/$channel','File: $filename','Callerid: $DTqueryCID','','','','','','','')";
@@ -301,7 +302,7 @@ if ($parked_count > 0)
####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX ####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX
########################################################################################### ###########################################################################################
if (eregi('CL',$channel_group)) if (preg_match('/CL/i',$channel_group))
{ {
if (strlen($phone) > 9) {$search_phone = $phone;} if (strlen($phone) > 9) {$search_phone = $phone;}
if ( (strlen($search_phone) < 10) or (strlen($fronter) < 1) ) if ( (strlen($search_phone) < 10) or (strlen($fronter) < 1) )
@@ -343,7 +344,7 @@ if (eregi('CL',$channel_group))
if (eregi('UNIV',$channel_group)) if (preg_match('/UNIV/i',$channel_group))
{ {
echo "UNIVERSAL CLOSER GROUP: $channel_group\n"; echo "UNIVERSAL CLOSER GROUP: $channel_group\n";
+6 -5
View File
@@ -1,7 +1,7 @@
<?php <?php
# closer.php # closer.php
# #
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# the purpose of this script and webpage is to allow for remote or local users of the system to log in and grab phone calls that are coming inbound into the Asterisk server and being put in the parked_channels table while they hear a soundfile for a limited amount of time before being forwarded on to either a set extension or a voicemail box. This gives remote or local agents a way to grab calls without tying up their phone lines all day. The agent sees the refreshing screen of calls on park and when they want to take one they just click on it, and a small window opens that will allow them to grab the call and/or look up more information on the caller through the callerID that is given(if available) # the purpose of this script and webpage is to allow for remote or local users of the system to log in and grab phone calls that are coming inbound into the Asterisk server and being put in the parked_channels table while they hear a soundfile for a limited amount of time before being forwarded on to either a set extension or a voicemail box. This gives remote or local agents a way to grab calls without tying up their phone lines all day. The agent sees the refreshing screen of calls on park and when they want to take one they just click on it, and a small window opens that will allow them to grab the call and/or look up more information on the caller through the callerID that is given(if available)
# CHANGES # CHANGES
@@ -10,6 +10,7 @@
# - Added required user/pass to gain access to this page # - Added required user/pass to gain access to this page
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled # 120223-2249 - Removed logging of good login passwords if webroot writable is enabled
# 130610-1116 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -70,8 +71,8 @@ while ($i < $qm_conf_ct)
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$STARTtime = date("U"); $STARTtime = date("U");
$TODAY = date("Y-m-d"); $TODAY = date("Y-m-d");
@@ -306,7 +307,7 @@ $parked_count = $row[0];
$with_color=0; $with_color=0;
while($o < $group_selected) while($o < $group_selected)
{ {
if (eregi("$groupselect[$o]",$channel_group)) if (preg_match("/$groupselect[$o]/i",$channel_group))
{ {
$G="<SPAN class=\"$color_class[$o]\"><B>"; $EG='</B></SPAN>'; $G="<SPAN class=\"$color_class[$o]\"><B>"; $EG='</B></SPAN>';
$with_color++; $with_color++;
@@ -315,7 +316,7 @@ $parked_count = $row[0];
} }
if ($with_color) if ($with_color)
{ {
if (eregi('CL_GAL',$row[2])) if (preg_match('/CL_GAL/i',$row[2]))
{ {
echo "$G<A HREF=\"$popup_page?channel=$row[0]&server_ip=$server_ip&parked_time=$row[5]&dialplan_number=$dialplan_number&extension=$extension&channel_group=$row[2]&DB=$DB&debugvars=asdfuiywer786sdg786sfg7sdsgjhg352j3452hg45f2j3h4g5f2j3h4g5f2jhg4f5j3fg45jh23f5j4h23gf&parked_by=$row[4]&debugvars=asdfuiywer786sdg786sfg7sdsgjhg352j3452hg45f2j3h4g5f2j3h4g5f2jhg4f5j3fg45jh23f5j4h23gf\" target=\"_blank\">$channel</A>$server$channel_group$park_extension $parked_time $EG\n"; echo "$G<A HREF=\"$popup_page?channel=$row[0]&server_ip=$server_ip&parked_time=$row[5]&dialplan_number=$dialplan_number&extension=$extension&channel_group=$row[2]&DB=$DB&debugvars=asdfuiywer786sdg786sfg7sdsgjhg352j3452hg45f2j3h4g5f2j3h4g5f2jhg4f5j3fg45jh23f5j4h23gf&parked_by=$row[4]&debugvars=asdfuiywer786sdg786sfg7sdsgjhg352j3452hg45f2j3h4g5f2j3h4g5f2jhg4f5j3fg45jh23f5j4h23gf\" target=\"_blank\">$channel</A>$server$channel_group$park_extension $parked_time $EG\n";
} }
+4 -3
View File
@@ -1,7 +1,7 @@
<?php <?php
# closer_dispo.php # closer_dispo.php
# #
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# this is the closer disposition screen of a call that has been grabbed. This # this is the closer disposition screen of a call that has been grabbed. This
# allows the closer to modify customer information and disposition the call # allows the closer to modify customer information and disposition the call
@@ -11,6 +11,7 @@
# 60619-1641 - Added variable filtering to eliminate SQL injection attack threat # 60619-1641 - Added variable filtering to eliminate SQL injection attack threat
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 120223-2249 - Removed logging of good login passwords if webroot writable is enabled # 120223-2249 - Removed logging of good login passwords if webroot writable is enabled
# 130610-1114 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -105,8 +106,8 @@ while ($i < $qm_conf_ct)
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$STARTtime = date("U"); $STARTtime = date("U");
+15 -14
View File
@@ -1,7 +1,7 @@
<?php <?php
# closer_popup.php # closer_popup.php
# #
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# this is the closer popup of a specific call that grabs the call and allows you # this is the closer popup of a specific call that grabs the call and allows you
# to go and fetch info on that caller in the local CRM system. # to go and fetch info on that caller in the local CRM system.
@@ -11,6 +11,7 @@
# 60620-1029 - Added variable filtering to eliminate SQL injection attack threat # 60620-1029 - Added variable filtering to eliminate SQL injection attack threat
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
# 130610-1113 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -72,8 +73,8 @@ while ($i < $qm_conf_ct)
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
#$DB=1; #$DB=1;
@@ -137,7 +138,7 @@ echo "<head>\n";
echo "<title>VICIDIAL CLOSER: Popup</title>\n"; echo "<title>VICIDIAL CLOSER: Popup</title>\n";
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n"; echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
if (eregi('CL_UNIV',$channel_group)) if (preg_match('/CL_UNIV/i',$channel_group))
{ {
?> ?>
<script language="Javascript1.2"> <script language="Javascript1.2">
@@ -194,8 +195,8 @@ if ($parked_count > 0)
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
#$monitor_channel = eregi_replace('Zap/', "", $channel); #$monitor_channel = preg_replace('/Zap\//i', "", $channel);
$monitor_channel = eregi_replace('-1', "", $channel); $monitor_channel = preg_replace('/\-1/i', "", $channel);
$SIPexten = $extension; $SIPexten = $extension;
$filename = "$REC_TIME$US$SIPexten"; $filename = "$REC_TIME$US$SIPexten";
$DTqueryCID = "RR$FILE_datetime$PHP_AUTH_USER"; $DTqueryCID = "RR$FILE_datetime$PHP_AUTH_USER";
@@ -249,7 +250,7 @@ if ($parked_count > 0)
########################################################################################### ###########################################################################################
####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX ####### HERE IS WHERE YOU DEFINE DIFFERENT CONTENTS DEPENDING UPON THE CHANNEL_GROUP PREFIX
########################################################################################### ###########################################################################################
if (eregi('CL_TEST',$channel_group)) if (preg_match('/CL_TEST/i',$channel_group))
{ {
echo "GALLERIA TEST CLOSER GROUP: $channel_group\n"; echo "GALLERIA TEST CLOSER GROUP: $channel_group\n";
@@ -284,7 +285,7 @@ if (eregi('CL_TEST',$channel_group))
<?php <?php
} }
if (eregi('CL_MWCOF',$channel_group)) if (preg_match('/CL_MWCOF/i',$channel_group))
{ {
echo "GALLERIA INTERNAL CLOSER GROUP: $channel_group\n"; echo "GALLERIA INTERNAL CLOSER GROUP: $channel_group\n";
@@ -321,27 +322,27 @@ if (eregi('CL_MWCOF',$channel_group))
if (eregi('CL_GAL',$channel_group)) if (preg_match('/CL_GAL/i',$channel_group))
{ {
echo "GALLERIA CLOSER GROUP: $channel_group\n"; echo "GALLERIA CLOSER GROUP: $channel_group\n";
$group_color='#CCCCCC'; $group_color='#CCCCCC';
if (eregi('CL_GALLERIA',$channel_group)) if (preg_match('/CL_GALLERIA/i',$channel_group))
{ {
echo "<br><font color=green size=3><b>-- INTERNAL CALL GALLERIA FRONT --</b></font><br>\n"; echo "<br><font color=green size=3><b>-- INTERNAL CALL GALLERIA FRONT --</b></font><br>\n";
$group_color='#99FF99'; $group_color='#99FF99';
} }
if (eregi('CL_GALLER2',$channel_group)) if (preg_match('/CL_GALLER2/i',$channel_group))
{ {
echo "<br><font color=red size=3><b>-- TouchAsia CALL Simple Escapes FRONT --</b></font><br>\n"; echo "<br><font color=red size=3><b>-- TouchAsia CALL Simple Escapes FRONT --</b></font><br>\n";
$group_color='#FF9999'; $group_color='#FF9999';
} }
if (eregi('CL_GALLER3',$channel_group)) if (preg_match('/CL_GALLER3/i',$channel_group))
{ {
echo "<br><font color=red size=3><b>-- DebitSupplies CALL Simple Escapes FRONT --</b></font><br>\n"; echo "<br><font color=red size=3><b>-- DebitSupplies CALL Simple Escapes FRONT --</b></font><br>\n";
$group_color='#FF9999'; $group_color='#FF9999';
} }
if (eregi('CL_GALLER4',$channel_group)) if (preg_match('/CL_GALLER4/i',$channel_group))
{ {
echo "<br><font color=red size=3><b>-- Vishnu CALL Simple Escapes FRONT --</b></font><br>\n"; echo "<br><font color=red size=3><b>-- Vishnu CALL Simple Escapes FRONT --</b></font><br>\n";
$group_color='#FF9999'; $group_color='#FF9999';
@@ -393,7 +394,7 @@ if (eregi('CL_GAL',$channel_group))
} }
if (eregi('CL_UNIV',$channel_group)) if (preg_match('/CL_UNIV/i',$channel_group))
{ {
echo "UNIVERSAL CLOSER GROUP: $channel_group\n"; echo "UNIVERSAL CLOSER GROUP: $channel_group\n";
+12 -11
View File
@@ -1,6 +1,6 @@
<?php <?php
# #
# dbconnect.php version 2.4 # dbconnect.php version 2.8
# #
# database connection settings and some global web settings # database connection settings and some global web settings
# #
@@ -8,6 +8,7 @@
# #
# CHANGES # CHANGES
# 100712-1430 - Added slave server option for connection # 100712-1430 - Added slave server option for connection
# 130610-1112 - Finalized changing of all ereg instances to preg
# #
if ( file_exists("/etc/astguiclient.conf") ) if ( file_exists("/etc/astguiclient.conf") )
@@ -16,25 +17,25 @@ if ( file_exists("/etc/astguiclient.conf") )
foreach ($DBCagc as $DBCline) foreach ($DBCagc as $DBCline)
{ {
$DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline); $DBCline = preg_replace("/ |>|\n|\r|\t|\#.*|;.*/","",$DBCline);
if (ereg("^PATHlogs", $DBCline)) if (preg_match('/^PATHlogs/', $DBCline))
{$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);} {$PATHlogs = $DBCline; $PATHlogs = preg_replace("/.*=/","",$PATHlogs);}
if (ereg("^PATHweb", $DBCline)) if (preg_match('/^PATHweb/', $DBCline))
{$WeBServeRRooT = $DBCline; $WeBServeRRooT = preg_replace("/.*=/","",$WeBServeRRooT);} {$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);} {$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);} {$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);} {$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);} {$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);} {$VARDB_pass = $DBCline; $VARDB_pass = preg_replace("/.*=/","",$VARDB_pass);}
if (ereg("^VARDB_custom_user", $DBCline)) if (preg_match('/^VARDB_custom_user/', $DBCline))
{$VARDB_custom_user = $DBCline; $VARDB_custom_user = preg_replace("/.*=/","",$VARDB_custom_user);} {$VARDB_custom_user = $DBCline; $VARDB_custom_user = preg_replace("/.*=/","",$VARDB_custom_user);}
if (ereg("^VARDB_custom_pass", $DBCline)) if (preg_match('/^VARDB_custom_pass/', $DBCline))
{$VARDB_custom_pass = $DBCline; $VARDB_custom_pass = preg_replace("/.*=/","",$VARDB_custom_pass);} {$VARDB_custom_pass = $DBCline; $VARDB_custom_pass = preg_replace("/.*=/","",$VARDB_custom_pass);}
if (ereg("^VARDB_port", $DBCline)) if (preg_match('/^VARDB_port/', $DBCline))
{$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);} {$VARDB_port = $DBCline; $VARDB_port = preg_replace("/.*=/","",$VARDB_port);}
} }
} }
+5 -4
View File
@@ -22,6 +22,7 @@
# 120224-0910 - Added HTML display option with bar graphs # 120224-0910 - Added HTML display option with bar graphs
# 120705-2007 - Changed SALES to use sales status flag # 120705-2007 - Changed SALES to use sales status flag
# 130414-0126 - Added report logging # 130414-0126 - Added report logging
# 130610-0948 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -48,8 +49,8 @@ if (isset($_GET["file_download"])) {$file_download=$_GET["file_download"];}
if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];} if (isset($_GET["report_display_type"])) {$report_display_type=$_GET["report_display_type"];}
elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];} elseif (isset($_POST["report_display_type"])) {$report_display_type=$_POST["report_display_type"];}
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
if (strlen($shift)<2) {$shift='ALL';} if (strlen($shift)<2) {$shift='ALL';}
@@ -150,7 +151,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -160,7 +161,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -12,6 +12,7 @@
# 120221-0159 - Added User Group restrictions # 120221-0159 - Added User Group restrictions
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
# 130414-0224 - Added report logging # 130414-0224 - Added report logging
# 130610-0946 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -53,8 +54,8 @@ while ($i < $qm_conf_ct)
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -98,7 +99,7 @@ $date_no_hour_default = $TODAY;
if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;} if (!isset($date_with_hour)) {$date_with_hour = $date_with_hour_default;}
$date_no_hour = $date_with_hour; $date_no_hour = $date_with_hour;
$date_no_hour = eregi_replace(" ([0-9]{2})",'',$date_no_hour); $date_no_hour = preg_replace('/\s([0-9]{2})/i',$date_no_hour);
if (!isset($begin_date)) {$begin_date = $TODAY;} if (!isset($begin_date)) {$begin_date = $TODAY;}
if (!isset($end_date)) {$end_date = $TODAY;} if (!isset($end_date)) {$end_date = $TODAY;}
@@ -167,7 +168,7 @@ $LOGadmin_viewable_call_times = $row[3];
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -268,7 +269,7 @@ echo "<tr><td><font size=2>TSR </td><td align=left><font size=2>ID </td><td alig
$o=0; $o=0;
while($o < $tsrs_to_print) while($o < $tsrs_to_print)
{ {
if (eregi("1$|3$|5$|7$|9$", $o)) if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -28,6 +28,10 @@ th.thgraph {
.grey_graph_cell { .grey_graph_cell {
background-color:#ddd; background-color:#ddd;
} }
.white_graph_cell {
background-color:#FFF;
}
.graph_span_cell { .graph_span_cell {
background-color:#eee; background-color:#eee;
text-align: center; text-align: center;
@@ -57,6 +61,13 @@ td.first {
font-size: 0; font-size: 0;
left: -1000px; left: -1000px;
} }
.wordwrap {
white-space: pre-wrap; /* CSS3 */
white-space: -moz-pre-wrap; /* Firefox */
white-space: -pre-wrap; /* Opera <7 */
white-space: -o-pre-wrap; /* Opera 7 */
word-wrap: break-word; /* IE */
}
table.horizontalgraph { table.horizontalgraph {
font-family: Verdana, Arial, Helvetica, sans-serif; font-family: Verdana, Arial, Helvetica, sans-serif;
background-image:url(images/bg_fade2.png); background-image:url(images/bg_fade2.png);
@@ -12,6 +12,7 @@
# 110624-0834 - First build, based upon calls_report_export.php # 110624-0834 - First build, based upon calls_report_export.php
# 111104-1245 - Added user_group restrictions for selecting in-groups # 111104-1245 - Added user_group restrictions for selecting in-groups
# 130414-0135 - Added report logging # 130414-0135 - Added report logging
# 130610-0945 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -78,8 +79,8 @@ if ($qm_conf_ct > 0)
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and export_reports='1' and active='Y';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -157,7 +158,7 @@ if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -168,7 +169,7 @@ $regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -178,7 +179,7 @@ if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewabl
$LOGadmin_viewable_call_timesSQL=''; $LOGadmin_viewable_call_timesSQL='';
$whereLOGadmin_viewable_call_timesSQL=''; $whereLOGadmin_viewable_call_timesSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i', $LOGadmin_viewable_call_times)) and (strlen($LOGadmin_viewable_call_times) > 3) )
{ {
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ -/",'',$LOGadmin_viewable_call_times);
$rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL); $rawLOGadmin_viewable_call_timesSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_call_timesSQL);
@@ -221,14 +222,14 @@ if ($run_export > 0)
} }
$i++; $i++;
} }
if ( (ereg("--NONE--",$campaign_string) ) or ($campaign_ct < 1) ) if ( (preg_match('/\s\-\-NONE\-\-\s/',$campaign_string) ) or ($campaign_ct < 1) )
{ {
$campaign_SQL = "campaign_id IN('')"; $campaign_SQL = "campaign_id IN('')";
$RUNcampaign=0; $RUNcampaign=0;
} }
else else
{ {
$campaign_SQL = eregi_replace(",$",'',$campaign_SQL); $campaign_SQL = preg_replace('/,$/i', '',$campaign_SQL);
$campaign_SQL = "and vl.campaign_id IN($campaign_SQL)"; $campaign_SQL = "and vl.campaign_id IN($campaign_SQL)";
$RUNcampaign++; $RUNcampaign++;
} }
@@ -240,7 +241,7 @@ if ($run_export > 0)
$group_SQL .= "'$group[$i]',"; $group_SQL .= "'$group[$i]',";
$i++; $i++;
} }
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\s\-\-NONE\-\-\s/',$group_string) ) or ($group_ct < 1) )
{ {
$group_SQL = "''"; $group_SQL = "''";
$group_SQL = "campaign_id IN('')"; $group_SQL = "campaign_id IN('')";
@@ -248,7 +249,7 @@ if ($run_export > 0)
} }
else else
{ {
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
$group_SQL = "and vl.campaign_id IN($group_SQL)"; $group_SQL = "and vl.campaign_id IN($group_SQL)";
$RUNgroup++; $RUNgroup++;
} }
@@ -260,13 +261,13 @@ if ($run_export > 0)
$user_group_SQL .= "'$user_group[$i]',"; $user_group_SQL .= "'$user_group[$i]',";
$i++; $i++;
} }
if ( (ereg("--ALL--",$user_group_string) ) or ($user_group_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$user_group_string) ) or ($user_group_ct < 1) )
{ {
$user_group_SQL = ""; $user_group_SQL = "";
} }
else else
{ {
$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = preg_replace('/,$/i', '',$user_group_SQL);
$user_group_SQL = "and vl.user_group IN($user_group_SQL)"; $user_group_SQL = "and vl.user_group IN($user_group_SQL)";
} }
@@ -277,13 +278,13 @@ if ($run_export > 0)
$list_SQL .= "'$list_id[$i]',"; $list_SQL .= "'$list_id[$i]',";
$i++; $i++;
} }
if ( (ereg("--ALL--",$list_string) ) or ($list_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$list_string) ) or ($list_ct < 1) )
{ {
$list_SQL = ""; $list_SQL = "";
} }
else else
{ {
$list_SQL = eregi_replace(",$",'',$list_SQL); $list_SQL = preg_replace('/,$/i', '',$list_SQL);
$list_SQL = "and vi.list_id IN($list_SQL)"; $list_SQL = "and vi.list_id IN($list_SQL)";
} }
@@ -294,13 +295,13 @@ if ($run_export > 0)
$status_SQL .= "'$status[$i]',"; $status_SQL .= "'$status[$i]',";
$i++; $i++;
} }
if ( (ereg("--ALL--",$status_string) ) or ($status_ct < 1) ) if ( (preg_match('/\-\-ALL\-\-/',$status_string) ) or ($status_ct < 1) )
{ {
$status_SQL = ""; $status_SQL = "";
} }
else else
{ {
$status_SQL = eregi_replace(",$",'',$status_SQL); $status_SQL = preg_replace('/,$/i', '',$status_SQL);
$status_SQL = "and vi.status IN($status_SQL)"; $status_SQL = "and vi.status IN($status_SQL)";
} }
@@ -887,7 +888,7 @@ else
$o=0; $o=0;
while ($campaigns_to_print > $o) while ($campaigns_to_print > $o)
{ {
if (ereg("\|$LISTcampaigns[$o]\|",$campaign_string)) if (preg_match("/\|$LISTcampaigns[$o]\|/",$campaign_string))
{echo "<option selected value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} {echo "<option selected value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";}
else else
{echo "<option value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";} {echo "<option value=\"$LISTcampaigns[$o]\">$LISTcampaigns[$o]</option>\n";}
@@ -901,7 +902,7 @@ else
$o=0; $o=0;
while ($groups_to_print > $o) while ($groups_to_print > $o)
{ {
if (ereg("\|$LISTgroups[$o]\|",$group_string)) if (preg_match("/\|$LISTgroups[$o]\|/",$group_string))
{echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} {echo "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";}
else else
{echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";} {echo "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o]</option>\n";}
@@ -914,7 +915,7 @@ else
$o=0; $o=0;
while ($lists_to_print > $o) while ($lists_to_print > $o)
{ {
if (ereg("\|$LISTlists[$o]\|",$list_string)) if (preg_match("/\|$LISTlists[$o]\|/",$list_string))
{echo "<option selected value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} {echo "<option selected value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";}
else else
{echo "<option value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";} {echo "<option value=\"$LISTlists[$o]\">$LISTlists[$o]</option>\n";}
@@ -927,7 +928,7 @@ else
$o=0; $o=0;
while ($statuses_to_print > $o) while ($statuses_to_print > $o)
{ {
if (ereg("\|$LISTstatus[$o]\|",$list_string)) if (preg_match("/\|$LISTstatus[$o]\|/",$list_string))
{echo "<option selected value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} {echo "<option selected value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";}
else else
{echo "<option value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";} {echo "<option value=\"$LISTstatus[$o]\">$LISTstatus[$o]</option>\n";}
@@ -940,7 +941,7 @@ else
$o=0; $o=0;
while ($user_groups_to_print > $o) while ($user_groups_to_print > $o)
{ {
if (ereg("\|$LISTuser_groups[$o]\|",$user_group_string)) if (preg_match("/\|$LISTuser_groups[$o]\|/",$user_group_string))
{echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} {echo "<option selected value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";}
else else
{echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";} {echo "<option value=\"$LISTuser_groups[$o]\">$LISTuser_groups[$o]</option>\n";}
@@ -980,7 +981,7 @@ if ($file_exported > 0)
{ {
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtA|"; $SQL_log = "$stmt|$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT LEADS REPORT', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='', event_code='ADMIN EXPORT LEADS REPORT', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
+48 -47
View File
@@ -7,10 +7,11 @@
# 121110-1446 - Initial Build # 121110-1446 - Initial Build
# 121114-0956 - Added input filtering and vicidial_admin_log logging # 121114-0956 - Added input filtering and vicidial_admin_log logging
# 130124-1129 - Added new options, from issue #632<noah> # 130124-1129 - Added new options, from issue #632<noah>
# 130610-1045 - Finalized changing of all ereg instances to preg
# #
$version = '2.6-3a'; $version = '2.8-4';
$build = '130124-1129'; $build = '130610-1045';
# This limit is to prevent data inconsistancies. # This limit is to prevent data inconsistancies.
# If there are too many leads in a list this # If there are too many leads in a list this
@@ -51,14 +52,14 @@ if (isset($_GET["confirm_update"])) {$confirm_move=$_GET["confirm_update"];}
if (isset($_GET["confirm_delete"])) {$confirm_delete=$_GET["confirm_delete"];} if (isset($_GET["confirm_delete"])) {$confirm_delete=$_GET["confirm_delete"];}
elseif (isset($_POST["confirm_delete"])) {$confirm_delete=$_POST["confirm_delete"];} elseif (isset($_POST["confirm_delete"])) {$confirm_delete=$_POST["confirm_delete"];}
$DB = ereg_replace("[^0-9]","",$DB); $DB = preg_replace('/[^0-9]/','',$DB);
$move_submit = ereg_replace("[^-_0-9a-zA-Z]","",$move_submit); $move_submit = preg_replace('/[^-_0-9a-zA-Z]/','',$move_submit);
$update_submit = ereg_replace("[^-_0-9a-zA-Z]","",$update_submit); $update_submit = preg_replace('/[^-_0-9a-zA-Z]/','',$update_submit);
$delete_submit = ereg_replace("[^-_0-9a-zA-Z]","",$delete_submit); $delete_submit = preg_replace('/[^-_0-9a-zA-Z]/','',$delete_submit);
$confirm_move = ereg_replace("[^-_0-9a-zA-Z]","",$confirm_move); $confirm_move = preg_replace('/[^-_0-9a-zA-Z]/','',$confirm_move);
$confirm_update = ereg_replace("[^-_0-9a-zA-Z]","",$confirm_update); $confirm_update = preg_replace('/[^-_0-9a-zA-Z]/','',$confirm_update);
$confirm_delete = ereg_replace("[^-_0-9a-zA-Z]","",$confirm_delete); $confirm_delete = preg_replace('/[^-_0-9a-zA-Z]/','',$confirm_delete);
$delete_status = ereg_replace("[^-_0-9a-zA-Z]","",$delete_status); $delete_status = preg_replace('/[^-_0-9a-zA-Z]/','',$delete_status);
############################################# #############################################
@@ -84,14 +85,14 @@ else
if ($non_latin < 1) if ($non_latin < 1)
{ {
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$list_id_override = ereg_replace("[^0-9]","",$list_id_override); $list_id_override = preg_replace('/[^0-9]/','',$list_id_override);
} }
else else
{ {
$PHP_AUTH_PW = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_PW);
$PHP_AUTH_USER = ereg_replace("'|\"|\\\\|;","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace("/'|\"|\\\\|;/","",$PHP_AUTH_USER);
} }
$valid_user_stmt = "SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;"; $valid_user_stmt = "SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7;";
@@ -210,11 +211,11 @@ if ($move_submit == "move" )
if (isset($_GET["move_count_num"])) {$move_count_num=$_GET["move_count_num"];} if (isset($_GET["move_count_num"])) {$move_count_num=$_GET["move_count_num"];}
elseif (isset($_POST["move_count_num"])) {$move_count_num=$_POST["move_count_num"];} elseif (isset($_POST["move_count_num"])) {$move_count_num=$_POST["move_count_num"];}
#$move_status = ereg_replace("[^-_0-9a-zA-Z]","",$move_status); #$move_status = preg_replace('/[^-_0-9a-zA-Z]/','',$move_status);
$move_from_list = ereg_replace("[^0-9]","",$move_from_list); $move_from_list = preg_replace('/[^0-9]/','',$move_from_list);
$move_to_list = ereg_replace("[^0-9]","",$move_to_list); $move_to_list = preg_replace('/[^0-9]/','',$move_to_list);
$move_count_num = ereg_replace("[^0-9]","",$move_count_num); $move_count_num = preg_replace('/[^0-9]/','',$move_count_num);
$move_count_op = ereg_replace("[^<>=]","",$move_count_op); $move_count_op = preg_replace('/[^<>=]/','',$move_count_op);
$move_count_op_phrase=""; $move_count_op_phrase="";
@@ -300,11 +301,11 @@ if ($confirm_move == "confirm")
if (isset($_GET["move_count_num"])) {$move_count_num=$_GET["move_count_num"];} if (isset($_GET["move_count_num"])) {$move_count_num=$_GET["move_count_num"];}
elseif (isset($_POST["move_count_num"])) {$move_count_num=$_POST["move_count_num"];} elseif (isset($_POST["move_count_num"])) {$move_count_num=$_POST["move_count_num"];}
#$move_status = ereg_replace("[^-_0-9a-zA-Z]","",$move_status); #$move_status = preg_replace('/[^-_0-9a-zA-Z]/','',$move_status);
$move_from_list = ereg_replace("[^0-9]","",$move_from_list); $move_from_list = preg_replace('/[^0-9]/','',$move_from_list);
$move_to_list = ereg_replace("[^0-9]","",$move_to_list); $move_to_list = preg_replace('/[^0-9]/','',$move_to_list);
$move_count_num = ereg_replace("[^0-9]","",$move_count_num); $move_count_num = preg_replace('/[^0-9]/','',$move_count_num);
$move_count_op = ereg_replace("[^<>=]","",$move_count_op); $move_count_op = preg_replace('/[^<>=]/','',$move_count_op);
$move_count_op_phrase=""; $move_count_op_phrase="";
if ( $move_count_op == "<" ) if ( $move_count_op == "<" )
@@ -332,7 +333,7 @@ if ($confirm_move == "confirm")
$move_sentence = "$move_lead_count leads have been moved from list $move_from_list to $move_to_list with the status $move_status and that were called $move_count_op_phrase$move_count_num times."; $move_sentence = "$move_lead_count leads have been moved from list $move_from_list to $move_to_list with the status $move_status and that were called $move_count_op_phrase$move_count_num times.";
$SQL_log = "$move_lead_stmt|"; $SQL_log = "$move_lead_stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$admin_log_stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='OTHER', record_id='$move_from_list', event_code='ADMIN MOVE LEADS', event_sql=\"$SQL_log\", event_notes='$move_sentence';"; $admin_log_stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='OTHER', record_id='$move_from_list', event_code='ADMIN MOVE LEADS', event_sql=\"$SQL_log\", event_notes='$move_sentence';";
if ($DB) {echo "|$admin_log_stmt|\n";} if ($DB) {echo "|$admin_log_stmt|\n";}
@@ -365,11 +366,11 @@ if ($update_submit == "update" )
if (isset($_GET["update_count_num"])) {$update_count_num=$_GET["update_count_num"];} if (isset($_GET["update_count_num"])) {$update_count_num=$_GET["update_count_num"];}
elseif (isset($_POST["update_count_num"])) {$update_count_num=$_POST["update_count_num"];} elseif (isset($_POST["update_count_num"])) {$update_count_num=$_POST["update_count_num"];}
$update_from_status = ereg_replace("[^-_0-9a-zA-Z]","",$update_from_status); $update_from_status = preg_replace('/[^-_0-9a-zA-Z]/','',$update_from_status);
$update_to_status = ereg_replace("[^-_0-9a-zA-Z]","",$update_to_status); $update_to_status = preg_replace('/[^-_0-9a-zA-Z]/','',$update_to_status);
$update_list = ereg_replace("[^0-9]","",$update_list); $update_list = preg_replace('/[^0-9]/','',$update_list);
$update_count_num = ereg_replace("[^0-9]","",$update_count_num); $update_count_num = preg_replace('/[^0-9]/','',$update_count_num);
$update_count_op = ereg_replace("[^<>=]","",$update_count_op); $update_count_op = preg_replace('/[^<>=]/','',$update_count_op);
$update_count_op_phrase=""; $update_count_op_phrase="";
if ( $update_count_op == "<" ) if ( $update_count_op == "<" )
@@ -432,11 +433,11 @@ if ($confirm_update == "confirm")
if (isset($_GET["update_count_num"])) {$update_count_num=$_GET["update_count_num"];} if (isset($_GET["update_count_num"])) {$update_count_num=$_GET["update_count_num"];}
elseif (isset($_POST["update_count_num"])) {$update_count_num=$_POST["update_count_num"];} elseif (isset($_POST["update_count_num"])) {$update_count_num=$_POST["update_count_num"];}
$update_from_status = ereg_replace("[^-_0-9a-zA-Z]","",$update_from_status); $update_from_status = preg_replace('/[^-_0-9a-zA-Z]/','',$update_from_status);
$update_to_status = ereg_replace("[^-_0-9a-zA-Z]","",$update_to_status); $update_to_status = preg_replace('/[^-_0-9a-zA-Z]/','',$update_to_status);
$update_list = ereg_replace("[^0-9]","",$update_list); $update_list = preg_replace('/[^0-9]/','',$update_list);
$update_count_num = ereg_replace("[^0-9]","",$update_count_num); $update_count_num = preg_replace('/[^0-9]/','',$update_count_num);
$update_count_op = ereg_replace("[^<>=]","",$update_count_op); $update_count_op = preg_replace('/[^<>=]/','',$update_count_op);
$update_count_op_phrase=""; $update_count_op_phrase="";
if ( $update_count_op == "<" ) if ( $update_count_op == "<" )
@@ -464,7 +465,7 @@ if ($confirm_update == "confirm")
$update_sentence = "$update_lead_count leads had their status changed from $update_from_status to $update_to_status in list $update_list that were called $update_count_op_phrase$update_count_num times."; $update_sentence = "$update_lead_count leads had their status changed from $update_from_status to $update_to_status in list $update_list that were called $update_count_op_phrase$update_count_num times.";
$SQL_log = "$update_lead_stmt|"; $SQL_log = "$update_lead_stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$admin_log_stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='MODIFY', record_id='$update_list', event_code='ADMIN UPDATE LEADS', event_sql=\"$SQL_log\", event_notes='$update_sentence';"; $admin_log_stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='MODIFY', record_id='$update_list', event_code='ADMIN UPDATE LEADS', event_sql=\"$SQL_log\", event_notes='$update_sentence';";
if ($DB) {echo "|$admin_log_stmt|\n";} if ($DB) {echo "|$admin_log_stmt|\n";}
@@ -493,10 +494,10 @@ if ( ( $delete_submit == "delete" ) && ( $delete_lists > 0 ) )
if (isset($_GET["delete_count_num"])) {$delete_count_num=$_GET["delete_count_num"];} if (isset($_GET["delete_count_num"])) {$delete_count_num=$_GET["delete_count_num"];}
elseif (isset($_POST["delete_count_num"])) {$delete_count_num=$_POST["delete_count_num"];} elseif (isset($_POST["delete_count_num"])) {$delete_count_num=$_POST["delete_count_num"];}
$delete_status = ereg_replace("[^-_0-9a-zA-Z]","",$delete_status); $delete_status = preg_replace('/[^-_0-9a-zA-Z]/','',$delete_status);
$delete_list = ereg_replace("[^0-9]","",$delete_list); $delete_list = preg_replace('/[^0-9]/','',$delete_list);
$delete_count_num = ereg_replace("[^0-9]","",$delete_count_num); $delete_count_num = preg_replace('/[^0-9]/','',$delete_count_num);
$delete_count_op = ereg_replace("[^<>=]","",$delete_count_op); $delete_count_op = preg_replace('/[^<>=]/','',$delete_count_op);
$delete_count_op_phrase=""; $delete_count_op_phrase="";
if ( $delete_count_op == "<" ) if ( $delete_count_op == "<" )
@@ -555,10 +556,10 @@ if ( ( $confirm_delete == "confirm" ) && ( $delete_lists > 0 ) )
if (isset($_GET["delete_count_num"])) {$delete_count_num=$_GET["delete_count_num"];} if (isset($_GET["delete_count_num"])) {$delete_count_num=$_GET["delete_count_num"];}
elseif (isset($_POST["delete_count_num"])) {$delete_count_num=$_POST["delete_count_num"];} elseif (isset($_POST["delete_count_num"])) {$delete_count_num=$_POST["delete_count_num"];}
$delete_status = ereg_replace("[^-_0-9a-zA-Z]","",$delete_status); $delete_status = preg_replace('/[^-_0-9a-zA-Z]/','',$delete_status);
$delete_list = ereg_replace("[^0-9]","",$delete_list); $delete_list = preg_replace('/[^0-9]/','',$delete_list);
$delete_count_num = ereg_replace("[^0-9]","",$delete_count_num); $delete_count_num = preg_replace('/[^0-9]/','',$delete_count_num);
$delete_count_op = ereg_replace("[^<>=]","",$delete_count_op); $delete_count_op = preg_replace('/[^<>=]/','',$delete_count_op);
$delete_count_op_phrase=""; $delete_count_op_phrase="";
if ( $delete_count_op == "<" ) if ( $delete_count_op == "<" )
@@ -586,7 +587,7 @@ if ( ( $confirm_delete == "confirm" ) && ( $delete_lists > 0 ) )
$delete_sentence = "$delete_lead_count leads delete from list $delete_list with the status $delete_status that were called $delete_count_op_phrase$delete_count_num times."; $delete_sentence = "$delete_lead_count leads delete from list $delete_list with the status $delete_status that were called $delete_count_op_phrase$delete_count_num times.";
$SQL_log = "$update_lead_stmt|"; $SQL_log = "$update_lead_stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$admin_log_stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$delete_list', event_code='ADMIN DELETE LEADS', event_sql=\"$SQL_log\", event_notes='$delete_sentence';"; $admin_log_stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$delete_list', event_code='ADMIN DELETE LEADS', event_sql=\"$SQL_log\", event_notes='$delete_sentence';";
if ($DB) {echo "|$admin_log_stmt|\n";} if ($DB) {echo "|$admin_log_stmt|\n";}
@@ -610,7 +611,7 @@ if (
$allowed_campaigns = $allowed_campaigns_row[0]; $allowed_campaigns = $allowed_campaigns_row[0];
if ($DB) { echo "|$allowed_campaigns|\n"; } if ($DB) { echo "|$allowed_campaigns|\n"; }
$allowed_campaigns_sql = ""; $allowed_campaigns_sql = "";
if ( eregi("ALL-CAMPAIGNS",$allowed_campaigns) ) if ( preg_match("/ALL\-CAMPAIGNS/i",$allowed_campaigns) )
{ {
if ($DB) { echo "|Processing All Campaigns|\n"; } if ($DB) { echo "|Processing All Campaigns|\n"; }
$campaign_id_stmt = "SELECT campaign_id FROM vicidial_campaigns"; $campaign_id_stmt = "SELECT campaign_id FROM vicidial_campaigns";
@@ -1,12 +1,13 @@
<?php <?php
# leadloader_template_display.php - version 2.4 # leadloader_template_display.php - version 2.8
# #
# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
# #
# CHANGES # CHANGES
# 120402-2238 - First Build # 120402-2238 - First Build
# 120525-1039 - Added uploaded filename filtering # 120525-1039 - Added uploaded filename filtering
# 120529-1345 - Filename filter fix # 120529-1345 - Filename filter fix
# 130610-1101 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -47,6 +48,9 @@ if (isset($_GET["buffer"])) {$buffer=$_GET["buffer"];}
### REGEX to prevent weird characters from ending up in the fields ### REGEX to prevent weird characters from ending up in the fields
$field_regx = "['\"`\\;]"; $field_regx = "['\"`\\;]";
# echo "-$LF_orig- --$sample_template_file_name--<BR>";
$sample_template_file_name=preg_replace("/^C:\\\\fakepath\\\\/i", '', $sample_template_file_name); # IE and Chrome patch
if ( (preg_match("/;|:|\/|\^|\[|\]|\"|\'|\*/",$LF_orig)) or (preg_match("/;|:|\/|\^|\[|\]|\"|\'|\*/",$sample_template_file_name)) ) if ( (preg_match("/;|:|\/|\^|\[|\]|\"|\'|\*/",$LF_orig)) or (preg_match("/;|:|\/|\^|\[|\]|\"|\'|\*/",$sample_template_file_name)) )
{ {
echo "ERROR: Invalid File Name: $LF_orig $sample_template_file_name\n"; echo "ERROR: Invalid File Name: $LF_orig $sample_template_file_name\n";
@@ -58,7 +62,7 @@ if ($form_action=="prime_file" && $sample_template_file_name)
$delim_set=0; $delim_set=0;
if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $sample_template_file_name)) if (preg_match("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", $sample_template_file_name))
{ {
$sample_template_file_name = ereg_replace("[^-\.\_0-9a-zA-Z]","_",$sample_template_file_name); $sample_template_file_name = preg_replace('/[^-\.\_0-9a-zA-Z]/','_',$sample_template_file_name);
copy($LF_path, "/tmp/$sample_template_file_name"); copy($LF_path, "/tmp/$sample_template_file_name");
$new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $sample_template_file_name); $new_filename = preg_replace("/\.csv$|\.xls$|\.xlsx$|\.ods$|\.sxc$/i", '.txt', $sample_template_file_name);
$convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$sample_template_file_name /tmp/$new_filename"; $convert_command = "$WeBServeRRooT/$admin_web_directory/sheet2tab.pl /tmp/$sample_template_file_name /tmp/$new_filename";
@@ -84,7 +88,7 @@ if ($form_action=="prime_file" && $sample_template_file_name)
{$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");} {$stmt_file=fopen("$WeBServeRRooT/$admin_web_directory/listloader_stmts.txt", "w");}
$buffer=fgets($file, 4096); $buffer=fgets($file, 4096);
$buffer=eregi_replace("[\'\"\n]", "", $buffer); $buffer=preg_replace('/[\'\"\n]/i', $buffer);
$tab_count=substr_count($buffer, "\t"); $tab_count=substr_count($buffer, "\t");
$pipe_count=substr_count($buffer, "|"); $pipe_count=substr_count($buffer, "|");
@@ -184,7 +188,7 @@ if ($delimiter && $buffer)
# $buffer=rtrim(fgets($file, 4096)); # $buffer=rtrim(fgets($file, 4096));
# $buffer=stripslashes($buffer); # $buffer=stripslashes($buffer);
# print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name file...\n"; # print "<center><font face='arial, helvetica' size=3 color='#009900'><B>Processing $delim_name file...\n";
$row=explode($delimiter, eregi_replace("[\'\"]", "", $buffer)); $row=explode($delimiter, preg_replace('/[\'\"]/i', '', $buffer));
# echo "delimiter: $delimiter<BR>$buffer<BR>"; # echo "delimiter: $delimiter<BR>$buffer<BR>";
} }
echo "<table border=0 width='100%' cellpadding=0 cellspacing=0>"; echo "<table border=0 width='100%' cellpadding=0 cellspacing=0>";
@@ -195,7 +199,7 @@ for ($i=0; $i<mysql_num_fields($rslt); $i++)
if (preg_match('/'.mysql_field_name($rslt, $i).'/', $vicidial_list_fields)) {$bgcolor="#D9E6FE";} else {$bgcolor="#FED9D9";} if (preg_match('/'.mysql_field_name($rslt, $i).'/', $vicidial_list_fields)) {$bgcolor="#D9E6FE";} else {$bgcolor="#FED9D9";}
echo " <tr bgcolor='$bgcolor'>\r\n"; echo " <tr bgcolor='$bgcolor'>\r\n";
echo " <td align=right nowrap><font class=standard>".strtoupper(eregi_replace("_", " ", mysql_field_name($rslt, $i))).": </font></td>\r\n"; echo " <td align=right nowrap><font class=standard>".strtoupper(preg_replace('/_/i', ' ', mysql_field_name($rslt, $i))).": </font></td>\r\n";
if (mysql_field_name($rslt, $i)!="list_id") if (mysql_field_name($rslt, $i)!="list_id")
{ {
echo " <td align=left><select name='$field_prefix".mysql_field_name($rslt, $i)."_field' onChange='DrawTemplateStrings()'>\r\n"; echo " <td align=left><select name='$field_prefix".mysql_field_name($rslt, $i)."_field' onChange='DrawTemplateStrings()'>\r\n";
@@ -203,7 +207,7 @@ for ($i=0; $i<mysql_num_fields($rslt); $i++)
for ($j=0; $j<count($row); $j++) for ($j=0; $j<count($row); $j++)
{ {
eregi_replace("\"", "", $row[$j]); preg_replace('/\"/i', '', $row[$j]);
echo " <option value='$j'>\"$row[$j]\"</option>\r\n"; echo " <option value='$j'>\"$row[$j]\"</option>\r\n";
} }
+5 -4
View File
@@ -23,6 +23,7 @@
# 120713-2110 - Added extended_vl_fields option # 120713-2110 - Added extended_vl_fields option
# 120907-1217 - Raised extended fields up to 99 # 120907-1217 - Raised extended fields up to 99
# 130414-0228 - Added report logging # 130414-0228 - Added report logging
# 130610-0945 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -69,8 +70,8 @@ if ($qm_conf_ct > 0)
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^-_0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/','',$PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 7 and download_lists='1' and active='Y';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -148,7 +149,7 @@ if ($extended_vl_fields > 0)
} }
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -552,7 +553,7 @@ $rslt=mysql_query($stmt, $link);
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|$stmtA|"; $SQL_log = "$stmt|$stmtA|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT $event_code_type', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$PHP_AUTH_USER', ip_address='$ip', event_section='LEADS', event_type='EXPORT', record_id='$list_id', event_code='ADMIN EXPORT $event_code_type', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -1,7 +1,7 @@
<?php <?php
# listloaderMAIN.php # listloaderMAIN.php
# #
# Copyright (C) 2012 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell,Joe Johnson <vicidial@gmail.com> LICENSE: AGPLv2
# #
# this is the main frame page for the lead loading section. This is where you # this is the main frame page for the lead loading section. This is where you
# would upload a file and have it inserted into vicidial_list # would upload a file and have it inserted into vicidial_list
@@ -11,6 +11,7 @@
# 60822-1105 - fixed for nonwritable directories # 60822-1105 - fixed for nonwritable directories
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 120223-2151 - Removed logging of good login passwords if webroot writable is enabled # 120223-2151 - Removed logging of good login passwords if webroot writable is enabled
# 130610-1111 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -39,8 +40,8 @@ while ($i < $qm_conf_ct)
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$STARTtime = date("U"); $STARTtime = date("U");
$TODAY = date("Y-m-d"); $TODAY = date("Y-m-d");
@@ -100,7 +101,7 @@ if( (strlen($PHP_AUTH_USER)<2) or (strlen($PHP_AUTH_PW)<2) or (!$auth))
?><HTML> ?><HTML>
<HEAD> <HEAD>
<TITLE>VICIDIAL: Lead Loader Module</TITLE> <TITLE>Lead Loader Module</TITLE>
</HEAD> </HEAD>
<FRAMESET ROWS="300,*" border=0> <FRAMESET ROWS="300,*" border=0>
<FRAME SRC="listloader.php" NAME="main"> <FRAME SRC="listloader.php" NAME="main">
+235 -221
View File
@@ -75,10 +75,12 @@
# 130405-1539 - Added agent_status function # 130405-1539 - Added agent_status function
# 130414-0311 - Added report logging for blind_monitor function # 130414-0311 - Added report logging for blind_monitor function
# 130420-1938 - Added NANPA prefix validation and timezone options # 130420-1938 - Added NANPA prefix validation and timezone options
# 130614-0907 - Finalized changing of all ereg instances to preg
# - Added pause code to output of agent_status function
# #
$version = '2.6-53'; $version = '2.8-54';
$build = '130420-1938'; $build = '130614-0907';
$api_url_log = 0; $api_url_log = 0;
$startMS = microtime(); $startMS = microtime();
@@ -352,145 +354,145 @@ if ($qm_conf_ct > 0)
if ($non_latin < 1) if ($non_latin < 1)
{ {
$DB=ereg_replace("[^0-9]","",$DB); $DB=preg_replace('/[^0-9]/','',$DB);
$user=ereg_replace("[^0-9a-zA-Z]","",$user); $user=preg_replace('/[^0-9a-zA-Z]/','',$user);
$pass=ereg_replace("[^0-9a-zA-Z]","",$pass); $pass=preg_replace('/[^0-9a-zA-Z]/','',$pass);
$function = ereg_replace("[^-\_0-9a-zA-Z]","",$function); $function = preg_replace('/[^-\_0-9a-zA-Z]/', '',$function);
$format = ereg_replace("[^0-9a-zA-Z]","",$format); $format = preg_replace('/[^0-9a-zA-Z]/','',$format);
$list_id = ereg_replace("[^0-9]","",$list_id); $list_id = preg_replace('/[^0-9]/','',$list_id);
$phone_code = ereg_replace("[^0-9]","",$phone_code); $phone_code = preg_replace('/[^0-9]/','',$phone_code);
$update_phone_number=ereg_replace("[^A-Z]","",$update_phone_number); $update_phone_number=preg_replace('/[^A-Z]/','',$update_phone_number);
$phone_number = ereg_replace("[^0-9]","",$phone_number); $phone_number = preg_replace('/[^0-9]/','',$phone_number);
$vendor_lead_code = ereg_replace(";","",$vendor_lead_code); $vendor_lead_code = preg_replace('/;/','',$vendor_lead_code);
$vendor_lead_code = ereg_replace("\+"," ",$vendor_lead_code); $vendor_lead_code = preg_replace('/\+/',' ',$vendor_lead_code);
$source_id = ereg_replace(";","",$source_id); $source_id = preg_replace('/;/','',$source_id);
$source_id = ereg_replace("\+"," ",$source_id); $source_id = preg_replace('/\+/',' ',$source_id);
$gmt_offset_now = ereg_replace("-\_\.0-9","",$gmt_offset_now); $gmt_offset_now = preg_replace('/-\_\.0-9/','',$gmt_offset_now);
$title = ereg_replace("[^- \_\.0-9a-zA-Z]","",$title); $title = preg_replace('/[^- \_\.0-9a-zA-Z]/','',$title);
$first_name = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$first_name); $first_name = preg_replace('/[^- \+\_\.0-9a-zA-Z]/','',$first_name);
$first_name = ereg_replace("\+"," ",$first_name); $first_name = preg_replace('/\+/',' ',$first_name);
$middle_initial = ereg_replace("[^0-9a-zA-Z]","",$middle_initial); $middle_initial = preg_replace('/[^0-9a-zA-Z]/','',$middle_initial);
$last_name = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$last_name); $last_name = preg_replace('/[^- \+\_\.0-9a-zA-Z]/','',$last_name);
$last_name = ereg_replace("\+"," ",$last_name); $last_name = preg_replace('/\+/',' ',$last_name);
$address1 = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$address1); $address1 = preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$address1);
$address2 = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$address2); $address2 = preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$address2);
$address3 = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$address3); $address3 = preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$address3);
$address1 = ereg_replace("\+"," ",$address1); $address1 = preg_replace('/\+/',' ',$address1);
$address2 = ereg_replace("\+"," ",$address2); $address2 = preg_replace('/\+/',' ',$address2);
$address3 = ereg_replace("\+"," ",$address3); $address3 = preg_replace('/\+/',' ',$address3);
$city = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$city); $city = preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$city);
$city = ereg_replace("\+"," ",$city); $city = preg_replace('/\+/',' ',$city);
$state = ereg_replace("[^- 0-9a-zA-Z]","",$state); $state = preg_replace('/[^- 0-9a-zA-Z]/','',$state);
$province = ereg_replace("[^- \+\.\_0-9a-zA-Z]","",$province); $province = preg_replace('/[^- \+\.\_0-9a-zA-Z]/','',$province);
$province = ereg_replace("\+"," ",$province); $province = preg_replace('/\+/',' ',$province);
$postal_code = ereg_replace("[^- \+0-9a-zA-Z]","",$postal_code); $postal_code = preg_replace('/[^- \+0-9a-zA-Z]/','',$postal_code);
$postal_code = ereg_replace("\+"," ",$postal_code); $postal_code = preg_replace('/\+/',' ',$postal_code);
$country_code = ereg_replace("[^A-Z]","",$country_code); $country_code = preg_replace('/[^A-Z]/','',$country_code);
$gender = ereg_replace("[^A-Z]","",$gender); $gender = preg_replace('/[^A-Z]/','',$gender);
$date_of_birth = ereg_replace("[^-0-9]","",$date_of_birth); $date_of_birth = preg_replace('/[^-0-9]/','',$date_of_birth);
$alt_phone = ereg_replace("[^- \+\_\.0-9a-zA-Z]","",$alt_phone); $alt_phone = preg_replace('/[^- \+\_\.0-9a-zA-Z]/','',$alt_phone);
$alt_phone = ereg_replace("\+"," ",$alt_phone); $alt_phone = preg_replace('/\+/',' ',$alt_phone);
$email = ereg_replace("[^- \+\.\:\/\@\%\_0-9a-zA-Z]","",$email); $email = preg_replace('/[^- \+\.\:\/\@\%\_0-9a-zA-Z]/','',$email);
$email = ereg_replace("\+"," ",$email); $email = preg_replace('/\+/',' ',$email);
$security_phrase = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$security_phrase); $security_phrase = preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$security_phrase);
$security_phrase = ereg_replace("\+"," ",$security_phrase); $security_phrase = preg_replace('/\+/',' ',$security_phrase);
$comments = ereg_replace(";","",$comments); $comments = preg_replace('/;/','',$comments);
$comments = ereg_replace("\+"," ",$comments); $comments = preg_replace('/\+/',' ',$comments);
$dnc_check = ereg_replace("[^A-Z]","",$dnc_check); $dnc_check = preg_replace('/[^A-Z]/','',$dnc_check);
$campaign_dnc_check = ereg_replace("[^A-Z]","",$campaign_dnc_check); $campaign_dnc_check = preg_replace('/[^A-Z]/','',$campaign_dnc_check);
$add_to_hopper = ereg_replace("[^A-Z]","",$add_to_hopper); $add_to_hopper = preg_replace('/[^A-Z]/','',$add_to_hopper);
$hopper_priority = ereg_replace("-0-9","",$hopper_priority); $hopper_priority = preg_replace("/[^-0-9]/", "",$hopper_priority);
$hopper_local_call_time_check = ereg_replace("[^A-Z]","",$hopper_local_call_time_check); $hopper_local_call_time_check = preg_replace('/[^A-Z]/','',$hopper_local_call_time_check);
$campaign_id = ereg_replace("[^-\_0-9a-zA-Z]","",$campaign_id); $campaign_id = preg_replace('/[^-\_0-9a-zA-Z]/', '',$campaign_id);
$multi_alt_phones = ereg_replace("[^- \+\!\:\_0-9a-zA-Z]","",$multi_alt_phones); $multi_alt_phones = preg_replace('/[^- \+\!\:\_0-9a-zA-Z]/','',$multi_alt_phones);
$multi_alt_phones = ereg_replace("\+"," ",$multi_alt_phones); $multi_alt_phones = preg_replace('/\+/',' ',$multi_alt_phones);
$source = ereg_replace("[^0-9a-zA-Z]","",$source); $source = preg_replace('/[^0-9a-zA-Z]/','',$source);
$phone_login = ereg_replace("[^-\_0-9a-zA-Z]","",$phone_login); $phone_login = preg_replace('/[^-\_0-9a-zA-Z]/', '',$phone_login);
$session_id = ereg_replace("[^0-9]","",$session_id); $session_id = preg_replace('/[^0-9]/','',$session_id);
$server_ip = ereg_replace("[^\.0-9]","",$server_ip); $server_ip = preg_replace('/[^\.0-9]/','',$server_ip);
$stage = ereg_replace("[^a-zA-Z]","",$stage); $stage = preg_replace('/[^a-zA-Z]/','',$stage);
$rank = ereg_replace("[^0-9]","",$rank); $rank = preg_replace('/[^0-9]/','',$rank);
$owner = ereg_replace("[^-_0-9a-zA-Z]","",$owner); $owner = preg_replace('/[^-_0-9a-zA-Z]/','',$owner);
$duplicate_check = ereg_replace("[^-_0-9a-zA-Z]","",$duplicate_check); $duplicate_check = preg_replace('/[^-_0-9a-zA-Z]/','',$duplicate_check);
$custom_fields = ereg_replace("[^0-9a-zA-Z]","",$custom_fields); $custom_fields = preg_replace('/[^0-9a-zA-Z]/','',$custom_fields);
$search_method = ereg_replace("[^-_0-9a-zA-Z]","",$search_method); $search_method = preg_replace('/[^-_0-9a-zA-Z]/','',$search_method);
$insert_if_not_found = ereg_replace("[^A-Z]","",$insert_if_not_found); $insert_if_not_found = preg_replace('/[^A-Z]/','',$insert_if_not_found);
$records = ereg_replace("[^0-9]","",$records); $records = preg_replace('/[^0-9]/','',$records);
$search_location = ereg_replace("[^A-Z]","",$search_location); $search_location = preg_replace('/[^A-Z]/','',$search_location);
$user_field = ereg_replace("[^-_0-9a-zA-Z]","",$user_field); $user_field = preg_replace('/[^-_0-9a-zA-Z]/','',$user_field);
$list_id_field = ereg_replace("[^0-9]","",$list_id_field); $list_id_field = preg_replace('/[^0-9]/','',$list_id_field);
$lead_id = ereg_replace("[^0-9]","",$lead_id); $lead_id = preg_replace('/[^0-9]/','',$lead_id);
$no_update = ereg_replace("[^A-Z]","",$no_update); $no_update = preg_replace('/[^A-Z]/','',$no_update);
$delete_lead = ereg_replace("[^A-Z]","",$delete_lead); $delete_lead = preg_replace('/[^A-Z]/','',$delete_lead);
$called_count=ereg_replace("[^0-9]","",$called_count); $called_count=preg_replace('/[^0-9]/','',$called_count);
$agent_user_level=ereg_replace("[^0-9]","",$agent_user_level); $agent_user_level=preg_replace('/[^0-9]/','',$agent_user_level);
$hotkeys_active=ereg_replace("[^0-9]","",$hotkeys_active); $hotkeys_active=preg_replace('/[^0-9]/','',$hotkeys_active);
$voicemail_id=ereg_replace("[^0-9]","",$voicemail_id); $voicemail_id=preg_replace('/[^0-9]/','',$voicemail_id);
$agent_pass=ereg_replace("[^-_0-9a-zA-Z]","",$agent_pass); $agent_pass=preg_replace('/[^-_0-9a-zA-Z]/','',$agent_pass);
$agent_full_name=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$agent_full_name); $agent_full_name=preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$agent_full_name);
$agent_user_group=ereg_replace("[^-_0-9a-zA-Z]","",$agent_user_group); $agent_user_group=preg_replace('/[^-_0-9a-zA-Z]/','',$agent_user_group);
$phone_pass=ereg_replace("[^-_0-9a-zA-Z]","",$phone_pass); $phone_pass=preg_replace('/[^-_0-9a-zA-Z]/','',$phone_pass);
$email=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$email); $email=preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$email);
$custom_one=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_one); $custom_one=preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$custom_one);
$custom_two=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_two); $custom_two=preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$custom_two);
$custom_three=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_three); $custom_three=preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$custom_three);
$custom_four=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_four); $custom_four=preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$custom_four);
$custom_five=ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$custom_five); $custom_five=preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$custom_five);
$extension=ereg_replace("[^-_0-9a-zA-Z]","",$extension); $extension=preg_replace('/[^-_0-9a-zA-Z]/','',$extension);
$dialplan_number=ereg_replace("[^\*\#0-9a-zA-Z]","",$dialplan_number); $dialplan_number=preg_replace('/[^\*\#0-9a-zA-Z]/','',$dialplan_number);
$protocol=ereg_replace("[^0-9a-zA-Z]","",$protocol); $protocol=preg_replace('/[^0-9a-zA-Z]/','',$protocol);
$registration_password=ereg_replace("[^-_0-9a-zA-Z]","",$registration_password); $registration_password=preg_replace('/[^-_0-9a-zA-Z]/','',$registration_password);
$phone_full_name=ereg_replace("[^- \+\.\_0-9a-zA-Z]","",$phone_full_name); $phone_full_name=preg_replace('/[^- \+\.\_0-9a-zA-Z]/','',$phone_full_name);
$local_gmt=ereg_replace("[^-\.0-9]","",$local_gmt); $local_gmt=preg_replace('/[^-\.0-9]/','',$local_gmt);
$outbound_cid=ereg_replace("[^0-9]","",$outbound_cid); $outbound_cid=preg_replace('/[^0-9]/','',$outbound_cid);
$phone_context=ereg_replace("[^-_0-9a-zA-Z]","",$phone_context); $phone_context=preg_replace('/[^-_0-9a-zA-Z]/','',$phone_context);
$list_name=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$list_name); $list_name=preg_replace('/[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$list_name);
$active=ereg_replace("[^A-Z]","",$active); $active=preg_replace('/[^A-Z]/','',$active);
$script=ereg_replace("[^-_0-9a-zA-Z]","",$script); $script=preg_replace('/[^-_0-9a-zA-Z]/','',$script);
$am_message=ereg_replace("[^-_0-9a-zA-Z]","",$am_message); $am_message=preg_replace('/[^-_0-9a-zA-Z]/','',$am_message);
$drop_inbound_group=ereg_replace("[^-_0-9a-zA-Z]","",$drop_inbound_group); $drop_inbound_group=preg_replace('/[^-_0-9a-zA-Z]/','',$drop_inbound_group);
$web_form_address=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$web_form_address); $web_form_address=preg_replace('/[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$web_form_address);
$web_form_address_two=ereg_replace("[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]","",$web_form_address_two); $web_form_address_two=preg_replace('/[^- \+\.\:\/\@\?\&\_0-9a-zA-Z]/','',$web_form_address_two);
$reset_list=ereg_replace("[^A-Z]","",$reset_list); $reset_list=preg_replace('/[^A-Z]/','',$reset_list);
$delete_list=ereg_replace("[^A-Z]","",$delete_list); $delete_list=preg_replace('/[^A-Z]/','',$delete_list);
$delete_leads=ereg_replace("[^A-Z]","",$delete_leads); $delete_leads=preg_replace('/[^A-Z]/','',$delete_leads);
$reset_time=ereg_replace("[^-_0-9]","",$reset_time); $reset_time=preg_replace('/[^-_0-9]/', '',$reset_time);
$uniqueid=ereg_replace("[^- \.\_0-9a-zA-Z]","",$uniqueid); $uniqueid=preg_replace('/[^- \.\_0-9a-zA-Z]/','',$uniqueid);
$tz_method = ereg_replace("[^-\_0-9a-zA-Z]","",$tz_method); $tz_method = preg_replace('/[^-\_0-9a-zA-Z]/', '',$tz_method);
$reset_lead = ereg_replace("[^A-Z]","",$reset_lead); $reset_lead = preg_replace('/[^A-Z]/','',$reset_lead);
$usacan_areacode_check = ereg_replace("[^A-Z]","",$usacan_areacode_check); $usacan_areacode_check = preg_replace('/[^A-Z]/','',$usacan_areacode_check);
$usacan_prefix_check = ereg_replace("[^A-Z]","",$usacan_prefix_check); $usacan_prefix_check = preg_replace('/[^A-Z]/','',$usacan_prefix_check);
$delete_phone = ereg_replace("[^A-Z]","",$delete_phone); $delete_phone = preg_replace('/[^A-Z]/','',$delete_phone);
$alias_id = ereg_replace("[^-\_0-9a-zA-Z]","",$alias_id); $alias_id = preg_replace('/[^-\_0-9a-zA-Z]/', '',$alias_id);
$phone_logins = ereg_replace("[^-\,\_0-9a-zA-Z]","",$phone_logins); $phone_logins = preg_replace('/[^-\,\_0-9a-zA-Z]/','',$phone_logins);
$alias_name = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$alias_name); $alias_name = preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$alias_name);
$delete_alias = ereg_replace("[^A-Z]","",$delete_alias); $delete_alias = preg_replace('/[^A-Z]/','',$delete_alias);
$callback = ereg_replace("[^A-Z]","",$callback); $callback = preg_replace('/[^A-Z]/','',$callback);
$callback_status = ereg_replace("[^-\_0-9a-zA-Z]","",$callback_status); $callback_status = preg_replace('/[^-\_0-9a-zA-Z]/', '',$callback_status);
$callback_datetime = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$callback_datetime); $callback_datetime = preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$callback_datetime);
$callback_type = ereg_replace("[^A-Z]","",$callback_type); $callback_type = preg_replace('/[^A-Z]/','',$callback_type);
$callback_user = ereg_replace("[^-\_0-9a-zA-Z]","",$callback_user); $callback_user = preg_replace('/[^-\_0-9a-zA-Z]/', '',$callback_user);
$callback_comments = ereg_replace("[^- \+\.\:\/\@\_0-9a-zA-Z]","",$callback_comments); $callback_comments = preg_replace('/[^- \+\.\:\/\@\_0-9a-zA-Z]/','',$callback_comments);
$admin_user_group = ereg_replace("[^-\_0-9a-zA-Z]","",$admin_user_group); $admin_user_group = preg_replace('/[^-\_0-9a-zA-Z]/', '',$admin_user_group);
$datetime_start = ereg_replace("[^- \+\:\_0-9]","",$datetime_start); $datetime_start = preg_replace('/[^- \+\:\_0-9]/','',$datetime_start);
$datetime_end = ereg_replace("[^- \+\:\_0-9]","",$datetime_end); $datetime_end = preg_replace('/[^- \+\:\_0-9]/','',$datetime_end);
$time_format = ereg_replace("[^A-Z]","",$time_format); $time_format = preg_replace('/[^A-Z]/','',$time_format);
$group_alias_id = ereg_replace("[^\_0-9a-zA-Z]","",$group_alias_id); $group_alias_id = preg_replace('/[^\_0-9a-zA-Z]/','',$group_alias_id);
$group_alias_name = ereg_replace("[^- \+\_0-9a-zA-Z]","",$group_alias_name); $group_alias_name = preg_replace('/[^- \+\_0-9a-zA-Z]/','',$group_alias_name);
$caller_id_number = ereg_replace("[^0-9]","",$caller_id_number); $caller_id_number = preg_replace('/[^0-9]/','',$caller_id_number);
$caller_id_name = ereg_replace("[^- \+\_0-9a-zA-Z]","",$caller_id_name); $caller_id_name = preg_replace('/[^- \+\_0-9a-zA-Z]/','',$caller_id_name);
$user_groups = ereg_replace("[^-\|\_0-9a-zA-Z]","",$user_groups); $user_groups = preg_replace('/[^-\|\_0-9a-zA-Z]/','',$user_groups);
$in_groups = ereg_replace("[^-\|\_0-9a-zA-Z]","",$in_groups); $in_groups = preg_replace('/[^-\|\_0-9a-zA-Z]/','',$in_groups);
$call_id = ereg_replace("[^0-9a-zA-Z]","",$call_id); $call_id = preg_replace('/[^0-9a-zA-Z]/','',$call_id);
$group = ereg_replace("[^-\|\_0-9a-zA-Z]","",$group); $group = preg_replace('/[^-\|\_0-9a-zA-Z]/','',$group);
$expiration_date = ereg_replace("[^-_0-9a-zA-Z]","",$expiration_date); $expiration_date = preg_replace('/[^-_0-9a-zA-Z]/','',$expiration_date);
$nanpa_ac_prefix_check = ereg_replace("[^A-Z]","",$nanpa_ac_prefix_check); $nanpa_ac_prefix_check = preg_replace('/[^A-Z]/','',$nanpa_ac_prefix_check);
} }
else else
{ {
$user = ereg_replace("'|\"|\\\\|;","",$user); $user = preg_replace("/'|\"|\\\\|;/","",$user);
$pass = ereg_replace("'|\"|\\\\|;","",$pass); $pass = preg_replace("/'|\"|\\\\|;/","",$pass);
$source = ereg_replace("'|\"|\\\\|;","",$source); $source = preg_replace("/'|\"|\\\\|;/","",$source);
} }
$USarea = substr($phone_number, 0, 3); $USarea = substr($phone_number, 0, 3);
@@ -544,7 +546,7 @@ if ($gmt_recs > 0)
else else
{ {
$SERVER_GMT = date("O"); $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 + 0);
$SERVER_GMT = ($SERVER_GMT / 100); $SERVER_GMT = ($SERVER_GMT / 100);
} }
@@ -597,7 +599,7 @@ if ($function == 'sounds_list')
{ {
$server_name = getenv("SERVER_NAME"); $server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT"); $server_port = getenv("SERVER_PORT");
if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';} else {$HTTPprotocol = 'http://';}
$admDIR = "$HTTPprotocol$server_name:$server_port"; $admDIR = "$HTTPprotocol$server_name:$server_port";
$admin_web_dir=''; $admin_web_dir='';
@@ -650,9 +652,9 @@ if ($function == 'sounds_list')
$file_dates[$i] = date ("Y-m-d H:i:s.", filemtime("$dirpath/$file")); $file_dates[$i] = date ("Y-m-d H:i:s.", filemtime("$dirpath/$file"));
$file_sizes[$i] = filesize("$dirpath/$file"); $file_sizes[$i] = filesize("$dirpath/$file");
$file_sizesPAD[$i] = sprintf("[%020s]\n",filesize("$dirpath/$file")); $file_sizesPAD[$i] = sprintf("[%020s]\n",filesize("$dirpath/$file"));
if (eregi('date',$stage)) {$file_sort[$i] = $file_epoch[$i] . "----------" . $i;} if (preg_match('/date/i',$stage)) {$file_sort[$i] = $file_epoch[$i] . "----------" . $i;}
if (eregi('name',$stage)) {$file_sort[$i] = $file_names[$i] . "----------" . $i;} if (preg_match('/name/i',$stage)) {$file_sort[$i] = $file_names[$i] . "----------" . $i;}
if (eregi('size',$stage)) {$file_sort[$i] = $file_sizesPAD[$i] . "----------" . $i;} if (preg_match('/size/i',$stage)) {$file_sort[$i] = $file_sizesPAD[$i] . "----------" . $i;}
$i++; $i++;
} }
@@ -660,9 +662,9 @@ if ($function == 'sounds_list')
} }
closedir($dh); closedir($dh);
if (eregi('date',$stage)) {rsort($file_sort);} if (preg_match('/date/i',$stage)) {rsort($file_sort);}
if (eregi('name',$stage)) {sort($file_sort);} if (preg_match('/name/i',$stage)) {sort($file_sort);}
if (eregi('size',$stage)) {rsort($file_sort);} if (preg_match('/size/i',$stage)) {rsort($file_sort);}
sleep(1); sleep(1);
@@ -676,11 +678,11 @@ if ($function == 'sounds_list')
if ($DB>0) {echo "DEBUG: sounds_list variables - $file_sort[$k]|$size|$NOWsize|\n";} if ($DB>0) {echo "DEBUG: sounds_list variables - $file_sort[$k]|$size|$NOWsize|\n";}
if ($file_sizes[$m] == $NOWsize) if ($file_sizes[$m] == $NOWsize)
{ {
if (eregi('tab',$format)) if (preg_match('/tab/i',$format))
{echo "$k\t$file_names[$m]\t$file_dates[$m]\t$file_sizes[$m]\t$file_epoch[$m]\n";} {echo "$k\t$file_names[$m]\t$file_dates[$m]\t$file_sizes[$m]\t$file_epoch[$m]\n";}
if (eregi('link',$format)) if (preg_match('/link/i',$format))
{echo "<a href=\"http://$sounds_web_server/$admin_web_dir$sounds_web_directory/$file_names[$m]\">$file_names[$m]</a><br>\n";} {echo "<a href=\"http://$sounds_web_server/$admin_web_dir$sounds_web_directory/$file_names[$m]\">$file_names[$m]</a><br>\n";}
if (eregi('selectframe',$format)) if (preg_match('/selectframe/i',$format))
{ {
if ($sf < 1) if ($sf < 1)
{ {
@@ -765,7 +767,7 @@ if ($function == 'moh_list')
{ {
$server_name = getenv("SERVER_NAME"); $server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT"); $server_port = getenv("SERVER_PORT");
if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';} else {$HTTPprotocol = 'http://';}
$admDIR = "$HTTPprotocol$server_name:$server_port"; $admDIR = "$HTTPprotocol$server_name:$server_port";
@@ -811,7 +813,7 @@ if ($function == 'moh_list')
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -870,7 +872,7 @@ if ($function == 'moh_list')
while ($moh_to_print > $k) while ($moh_to_print > $k)
{ {
$sf++; $sf++;
if (eregi("1$|3$|5$|7$|9$", $sf)) if (preg_match("/1$|3$|5$|7$|9$/i", $sf))
{$bgcolor='bgcolor="#E6E6E6"';} {$bgcolor='bgcolor="#E6E6E6"';}
else else
{$bgcolor='bgcolor="#F6F6F6"';} {$bgcolor='bgcolor="#F6F6F6"';}
@@ -944,7 +946,7 @@ if ($function == 'vm_list')
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -954,7 +956,7 @@ if ($function == 'vm_list')
$server_name = getenv("SERVER_NAME"); $server_name = getenv("SERVER_NAME");
$server_port = getenv("SERVER_PORT"); $server_port = getenv("SERVER_PORT");
if (eregi("443",$server_port)) {$HTTPprotocol = 'https://';} if (preg_match("/443/i",$server_port)) {$HTTPprotocol = 'https://';}
else {$HTTPprotocol = 'http://';} else {$HTTPprotocol = 'http://';}
$admDIR = "$HTTPprotocol$server_name:$server_port"; $admDIR = "$HTTPprotocol$server_name:$server_port";
@@ -1002,7 +1004,7 @@ if ($function == 'vm_list')
$fullname[$k] = $rowx[1]; $fullname[$k] = $rowx[1];
$email[$k] = $rowx[2]; $email[$k] = $rowx[2];
$sf++; $sf++;
if (eregi("1$|3$|5$|7$|9$", $sf)) if (preg_match("/1$|3$|5$|7$|9$/i", $sf))
{$bgcolor='bgcolor="#E6E6E6"';} {$bgcolor='bgcolor="#E6E6E6"';}
else else
{$bgcolor='bgcolor="#F6F6F6"';} {$bgcolor='bgcolor="#F6F6F6"';}
@@ -1027,7 +1029,7 @@ if ($function == 'vm_list')
$email[$k] = $rowx[2]; $email[$k] = $rowx[2];
$extension[$k] = $rowx[3]; $extension[$k] = $rowx[3];
$sf++; $sf++;
if (eregi("1$|3$|5$|7$|9$", $sf)) if (preg_match("/1$|3$|5$|7$|9$/i", $sf))
{$bgcolor='bgcolor="#E6E6E6"';} {$bgcolor='bgcolor="#E6E6E6"';}
else else
{$bgcolor='bgcolor="#F6F6F6"';} {$bgcolor='bgcolor="#F6F6F6"';}
@@ -1096,7 +1098,7 @@ if ($function == 'agent_ingroup_info')
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -1476,9 +1478,9 @@ if ($function == 'blind_monitor')
while (strlen($PADuser) > 8) {$PADuser = substr("$PADuser", 0, -1);} while (strlen($PADuser) > 8) {$PADuser = substr("$PADuser", 0, -1);}
$BMquery = "BM$StarTtime$PADuser"; $BMquery = "BM$StarTtime$PADuser";
if ( (ereg('MONITOR',$stage)) or (strlen($stage)<1) ) {$stage = '0';} if ( (preg_match('/MONITOR/',$stage)) or (strlen($stage)<1) ) {$stage = '0';}
if (ereg('BARGE',$stage)) {$stage = '';} if (preg_match('/BARGE/',$stage)) {$stage = '';}
if (ereg('HIJACK',$stage)) {$stage = '';} if (preg_match('/HIJACK/',$stage)) {$stage = '';}
### insert a new lead in the system with this phone number ### insert a new lead in the system with this phone number
$stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$monitor_server_ip','','Originate','$BMquery','Channel: Local/$monitor_dialstring$stage$session_id@default','Context; default','Exten: $dialplan_number','Priority: 1','Callerid: \"VC Blind Monitor\" <$outbound_cid>','','','','','');"; $stmt = "INSERT INTO vicidial_manager values('','','$NOW_TIME','NEW','N','$monitor_server_ip','','Originate','$BMquery','Channel: Local/$monitor_dialstring$stage$session_id@default','Context; default','Exten: $dialplan_number','Priority: 1','Callerid: \"VC Blind Monitor\" <$outbound_cid>','','','','','');";
@@ -1535,8 +1537,8 @@ if ($api_url_log > 0)
$POST_URI = ''; $POST_URI = '';
foreach($_POST as $key=>$value) foreach($_POST as $key=>$value)
{$POST_URI .= '&'.$key.'='.$value;} {$POST_URI .= '&'.$key.'='.$value;}
$REQUEST_URI = ereg_replace("'|\"|\\\\|;","",$REQUEST_URI); $REQUEST_URI = preg_replace("/'|\"|\\\\|;/","",$REQUEST_URI);
$POST_URI = ereg_replace("'|\"|\\\\|;","",$POST_URI); $POST_URI = preg_replace("/'|\"|\\\\|;/","",$POST_URI);
$NOW_DATE = date("Y-m-d"); $NOW_DATE = date("Y-m-d");
$NOW_TIME = date("Y-m-d H:i:s"); $NOW_TIME = date("Y-m-d H:i:s");
$stmt="INSERT INTO vicidial_url_log set uniqueid='$NOW_DATE',url_date='$NOW_TIME',url_type='non-agent',url='$REQUEST_URI$POST_URI',url_response='$ip';"; $stmt="INSERT INTO vicidial_url_log set uniqueid='$NOW_DATE',url_date='$NOW_TIME',url_type='non-agent',url='$REQUEST_URI$POST_URI',url_response='$ip';";
@@ -1604,7 +1606,7 @@ if ($function == 'add_user')
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -1654,7 +1656,7 @@ if ($function == 'add_user')
else else
{ {
# if user value is set to autogenerate then find the next value for user # if user value is set to autogenerate then find the next value for user
if (ereg('AUTOGENERA',$agent_user)) if (preg_match('/AUTOGENERA/',$agent_user))
{ {
$new_user=0; $new_user=0;
$auto_user_add_value=0; $auto_user_add_value=0;
@@ -1698,7 +1700,7 @@ if ($function == 'add_user')
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='USERS', event_type='ADD', record_id='$agent_user', event_code='ADMIN API ADD USER', event_sql=\"$SQL_log\", event_notes='user: $agent_user';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='USERS', event_type='ADD', record_id='$agent_user', event_code='ADMIN API ADD USER', event_sql=\"$SQL_log\", event_notes='user: $agent_user';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -1792,7 +1794,7 @@ if ($function == 'add_group_alias')
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='GROUPALIASES', event_type='ADD', record_id='$group_alias_id', event_code='ADMIN API ADD GROUP ALIAS', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='GROUPALIASES', event_type='ADD', record_id='$group_alias_id', event_code='ADMIN API ADD GROUP ALIAS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -1921,7 +1923,7 @@ if ($function == 'add_phone')
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='PHONES', event_type='ADD', record_id='$extension', event_code='ADMIN API ADD PHONE', event_sql=\"$SQL_log\", event_notes='phone: $extension|$server_ip';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='PHONES', event_type='ADD', record_id='$extension', event_code='ADMIN API ADD PHONE', event_sql=\"$SQL_log\", event_notes='phone: $extension|$server_ip';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -2010,7 +2012,7 @@ if ($function == 'update_phone')
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -2072,7 +2074,7 @@ if ($function == 'update_phone')
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='PHONES', event_type='DELETE', record_id='$extension', event_code='ADMIN API DELETE PHONE', event_sql=\"$SQL_log\", event_notes='phone: $extension|$server_ip';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='PHONES', event_type='DELETE', record_id='$extension', event_code='ADMIN API DELETE PHONE', event_sql=\"$SQL_log\", event_notes='phone: $extension|$server_ip';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -2336,7 +2338,7 @@ if ($function == 'update_phone')
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='PHONES', event_type='MODIFY', record_id='$extension', event_code='ADMIN API UPDATE PHONE', event_sql=\"$SQL_log\", event_notes='phone: $extension|$server_ip';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='PHONES', event_type='MODIFY', record_id='$extension', event_code='ADMIN API UPDATE PHONE', event_sql=\"$SQL_log\", event_notes='phone: $extension|$server_ip';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -2448,7 +2450,7 @@ if ($function == 'add_phone_alias')
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='PHONEALIASES', event_type='ADD', record_id='$alias_id', event_code='ADMIN API ADD PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='phones: $phone_logins';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='PHONEALIASES', event_type='ADD', record_id='$alias_id', event_code='ADMIN API ADD PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='phones: $phone_logins';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -2554,7 +2556,7 @@ if ($function == 'update_phone_alias')
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='PHONEALIASES', event_type='DELETE', record_id='$alias_id', event_code='ADMIN API DELETE PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='PHONEALIASES', event_type='DELETE', record_id='$alias_id', event_code='ADMIN API DELETE PHONE ALIAS', event_sql=\"$SQL_log\", event_notes='';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -2633,7 +2635,7 @@ if ($function == 'update_phone_alias')
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='PHONEALIASES', event_type='MODIFY', record_id='$alias_id', event_code='ADMIN API UPDATE PHONE', event_sql=\"$SQL_log\", event_notes='phones: $phone_logins';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='PHONEALIASES', event_type='MODIFY', record_id='$alias_id', event_code='ADMIN API UPDATE PHONE', event_sql=\"$SQL_log\", event_notes='phones: $phone_logins';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -2715,7 +2717,7 @@ if ($function == 'update_list')
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -2977,7 +2979,7 @@ if ($function == 'update_list')
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='LISTS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN API UPDATE LIST', event_sql=\"$SQL_log\", event_notes='list: $list_id';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='LISTS', event_type='MODIFY', record_id='$list_id', event_code='ADMIN API UPDATE LIST', event_sql=\"$SQL_log\", event_notes='list: $list_id';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -3003,7 +3005,7 @@ if ($function == 'update_list')
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN API RESET LIST', event_sql=\"$SQL_log\", event_notes='list: $list_id';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='LISTS', event_type='RESET', record_id='$list_id', event_code='ADMIN API RESET LIST', event_sql=\"$SQL_log\", event_notes='list: $list_id';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -3040,7 +3042,7 @@ if ($function == 'update_list')
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$list_id', event_code='ADMIN API DELETE LIST', event_sql=\"$SQL_log\", event_notes='list: $list_id';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$list_id', event_code='ADMIN API DELETE LIST', event_sql=\"$SQL_log\", event_notes='list: $list_id';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -3078,7 +3080,7 @@ if ($function == 'update_list')
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$list_id', event_code='ADMIN API DELETE LEADS', event_sql=\"$SQL_log\", event_notes='list: $list_id';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='LISTS', event_type='DELETE', record_id='$list_id', event_code='ADMIN API DELETE LEADS', event_sql=\"$SQL_log\", event_notes='list: $list_id';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -3163,7 +3165,7 @@ if ($function == 'add_list')
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -3266,7 +3268,7 @@ if ($function == 'add_list')
### LOG INSERTION Admin Log Table ### ### LOG INSERTION Admin Log Table ###
$SQL_log = "$stmt|"; $SQL_log = "$stmt|";
$SQL_log = ereg_replace(';','',$SQL_log); $SQL_log = preg_replace('/;/', '', $SQL_log);
$SQL_log = addslashes($SQL_log); $SQL_log = addslashes($SQL_log);
$stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='LISTS', event_type='ADD', record_id='$list_id', event_code='ADMIN API ADD LIST', event_sql=\"$SQL_log\", event_notes='list: $list_id|$campaign_id';"; $stmt="INSERT INTO vicidial_admin_log set event_date='$NOW_TIME', user='$user', ip_address='$ip', event_section='LISTS', event_type='ADD', record_id='$list_id', event_code='ADMIN API ADD LIST', event_sql=\"$SQL_log\", event_notes='list: $list_id|$campaign_id';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -3892,7 +3894,7 @@ if ($function == 'user_group_status')
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -3902,7 +3904,7 @@ if ($function == 'user_group_status')
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
$whereLOGallowed_callsSQL=''; $whereLOGallowed_callsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -3963,7 +3965,7 @@ if ($function == 'user_group_status')
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$callerids .= "$row[0]|"; $callerids .= "$row[0]|";
if (eregi("LIVE",$row[1])) if (preg_match("/LIVE/i",$row[1]))
{$total_calls_waiting++;} {$total_calls_waiting++;}
$call_camps[$i] = $row[2]; $call_camps[$i] = $row[2];
$call_types[$i] = $row[3]; $call_types[$i] = $row[3];
@@ -3982,13 +3984,13 @@ if ($function == 'user_group_status')
# user,status,campaign_id,user_group,comments,callerid,lead_id # user,status,campaign_id,user_group,comments,callerid,lead_id
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("READY|PAUSED",$row[1])) if (preg_match("/READY|PAUSED/i",$row[1]))
{ {
if ($row[6] > 0) if ($row[6] > 0)
{$row[1] = 'DISPO';} {$row[1] = 'DISPO';}
} }
if (eregi("INCALL",$row[1])) if (preg_match("/INCALL/i",$row[1]))
{ {
$stmtP="select count(*) from parked_channels where channel_group='$row[5]';"; $stmtP="select count(*) from parked_channels where channel_group='$row[5]';";
$rsltP=mysql_query($stmtP,$link); $rsltP=mysql_query($stmtP,$link);
@@ -3999,7 +4001,7 @@ if ($function == 'user_group_status')
{$row[1] = 'PARK';} {$row[1] = 'PARK';}
else else
{ {
if (!ereg("$row[5]\|",$callerids)) if (!preg_match("/$row[5]\|/",$callerids))
{$row[1] = 'DEAD';} {$row[1] = 'DEAD';}
} }
} }
@@ -4010,9 +4012,9 @@ if ($function == 'user_group_status')
{$total_agents_dispo++;} {$total_agents_dispo++;}
if ($row[1]=='PAUSED') if ($row[1]=='PAUSED')
{$total_agents_paused++;} {$total_agents_paused++;}
if ( (eregi("INCALL",$row[1])) or (eregi("QUEUE",$row[1])) or (eregi("PARK",$row[1]))) if ( (preg_match("/INCALL/i",$row[1])) or (preg_match("/QUEUE/i",$row[1])) or (preg_match('/PARK/i',$row[1])))
{$total_agents_in_calls++;} {$total_agents_in_calls++;}
if ( (eregi("READY",$row[1])) or (eregi("CLOSER",$row[1])) ) if ( (preg_match("/READY/i",$row[1])) or (preg_match("/CLOSER/i",$row[1])) )
{$total_agents_waiting++;} {$total_agents_waiting++;}
$total_agents++; $total_agents++;
@@ -4111,7 +4113,7 @@ if ($function == 'in_group_status')
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -4121,7 +4123,7 @@ if ($function == 'in_group_status')
$LOGallowed_campaignsSQL=''; $LOGallowed_campaignsSQL='';
$whereLOGallowed_campaignsSQL=''; $whereLOGallowed_campaignsSQL='';
$LOGallowed_callsSQL=''; $LOGallowed_callsSQL='';
if ( (!eregi("-ALL",$LOGallowed_campaigns)) ) if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
{ {
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns); $rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL); $rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
@@ -4183,7 +4185,7 @@ if ($function == 'in_group_status')
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$callerids .= "$row[0]|"; $callerids .= "$row[0]|";
if (eregi("LIVE",$row[1])) if (preg_match("/LIVE/i",$row[1]))
{$total_calls_waiting++;} {$total_calls_waiting++;}
$call_camps[$i] = $row[2]; $call_camps[$i] = $row[2];
$call_types[$i] = $row[3]; $call_types[$i] = $row[3];
@@ -4220,7 +4222,7 @@ if ($function == 'in_group_status')
# user,status,campaign_id,user_group,comments,callerid,lead_id # user,status,campaign_id,user_group,comments,callerid,lead_id
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("READY|PAUSED",$row[1])) if (preg_match("/READY|PAUSED/i",$row[1]))
{ {
if ($row[6] > 0) if ($row[6] > 0)
{$row[1] = 'DISPO';} {$row[1] = 'DISPO';}
@@ -4229,9 +4231,9 @@ if ($function == 'in_group_status')
{$total_agents_dispo++;} {$total_agents_dispo++;}
if ($row[1]=='PAUSED') if ($row[1]=='PAUSED')
{$total_agents_paused++;} {$total_agents_paused++;}
if ( (eregi("INCALL",$row[1])) or (eregi("QUEUE",$row[1])) or (eregi("PARK",$row[1]))) if ( (preg_match("/INCALL/i",$row[1])) or (preg_match("/QUEUE/i",$row[1])) or (preg_match('/PARK/i',$row[1])))
{$total_agents_in_calls++;} {$total_agents_in_calls++;}
if ( (eregi("READY",$row[1])) or (eregi("CLOSER",$row[1])) ) if ( (preg_match("/READY/i",$row[1])) or (preg_match("/CLOSER/i",$row[1])) )
{$total_agents_waiting++;} {$total_agents_waiting++;}
$total_agents++; $total_agents++;
@@ -4325,7 +4327,7 @@ if ($function == 'agent_status')
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$whereLOGadmin_viewable_groupsSQL=''; $whereLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -4360,7 +4362,7 @@ if ($function == 'agent_status')
$user_group = $row[1]; $user_group = $row[1];
$user_level = $row[2]; $user_level = $row[2];
$stmt="select status,callerid,lead_id,campaign_id,calls_today from vicidial_live_agents $agent_search_SQL;"; $stmt="select status,callerid,lead_id,campaign_id,calls_today,agent_log_id from vicidial_live_agents $agent_search_SQL;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";} if ($DB) {echo "$stmt\n";}
$agent_to_list = mysql_num_rows($rslt); $agent_to_list = mysql_num_rows($rslt);
@@ -4372,8 +4374,20 @@ if ($function == 'agent_status')
$lead_id = $row[2]; $lead_id = $row[2];
$campaign_id = $row[3]; $campaign_id = $row[3];
$calls_today = $row[4]; $calls_today = $row[4];
$agent_log_id = $row[5];
$pause_code = '';
$output .= "$status$DL$callerid$DL$lead_id$DL$campaign_id$DL$calls_today$DL$full_name$DL$user_group$DL$user_level\n"; $stmt="select sub_status from vicidial_agent_log $agent_search_SQL and agent_log_id='$agent_log_id';";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$agent_to_log = mysql_num_rows($rslt);
if ($agent_to_log > 0)
{
$row=mysql_fetch_row($rslt);
$pause_code = $row[0];
}
$output .= "$status$DL$callerid$DL$lead_id$DL$campaign_id$DL$calls_today$DL$full_name$DL$user_group$DL$user_level$DL$pause_code\n";
echo "$output"; echo "$output";
@@ -4590,7 +4604,7 @@ if ($function == 'add_lead')
if (strlen($rank)<1) {$rank='0';} if (strlen($rank)<1) {$rank='0';}
if (strlen($list_id)<3) {$list_id='999';} if (strlen($list_id)<3) {$list_id='999';}
if (strlen($phone_code)<1) {$phone_code='1';} if (strlen($phone_code)<1) {$phone_code='1';}
if ( ($nanpa_ac_prefix_check == 'Y') or (eregi("NANPA",$tz_method)) ) if ( ($nanpa_ac_prefix_check == 'Y') or (preg_match("/NANPA/i",$tz_method)) )
{ {
$stmt="SELECT count(*) from vicidial_nanpa_prefix_codes;"; $stmt="SELECT count(*) from vicidial_nanpa_prefix_codes;";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -4726,7 +4740,7 @@ if ($function == 'add_lead')
### END checking for DNC if defined ### ### END checking for DNC if defined ###
### START checking for duplicate if defined ### ### START checking for duplicate if defined ###
if (eregi("CAMP",$duplicate_check)) # find lists within campaign if (preg_match("/CAMP/i",$duplicate_check)) # find lists within campaign
{ {
$stmt="SELECT campaign_id from vicidial_lists where list_id='$list_id';"; $stmt="SELECT campaign_id from vicidial_lists where list_id='$list_id';";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -4748,12 +4762,12 @@ if ($function == 'add_lead')
$duplicate_lists .= "'$row[0]',"; $duplicate_lists .= "'$row[0]',";
$L++; $L++;
} }
$duplicate_lists = eregi_replace(",$",'',$duplicate_lists); $duplicate_lists = preg_replace('/,$/i', '',$duplicate_lists);
} }
} }
} }
### find list of list_ids in this campaign ### find list of list_ids in this campaign
if (eregi("DUPLIST",$duplicate_check)) # duplicate check within list if (preg_match("/DUPLIST/i",$duplicate_check)) # duplicate check within list
{ {
if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPLIST\n";} if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPLIST\n";}
$duplicate_found=0; $duplicate_found=0;
@@ -4778,7 +4792,7 @@ if ($function == 'add_lead')
exit; exit;
} }
} }
if (eregi("DUPCAMP",$duplicate_check)) # duplicate check within campaign lists if (preg_match("/DUPCAMP/i",$duplicate_check)) # duplicate check within campaign lists
{ {
if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPCAMP - $duplicate_lists\n";} if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPCAMP - $duplicate_lists\n";}
$duplicate_found=0; $duplicate_found=0;
@@ -4803,7 +4817,7 @@ if ($function == 'add_lead')
exit; exit;
} }
} }
if (eregi("DUPSYS",$duplicate_check)) # duplicate check within entire system if (preg_match("/DUPSYS/i",$duplicate_check)) # duplicate check within entire system
{ {
if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPSYS\n";} if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPSYS\n";}
$duplicate_found=0; $duplicate_found=0;
@@ -4828,7 +4842,7 @@ if ($function == 'add_lead')
exit; exit;
} }
} }
if (eregi("DUPTITLEALTPHONELIST",$duplicate_check)) # duplicate title/alt_phone check within list if (preg_match("/DUPTITLEALTPHONELIST/i",$duplicate_check)) # duplicate title/alt_phone check within list
{ {
if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPTITLEALTPHONELIST\n";} if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPTITLEALTPHONELIST\n";}
$duplicate_found=0; $duplicate_found=0;
@@ -4853,7 +4867,7 @@ if ($function == 'add_lead')
exit; exit;
} }
} }
if (eregi("DUPTITLEALTPHONECAMP",$duplicate_check)) # duplicate title/alt_phone check within campaign lists if (preg_match("/DUPTITLEALTPHONECAMP/i",$duplicate_check)) # duplicate title/alt_phone check within campaign lists
{ {
if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPTITLEALTPHONECAMP\n";} if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPTITLEALTPHONECAMP\n";}
$duplicate_found=0; $duplicate_found=0;
@@ -4878,7 +4892,7 @@ if ($function == 'add_lead')
exit; exit;
} }
} }
if (eregi("DUPTITLEALTPHONESYS",$duplicate_check)) # duplicate title/alt_phone check within entire system if (preg_match("/DUPTITLEALTPHONESYS/i",$duplicate_check)) # duplicate title/alt_phone check within entire system
{ {
if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPTITLEALTPHONESYS\n";} if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPTITLEALTPHONESYS\n";}
$duplicate_found=0; $duplicate_found=0;
@@ -4903,7 +4917,7 @@ if ($function == 'add_lead')
exit; exit;
} }
} }
if (eregi("DUPNAMEPHONELIST",$duplicate_check)) # duplicate name/phone check within list if (preg_match("/DUPNAMEPHONELIST/i",$duplicate_check)) # duplicate name/phone check within list
{ {
if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPNAMEPHONELIST\n";} if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPNAMEPHONELIST\n";}
$duplicate_found=0; $duplicate_found=0;
@@ -4928,7 +4942,7 @@ if ($function == 'add_lead')
exit; exit;
} }
} }
if (eregi("DUPNAMEPHONECAMP",$duplicate_check)) # duplicate name/phone check within campaign lists if (preg_match("/DUPNAMEPHONECAMP/i",$duplicate_check)) # duplicate name/phone check within campaign lists
{ {
if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPNAMEPHONECAMP\n";} if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPNAMEPHONECAMP\n";}
$duplicate_found=0; $duplicate_found=0;
@@ -4953,7 +4967,7 @@ if ($function == 'add_lead')
exit; exit;
} }
} }
if (eregi("DUPNAMEPHONESYS",$duplicate_check)) # duplicate name/phone check within entire system if (preg_match("/DUPNAMEPHONESYS/i",$duplicate_check)) # duplicate name/phone check within entire system
{ {
if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPNAMEPHONESYS\n";} if ($DB>0) {echo "DEBUG: Checking for duplicates - DUPNAMEPHONESYS\n";}
$duplicate_found=0; $duplicate_found=0;
@@ -5366,7 +5380,7 @@ if ($function == 'update_lead')
} }
else else
{ {
if (eregi("CAMPAIGN",$search_location)) # find lists within campaign if (preg_match("/CAMPAIGN/i",$search_location)) # find lists within campaign
{ {
$stmt="SELECT campaign_id from vicidial_lists where list_id='$list_id';"; $stmt="SELECT campaign_id from vicidial_lists where list_id='$list_id';";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -5388,12 +5402,12 @@ if ($function == 'update_lead')
$search_lists .= "'$row[0]',"; $search_lists .= "'$row[0]',";
$L++; $L++;
} }
$search_lists = eregi_replace(",$",'',$search_lists); $search_lists = preg_replace('/,$/i', '',$search_lists);
$search_SQL = "and list_id IN($search_lists)"; $search_SQL = "and list_id IN($search_lists)";
} }
} }
} }
if (eregi("LIST",$search_location)) # search check within list if (preg_match("/LIST/i",$search_location)) # search check within list
{ {
$search_SQL = "and list_id='$list_id'"; $search_SQL = "and list_id='$list_id'";
} }
@@ -6065,7 +6079,7 @@ function lookup_gmt($phone_code,$USarea,$state,$LOCAL_GMT_OFF_STD,$Shour,$Smin,$
require("dbconnect.php"); require("dbconnect.php");
$postalgmt_found=0; $postalgmt_found=0;
if ( (eregi("POSTAL",$tz_method)) && (strlen($postal_code)>4) ) if ( (preg_match("/POSTAL/i",$tz_method)) && (strlen($postal_code)>4) )
{ {
if (preg_match('/^1$/', $phone_code)) if (preg_match('/^1$/', $phone_code))
{ {
@@ -6075,7 +6089,7 @@ if ( (eregi("POSTAL",$tz_method)) && (strlen($postal_code)>4) )
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[3];
$dst_range = $row[4]; $dst_range = $row[4];
$PC_processed++; $PC_processed++;
@@ -6096,7 +6110,7 @@ if ( ($tz_method=="TZCODE") && (strlen($owner)>1) )
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); $gmt_offset = $row[0]; $gmt_offset = preg_replace('/\+/i', '',$gmt_offset);
$PC_processed++; $PC_processed++;
$postalgmt_found++; $postalgmt_found++;
$post++; $post++;
@@ -6112,7 +6126,7 @@ if ( ($tz_method=="TZCODE") && (strlen($owner)>1) )
if (strlen($dst_range)>2) {$dst = 'Y';} if (strlen($dst_range)>2) {$dst = 'Y';}
} }
} }
if ( (eregi("NANPA",$tz_method)) && (strlen($USarea)>2) && (strlen($USprefix)>2) ) if ( (preg_match("/NANPA/i",$tz_method)) && (strlen($USarea)>2) && (strlen($USprefix)>2) )
{ {
$stmt="select GMT_offset,DST from vicidial_nanpa_prefix_codes where areacode='$USarea' and prefix='$USprefix';"; $stmt="select GMT_offset,DST from vicidial_nanpa_prefix_codes where areacode='$USarea' and prefix='$USprefix';";
$rslt=mysql_query($stmt, $link); $rslt=mysql_query($stmt, $link);
@@ -6120,7 +6134,7 @@ if ( (eregi("NANPA",$tz_method)) && (strlen($USarea)>2) && (strlen($USprefix)>2)
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
$gmt_offset = $row[0]; $gmt_offset = eregi_replace("\+","",$gmt_offset); $gmt_offset = $row[0]; $gmt_offset = preg_replace('/\+/i', '',$gmt_offset);
$dst = $row[1]; $dst = $row[1];
$dst_range = ''; $dst_range = '';
if ($dst == 'Y') if ($dst == 'Y')
@@ -6142,7 +6156,7 @@ if ($postalgmt_found < 1)
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[5];
$dst_range = $row[6]; $dst_range = $row[6];
$PC_processed++; $PC_processed++;
@@ -6157,7 +6171,7 @@ if ($postalgmt_found < 1)
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[5];
$dst_range = $row[6]; $dst_range = $row[6];
$PC_processed++; $PC_processed++;
@@ -6172,7 +6186,7 @@ if ($postalgmt_found < 1)
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[5];
$dst_range = $row[6]; $dst_range = $row[6];
$PC_processed++; $PC_processed++;
@@ -6188,7 +6202,7 @@ if ($postalgmt_found < 1)
if ($pc_recs > 0) if ($pc_recs > 0)
{ {
$row=mysql_fetch_row($rslt); $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 = $row[5];
$dst_range = $row[6]; $dst_range = $row[6];
$PC_processed++; $PC_processed++;
+6 -5
View File
@@ -1,7 +1,7 @@
<?php <?php
# phone_stats.php.php # phone_stats.php.php
# #
# Copyright (C) 2012 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2 # Copyright (C) 2013 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# #
# #
# changes: # changes:
@@ -10,6 +10,7 @@
# 60927-1548 - Changed to vicidial_users for authentication # 60927-1548 - Changed to vicidial_users for authentication
# 90508-0644 - Changed to PHP long tags # 90508-0644 - Changed to PHP long tags
# 120223-2135 - Removed logging of good login passwords if webroot writable is enabled # 120223-2135 - Removed logging of good login passwords if webroot writable is enabled
# 130610-1110 - Finalized changing of all ereg instances to preg
# #
require("dbconnect.php"); require("dbconnect.php");
@@ -57,8 +58,8 @@ while ($i < $qm_conf_ct)
##### END SETTINGS LOOKUP ##### ##### END SETTINGS LOOKUP #####
########################################### ###########################################
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$STARTtime = date("U"); $STARTtime = date("U");
$TODAY = date("Y-m-d"); $TODAY = date("Y-m-d");
@@ -163,7 +164,7 @@ echo "<tr><td><font size=2>CHANNEL GROUP </td><td align=right><font size=2>COUNT
$o=0; $o=0;
while ($statuses_to_print > $o) { while ($statuses_to_print > $o) {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o)) if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
@@ -221,7 +222,7 @@ echo "<tr><td><font size=2>NUMBER </td><td><font size=2>CHANNEL GROUP </td><td a
$event_stop_seconds=''; $event_stop_seconds='';
while ($events_to_print > $o) { while ($events_to_print > $o) {
$row=mysql_fetch_row($rslt); $row=mysql_fetch_row($rslt);
if (eregi("1$|3$|5$|7$|9$", $o)) if (preg_match('/1$|3$|5$|7$|9$/i', $o))
{$bgcolor='bgcolor="#B9CBFD"';} {$bgcolor='bgcolor="#B9CBFD"';}
else else
{$bgcolor='bgcolor="#9BB9FB"';} {$bgcolor='bgcolor="#9BB9FB"';}
+13 -12
View File
@@ -22,6 +22,7 @@
# 120223-1917 - Added multi-user-group options # 120223-1917 - Added multi-user-group options
# 121129-2131 - Fixed Choose link position # 121129-2131 - Fixed Choose link position
# 130414-0247 - Added report logging # 130414-0247 - Added report logging
# 130610-0944 - Finalized changing of all ereg instances to preg
# #
$startMS = microtime(); $startMS = microtime();
@@ -240,8 +241,8 @@ $epochTWENTYFOURhoursAGO = ($STARTtime - 86400);
$timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO); $timeTWENTYFOURhoursAGO = date("Y-m-d H:i:s",$epochTWENTYFOURhoursAGO);
$webphone_content=''; $webphone_content='';
$PHP_AUTH_USER = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_USER); $PHP_AUTH_USER = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_USER);
$PHP_AUTH_PW = ereg_replace("[^0-9a-zA-Z]","",$PHP_AUTH_PW); $PHP_AUTH_PW = preg_replace('/[^0-9a-zA-Z]/', '', $PHP_AUTH_PW);
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';"; $stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and pass='$PHP_AUTH_PW' and user_level > 6 and view_reports='1' and active='Y';";
if ($DB) {echo "|$stmt|\n";} if ($DB) {echo "|$stmt|\n";}
@@ -358,7 +359,7 @@ if ($auth)
$LOGadmin_viewable_groupsSQL=''; $LOGadmin_viewable_groupsSQL='';
$valLOGadmin_viewable_groupsSQL=''; $valLOGadmin_viewable_groupsSQL='';
$vmLOGadmin_viewable_groupsSQL=''; $vmLOGadmin_viewable_groupsSQL='';
if ( (!eregi("--ALL--",$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) ) if ( (!preg_match('/\-\-ALL\-\-/i',$LOGadmin_viewable_groups)) and (strlen($LOGadmin_viewable_groups) > 3) )
{ {
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ -/",'',$LOGadmin_viewable_groups);
$rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL); $rawLOGadmin_viewable_groupsSQL = preg_replace("/ /","','",$rawLOGadmin_viewable_groupsSQL);
@@ -451,7 +452,7 @@ while($i < $group_ct)
$i++; $i++;
} }
$group_SQL = eregi_replace(",$",'',$group_SQL); $group_SQL = preg_replace('/,$/i', '',$group_SQL);
$i=0; $i=0;
$user_group_string='|'; $user_group_string='|';
@@ -467,7 +468,7 @@ while($i < $user_group_ct)
$i++; $i++;
} }
$user_group_SQL = eregi_replace(",$",'',$user_group_SQL); $user_group_SQL = preg_replace('/,$/i', '',$user_group_SQL);
### if no campaigns selected, display all ### if no campaigns selected, display all
if ( ($group_ct < 1) or (strlen($group_string) < 2) ) if ( ($group_ct < 1) or (strlen($group_string) < 2) )
@@ -487,14 +488,14 @@ if ( ($user_group_ct < 1) or (strlen($user_group_string) < 2) )
$user_group_none=1; $user_group_none=1;
} }
if ( (ereg("--NONE--",$group_string) ) or ($group_ct < 1) ) if ( (preg_match('/\s\-\-NONE\-\-\s/',$group_string) ) or ($group_ct < 1) )
{ {
$all_active = 0; $all_active = 0;
$group_SQL = "''"; $group_SQL = "''";
$group_SQLand = "and FALSE"; $group_SQLand = "and FALSE";
$group_SQLwhere = "where FALSE"; $group_SQLwhere = "where FALSE";
} }
elseif ( eregi('ALL-ACTIVE',$group_string) ) elseif ( preg_match('/ALL\-ACTIVE/i',$group_string) )
{ {
$all_active = 1; $all_active = 1;
$group_SQL = $allactivecampaigns; $group_SQL = $allactivecampaigns;
@@ -508,14 +509,14 @@ else
$group_SQLwhere = "where campaign_id IN($group_SQL)"; $group_SQLwhere = "where campaign_id IN($group_SQL)";
} }
if ( (ereg("--NONE--",$user_group_string) ) or ($user_group_ct < 1) ) if ( (preg_match('/\s\-\-NONE\-\-\s/',$user_group_string) ) or ($user_group_ct < 1) )
{ {
$all_active_groups = 0; $all_active_groups = 0;
$user_group_SQL = "''"; $user_group_SQL = "''";
# $user_group_SQLand = "and FALSE"; # $user_group_SQLand = "and FALSE";
# $user_group_SQLwhere = "where FALSE"; # $user_group_SQLwhere = "where FALSE";
} }
elseif ( eregi('ALL-GROUPS',$user_group_string) ) elseif ( preg_match('/ALL\-GROUPS/i',$user_group_string) )
{ {
$all_active_groups = 1; $all_active_groups = 1;
# $user_group_SQL = ''; # $user_group_SQL = '';
@@ -559,7 +560,7 @@ $select_list .= "<SELECT SIZE=8 NAME=groups[] ID=groups[] multiple>";
$o=0; $o=0;
while ($groups_to_print > $o) while ($groups_to_print > $o)
{ {
if (ereg("\|$LISTgroups[$o]\|",$group_string)) if (preg_match("/\|$LISTgroups[$o]\|/",$group_string))
{$select_list .= "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTnames[$o]</option>";} {$select_list .= "<option selected value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTnames[$o]</option>";}
else else
{$select_list .= "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTnames[$o]</option>";} {$select_list .= "<option value=\"$LISTgroups[$o]\">$LISTgroups[$o] - $LISTnames[$o]</option>";}
@@ -573,7 +574,7 @@ $select_list .= "<SELECT SIZE=8 NAME=user_group_filter[] ID=user_group_filter[]
$o=0; $o=0;
while ($o < $usergroups_to_print) while ($o < $usergroups_to_print)
{ {
if (ereg("\|$usergroups[$o]\|",$user_group_string)) if (preg_match("/\|$usergroups[$o]\|/",$user_group_string))
{$select_list .= "<option selected value=\"$usergroups[$o]\">$usergroups[$o] - $usergroupnames[$o]</option>";} {$select_list .= "<option selected value=\"$usergroups[$o]\">$usergroups[$o] - $usergroupnames[$o]</option>";}
else else
{ {
@@ -1480,7 +1481,7 @@ echo "<span style=\"position:absolute;left:10px;top:120px;z-index:14;\" id=agent
echo " &nbsp; "; echo " &nbsp; ";
echo "</span>\n"; echo "</span>\n";
echo "<a href=\"#\" onclick=\"update_variables('form_submit','','YES')\">RELOAD NOW</a>"; echo "<a href=\"#\" onclick=\"update_variables('form_submit','','YES')\">RELOAD NOW</a>";
if (eregi('ALL-ACTIVE',$group_string)) if (preg_match('/ALL\-ACTIVE/i',$group_string))
{echo " &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=10\">MODIFY</a> | \n";} {echo " &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=10\">MODIFY</a> | \n";}
else else
{echo " &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | \n";} {echo " &nbsp; &nbsp; &nbsp; <a href=\"./admin.php?ADD=34&campaign_id=$group\">MODIFY</a> | \n";}

Some files were not shown because too many files have changed in this diff Show More