Files
ViciDialSVN/agc_2-X/trunk/www/vicidial/AST_email_log_display.php
T
mattf 9884e2ce4d 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
2013-06-15 16:08:13 +00:00

88 lines
2.9 KiB
PHP

<?php
# AST_email_log_display - VICIDIAL administration page
#
# Copyright (C) 2013 Joe Johnson <freewermadmin@gmail.com> LICENSE: AGPLv2
#
# This page displays emails from the log
#
# changes:
# 130221-2124 - First build
# 130610-1039 - Finalized changing of all ereg instances to preg
#
require("dbconnect.php");
require("functions.php");
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
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"];}
if (isset($_GET["email_log_id"])) {$email_log_id=$_GET["email_log_id"];}
elseif (isset($_POST["email_log_id"])) {$email_log_id=$_POST["email_log_id"];}
header ("Content-type: text/html; charset=utf-8");
header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header ("Pragma: no-cache"); // HTTP/1.0
#############################################
##### START SYSTEM_SETTINGS LOOKUP #####
$stmt = "SELECT use_non_latin,timeclock_end_of_day,agentonly_callback_campaign_lock,custom_fields_enabled,allow_emails FROM system_settings;";
$rslt=mysql_query($stmt, $link);
if ($DB) {echo "$stmt\n";}
$qm_conf_ct = mysql_num_rows($rslt);
if ($qm_conf_ct > 0)
{
$row=mysql_fetch_row($rslt);
$non_latin = $row[0];
$timeclock_end_of_day = $row[1];
$agentonly_callback_campaign_lock = $row[2];
$custom_fields_enabled = $row[3];
$allow_emails = $row[4];
}
##### END SETTINGS LOOKUP #####
###########################################
if ($allow_emails<1)
{
echo "Your system does not have the email setting enabled\n";
exit;
}
if ($non_latin < 1)
{
$user=preg_replace('/[^-_0-9a-zA-Z]/', '',$user);
$pass=preg_replace('/[^-_0-9a-zA-Z]/', '',$pass);
}
else
{
$user = preg_replace("/'|\"|\\\\|;/","",$user);
$pass = preg_replace("/'|\"|\\\\|;/","",$pass);
}
if ($email_log_id) {
$stmt="select * from vicidial_email_log where email_log_id='$email_log_id'";
$rslt=mysql_query($stmt, $link);
} else if ($email_row_id) {
$stmt="select * from vicidial_email_list where email_row_id='$email_row_id'";
$rslt=mysql_query($stmt, $link);
}
if (mysql_num_rows($rslt)>0) {
$row=mysql_fetch_array($rslt);
$row["message"]=preg_replace('/\r|\n/', "<BR/>", $row["message"]);
$EMAIL_form="<TABLE cellspacing=2 cellpadding=2 bgcolor='#CCCCCC' width='500'>\n";
$EMAIL_form.="<tr bgcolor=white><td align='right' valign='top' width='100'>Date sent:</td><td align='left' valign='top' width='400'>$row[email_date]</td></tr>\n";
$EMAIL_form.="<tr bgcolor=white><td align='right' valign='top' width='100'>Message:</td><td align='left' valign='top' width='400'>$row[message]</td></tr>\n";
$EMAIL_form.="</table>";
}
?>
<html>
<head>
<title>VICIDIAL email frame</title>
</head>
<body topmargin=0 leftmargin=0>
<?php echo $EMAIL_form; ?>
</body>
</html>