Fixes for PHP8, 2026 date change

git-svn-id: svn://192.168.202.10@3960 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2026-01-06 19:53:30 +00:00
parent 3c54f4d646
commit 5e2c15363f
3 changed files with 45 additions and 21 deletions
+16 -7
View File
@@ -1,7 +1,7 @@
<?php
# vicidial.php - the web-based version of the astVICIDIAL client application
#
# Copyright (C) 2025 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# Other scripts that this application depends on:
# - vdc_db_query.php: Updates information in the database
@@ -753,10 +753,11 @@
# 251002-1353 - Added call_count_limit_restrict campaign option
# 251020-0849 - Added code for recording_dtmf_muting, fix for Stereo Call Recording
# 251124-0936 - Added lead status display for callbacks list
# 260106-1418 - Fixes for PHP8
#
$version = '2.14-719c';
$build = '251124-0936';
$version = '2.14-720c';
$build = '260106-1418';
$php_script = 'vicidial.php';
$mel=1; # Mysql Error Log enabled = 1
$mysql_log_count=108;
@@ -861,6 +862,8 @@ $JS_date = $StarTtimE."000"; # milliseconds since epoch or "16,3,31,8,56,1,0"
$webphone_width = 460;
$webphone_height = 500;
$VUselected_language = '';
$session_name='';
$server_ip='';
$random = (rand(1000000, 9999999) + 10000000);
@@ -1840,7 +1843,7 @@ else
{
$subhead_font = "style=\"font-family:HELVETICA;font-size:14;color:BLACK;font-weight:bold;\"";
echo "<img src=\"images/2FA_icon.png\" alt=\"Two-Factor-Authentication\" width=42 height=42> <FONT FACE=\"ARIAL,HELVETICA\" SIZE=4><B> "._QXZ("Two-Factor-Authentication"),"</B></FONT><BR><CENTER>\n";
echo "<img src=\"images/2FA_icon.png\" alt=\"Two-Factor-Authentication\" width=42 height=42> <FONT FACE=\"ARIAL,HELVETICA\" SIZE=4><B> "._QXZ("Two-Factor-Authentication")."</B></FONT><BR><CENTER>\n";
if ( ($SStwo_factor_auth_hours < 1) or ($SStwo_factor_container == '') or ($SStwo_factor_container == '---DISABLED---') )
{
@@ -1862,10 +1865,16 @@ else
# first character and last 6 characters
$temp_emailARY = explode('@',$OBSCUREemail);
$field_temp_val = $temp_emailARY[0];
$OBSCUREemail = substr($field_temp_val,0,2) . str_repeat(".", (strlen($field_temp_val) - 2)) . '@' . $temp_emailARY[1];
if (strlen($field_temp_val) > 1)
{$OBSCUREemail = substr($field_temp_val,0,2) . str_repeat(".", (strlen($field_temp_val) - 2)) . '@' . $temp_emailARY[1];}
else
{$OBSCUREemail = '<'._QXZ("none").'>';}
# first 3 digits and last 2 digits
$field_temp_val = $OBSCUREmobile_number;
$OBSCUREmobile_number = substr($field_temp_val,0,3) . str_repeat("x", (strlen($field_temp_val) - 5)) . substr($field_temp_val,-2,2);
if (strlen($field_temp_val) > 1)
{$OBSCUREmobile_number = substr($field_temp_val,0,3) . str_repeat("x", (strlen($field_temp_val) - 5)) . substr($field_temp_val,-2,2);}
else
{$OBSCUREmobile_number = '<'._QXZ("none").'>';}
### BEGIN Gather 2FA settings container details ###
$valid_2FA_config=0;
@@ -1898,7 +1907,7 @@ else
$two_factor_settings = explode("\n",$TFAcontainer_entry);
$two_factor_settings_ct = count($two_factor_settings);
$tfal=0;
while ($two_factor_settings_ct >= $tfal)
while ($two_factor_settings_ct > $tfal)
{
if (preg_match("/^auth_code_expire_minutes=>/",$two_factor_settings[$tfal]))
{
@@ -1,7 +1,7 @@
<?php
# AST_carrier_log_report.php
#
# Copyright (C) 2024 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2025 Joe Johnson, Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 120331-2301 - First build
@@ -22,6 +22,7 @@
# 220302-1813 - Added allow_web_debug system setting
# 220812-0940 - Added User Group report permissions checking
# 240801-1130 - Code updates for PHP8 compatibility
# 260103-1900 - Small fix for missing variables in links
#
$startMS = microtime();
@@ -814,7 +815,7 @@ if ($SUBMIT && $server_ip_ct>0) {
if (!$lower_limit) {$lower_limit=1;}
if ($lower_limit+999>=mysqli_num_rows($rpt_rslt)) {$upper_limit=($lower_limit+mysqli_num_rows($rpt_rslt)%1000)-1;} else {$upper_limit=$lower_limit+999;}
$TEXT.="--- "._QXZ("CARRIER LOG RECORDS FOR")." $query_date, $query_date_D "._QXZ("TO")." $query_date_T $server_rpt_string, $HC_rpt_string, $DS_rpt_string\n --- "._QXZ("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\">["._QXZ("DOWNLOAD")."]</a>\n";
$TEXT.="--- "._QXZ("CARRIER LOG RECORDS FOR")." $query_date, $query_date_D "._QXZ("TO")." $query_date_T $server_rpt_string, $HC_rpt_string, $DS_rpt_string\n --- "._QXZ("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$hangup_causeQS$sip_hangup_causeQS$dial_statusQS&lower_limit=$lower_limit&upper_limit=$upper_limit&file_download=1\">["._QXZ("DOWNLOAD")."]</a>\n";
$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+--------------+-----------+---------------+--------------+--------------+--------------------------------+\n";
$carrier_rpt.="| "._QXZ("UNIQUE ID",20)." | "._QXZ("CALL DATE",19)." | "._QXZ("SERVER IP",15)." | "._QXZ("LEAD ID",9)." | "._QXZ("HANGUP CAUSE",12)." | "._QXZ("DIAL STATUS",11)." | "._QXZ("CHANNEL",40)." | "._QXZ("CALLER ID",12)." | "._QXZ("DIAL TIME",9)." | "._QXZ("ANSWERED TIME",13)." | "._QXZ("PHONE NUMBER",12)." | "._QXZ("SIP RESPONSE",12)." | "._QXZ("SIP REASON",30)." |\n";
$carrier_rpt.="+----------------------+---------------------+-----------------+-----------+--------------+-------------+------------------------------------------+--------------+-----------+---------------+--------------+--------------+--------------------------------+\n";
@@ -823,7 +824,7 @@ if ($SUBMIT && $server_ip_ct>0) {
$HTML.="<table border='0' cellpadding='3' cellspacing='1'>";
$HTML.="<tr bgcolor='#".$SSstd_row1_background."'>";
$HTML.="<th colspan='11'><font size='2'>"._QXZ("CARRIER LOG RECORDS FOR")." $query_date, $query_date_D "._QXZ("TO")." $query_date_T $server_rpt_string, $HC_rpt_string, $DS_rpt_string\n --- "._QXZ("RECORDS")." #$lower_limit-$upper_limit</font></th>";
$HTML.="<th colspan='2'><font size='2'><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\">["._QXZ("DOWNLOAD")."]</a></font></th>";
$HTML.="<th colspan='2'><font size='2'><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$hangup_causeQS$sip_hangup_causeQS$dial_statusQS&lower_limit=$lower_limit&upper_limit=$upper_limit&file_download=1\">["._QXZ("DOWNLOAD")."]</a></font></th>";
$HTML.="</tr>\n";
$HTML.="<tr bgcolor='#".$SSstd_row1_background."'>";
$HTML.="<th><font size='2'>"._QXZ("UNIQUE ID")."</font></th>";
+25 -11
View File
@@ -1,7 +1,7 @@
<?php
# admin.php - VICIDIAL administration page
#
# Copyright (C) 2025 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2026 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
$startMS = microtime();
@@ -6304,12 +6304,13 @@ if ($SSscript_remove_js > 0)
# 251112-2201 - Added alter_cid_name DID option
# 251204-0757 - Added SERVER DRIVE PARTITIONS display
# 251211-1134 - Added ADAPT_PERCENTMAX dial_method and adaptive_percentmax_percentage campaign setting
# 260106-1438 - Fixes for PHP8, 2026 date change
#
# make sure you have added a user to the vicidial_users MySQL table with at least user_level 9 to access this page the first time
$admin_version = '2.14-950a';
$build = '251211-1134';
$admin_version = '2.14-951a';
$build = '260106-1438';
$STARTtime = date("U");
$SQLdate = date("Y-m-d H:i:s");
@@ -6384,7 +6385,7 @@ if ($force_logout)
echo "<head>\n";
echo "<!-- Logout screen $PHP_SELF -->\n";
echo "<META NAME=\"ROBOTS\" CONTENT=\"NONE\">\n";
echo "<META NAME=\"COPYRIGHT\" CONTENT=\"&copy; 2025 ViciDial Group\">\n";
echo "<META NAME=\"COPYRIGHT\" CONTENT=\"&copy; 2026 ViciDial Group\">\n";
echo "<META NAME=\"AUTHOR\" CONTENT=\"ViciDial Group\">\n";
?>
<script type="text/javascript">
@@ -6925,7 +6926,7 @@ echo "<html>\n";
echo "<head>\n";
echo "<!-- VERSION: $admin_version BUILD: $build ADD: $ADD PHP_SELF: $PHP_SELF-->\n";
echo "<META NAME=\"ROBOTS\" CONTENT=\"NONE\">\n";
echo "<META NAME=\"COPYRIGHT\" CONTENT=\"&copy; 2025 ViciDial Group\">\n";
echo "<META NAME=\"COPYRIGHT\" CONTENT=\"&copy; 2026 ViciDial Group\">\n";
echo "<META NAME=\"AUTHOR\" CONTENT=\"ViciDial Group\">\n";
echo "<script language=\"JavaScript\" src=\"calendar_db.js\"></script>\n";
echo "<script language=\"JavaScript\" src=\"help.js\"></script>\n";
@@ -50909,7 +50910,7 @@ if ($ADD==99999701)
{
$subhead_font = "style=\"font-family:HELVETICA;font-size:14;color:BLACK;font-weight:bold;\"";
echo "<img src=\"images/2FA_icon.png\" alt=\"Two-Factor-Authentication\" width=42 height=42> <FONT FACE=\"ARIAL,HELVETICA\" SIZE=4><B> "._QXZ("Two-Factor-Authentication"),"</B></FONT><BR><CENTER>\n";
echo "<img src=\"images/2FA_icon.png\" alt=\"Two-Factor-Authentication\" width=42 height=42> <FONT FACE=\"ARIAL,HELVETICA\" SIZE=4><B> "._QXZ("Two-Factor-Authentication")."</B></FONT><BR><CENTER>\n";
if ( ($SStwo_factor_auth_hours < 1) or ($SStwo_factor_container == '') or ($SStwo_factor_container == '---DISABLED---') )
{
@@ -50923,10 +50924,18 @@ if ($ADD==99999701)
# first character and last 6 characters
$temp_emailARY = explode('@',$OBSCUREemail);
$field_temp_val = $temp_emailARY[0];
$OBSCUREemail = substr($field_temp_val,0,2) . str_repeat(".", (strlen($field_temp_val) - 2)) . '@' . $temp_emailARY[1];
if (is_null($field_temp_val)) {$field_temp_val='';}
if (strlen($field_temp_val) > 1)
{$OBSCUREemail = substr($field_temp_val,0,2) . str_repeat(".", (strlen($field_temp_val) - 2)) . '@' . $temp_emailARY[1];}
else
{$OBSCUREemail = '<'._QXZ("none").'>';}
# first 3 digits and last 2 digits
$field_temp_val = $OBSCUREmobile_number;
$OBSCUREmobile_number = substr($field_temp_val,0,3) . str_repeat("x", (strlen($field_temp_val) - 5)) . substr($field_temp_val,-2,2);
if (is_null($field_temp_val)) {$field_temp_val='';}
if (strlen($field_temp_val) > 1)
{$OBSCUREmobile_number = substr($field_temp_val,0,3) . str_repeat("x", (strlen($field_temp_val) - 5)) . substr($field_temp_val,-2,2);}
else
{$OBSCUREmobile_number = '<'._QXZ("none").'>';}
### BEGIN Gather 2FA settings container details ###
$valid_2FA_config=0;
@@ -50959,7 +50968,7 @@ if ($ADD==99999701)
$two_factor_settings = explode("\n",$TFAcontainer_entry);
$two_factor_settings_ct = count($two_factor_settings);
$tfal=0;
while ($two_factor_settings_ct >= $tfal)
while ($two_factor_settings_ct > $tfal)
{
if (preg_match("/^auth_code_expire_minutes=>/",$two_factor_settings[$tfal]))
{
@@ -51052,6 +51061,8 @@ if ($ADD==99999701)
echo "<BR><b>"._QXZ("Two-Factor-Authentication is not properly configured on your system. Please contact your system administrator")." <BR><BR>$valid_2FA_config|$SStwo_factor_auth_hours|$SStwo_factor_container</b><BR>\n";
exit;
}
if (is_null($LOGemail)) {$LOGemail='';}
if (is_null($LOGmobile_number)) {$LOGmobile_number='';}
if ( (strlen($LOGemail) < 4) and (strlen($LOGmobile_number) < 2) )
{
echo _QXZ("Your User account is not configured for Two-Factor-Authentication. Please contact your system administrator. (no email or mobile number)").".\n";
@@ -51063,6 +51074,7 @@ if ($ADD==99999701)
{
$auth_fail=0;
echo "<br><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=3>";
if (is_null($rank)) {$rank='';}
if (strlen($rank) < 2)
{
echo _QXZ("Please go back and enter a valid authorization code")." |1|" . strlen($rank) . "|"; $auth_fail++;
@@ -51186,6 +51198,8 @@ if ($ADD==99999701)
### Send auth code by PHONE
if ($stage == 'PHONE')
{
if (is_null($ext_context)) {$ext_context='';}
if (is_null($phone_message_override)) {$phone_message_override='';}
$context_2FA = '2FA_say_auth_code';
if (strlen($phone_message_override) > 0) {$context_2FA = $phone_message_override;}
if (strlen($ext_context) < 1) {$ext_context='default';}
@@ -51558,7 +51572,7 @@ if ($ADD==999995)
echo "<br><B> "._QXZ("Welcome to ViciDial: copyright, trademark and license page")."</B><BR><BR>\n";
echo "<center><TABLE width=$section_width cellspacing=5 cellpadding=2>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right valign=top><B><font size=3>"._QXZ("Copyright").": </B></td><td align=left> &nbsp; "._QXZ("The ViciDial Contact Center Suite is maintained by the")." <a href=\"http://www.vicidial.com/\" target=\"_blank\">ViciDial Group</a>, &copy; 2025</td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right valign=top><B><font size=3>"._QXZ("Copyright").": </B></td><td align=left> &nbsp; "._QXZ("The ViciDial Contact Center Suite is maintained by the")." <a href=\"http://www.vicidial.com/\" target=\"_blank\">ViciDial Group</a>, &copy; 2026</td></tr>\n";
echo "<tr bgcolor=#$SSstd_row4_background><td align=right valign=top><B><font size=3>"._QXZ("Trademark").": </B></td><td align=left> &nbsp; \"VICIDIAL\" "._QXZ("is a registered trademark of the")." <a href=\"http://www.vicidial.com/\" target=\"_blank\">ViciDial Group</a>. Here is our <a href=\"http://www.vicidial.com/?page_id=262\" target=\"_blank\">"._QXZ("trademark use policy")."</a></td></tr>\n";
@@ -53037,7 +53051,7 @@ echo "<FONT STYLE=\"font-family:HELVETICA;font-size:9;color:white;\"><br><br><!-
echo _QXZ("VERSION").": $admin_version<BR>";
echo _QXZ("BUILD").": $build\n";
if (!preg_match("/_BUILD_/",$SShosted_settings))
{echo "<BR><a href=\"$PHP_SELF?ADD=999995\"><font color=white>&copy; 2025 ViciDial Group</font></a><BR><img src=\"images/pixel.gif\">";}
{echo "<BR><a href=\"$PHP_SELF?ADD=999995\"><font color=white>&copy; 2026 ViciDial Group</font></a><BR><img src=\"images/pixel.gif\">";}
echo "</FONT>\n";
?>