Added more "XDAY" options to add_lead duplicate checks in the Non-Agent API
Added more failed login details for level 9 users to User Modify page Added User Logins Report Added webserver/URL logins section to User Stats report for level 9 users Added more failed login logging in user_authorization function.php scripts Added more failed login reason messages display to timeclock.php Added vicidial_user_logins_daily TEOD population to ADMIN keepalive script git-svn-id: svn://192.168.202.10@3642 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
@@ -156,9 +156,10 @@
|
||||
# 220310-0959 - Added purging of vicidial_sync_log table
|
||||
# 220312-0819 - Added CID Group Auto-Rotate to check for List use
|
||||
# 220526-1444 - Fix for CID auto-rotate functions
|
||||
# 220921-1255 - Added vicidial_user_logins_daily TEOD population
|
||||
#
|
||||
|
||||
$build = '220526-1444';
|
||||
$build = '220921-1255';
|
||||
|
||||
$DB=0; # Debug flag
|
||||
$teodDB=0; # flag to log Timeclock End of Day processes to log file
|
||||
@@ -1668,6 +1669,32 @@ if ($timeclock_end_of_day_NOW > 0)
|
||||
if (!$Q) {print "$sthArows vicidial_inbound_groups rows closing_time_now_trigger value reset \n";}
|
||||
if ($teodDB) {$event_string = "$sthArows vicidial_inbound_groups rows closing_time_now_trigger value reset"; &teod_logger;}
|
||||
|
||||
# population of vicidial_user_logins_daily table and reset of vicidial_users table
|
||||
if (!$Q) {print "\nProcessing vicidial_user_logins_daily/vicidial_users tables...\n";}
|
||||
$stmtA = "INSERT IGNORE INTO vicidial_user_logins_daily(user,login_day,last_login_date,last_ip,failed_login_attempts_today,failed_login_count_today,failed_last_ip_today,failed_last_type_today) SELECT user,'$today_date',last_login_date,last_ip,failed_login_attempts_today,failed_login_count_today,failed_last_ip_today,failed_last_type_today from vicidial_users where last_login_date >= \"$RMSQLdate\";";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows = $sthA->rows;
|
||||
$event_string = "$sthArows rows inserted into vicidial_user_logins_daily table";
|
||||
if (!$Q) {print "$event_string \n";}
|
||||
if ($teodDB) {&teod_logger;}
|
||||
|
||||
$rv = $sthA->err();
|
||||
if (!$rv)
|
||||
{
|
||||
$stmtA = "UPDATE vicidial_users SET failed_login_attempts_today=0,failed_login_count_today=0,failed_last_ip_today='',failed_last_type_today='';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows = $sthA->rows;
|
||||
$event_string = "$sthArows rows reset in vicidial_users table";
|
||||
if (!$Q) {print "$event_string \n";}
|
||||
if ($teodDB) {&teod_logger;}
|
||||
|
||||
$stmtA = "optimize table vicidial_users;";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
}
|
||||
|
||||
##### BEGIN max stats end of day process #####
|
||||
# set OPEN max stats records to CLOSING for processing
|
||||
$stmtA = "UPDATE vicidial_daily_max_stats SET stats_flag='CLOSING' where stats_flag='OPEN';";
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# !!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!
|
||||
# THIS SCRIPT SHOULD ONLY BE RUN ON ONE SERVER ON YOUR CLUSTER
|
||||
#
|
||||
# Copyright (C) 2019 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 60717-1214 - changed to DBI by Marin Blu
|
||||
@@ -30,6 +30,7 @@
|
||||
# 190222-1321 - Added optional flushing of vicidial_sessions_recent table
|
||||
# 190503-1606 - Added flushing of vicidial_sip_event_recent table
|
||||
# 191029-1555 - Added flushing of vicidial_agent_vmm_overrides table
|
||||
# 220921-1148 - Added optimize of vicidial_users table
|
||||
#
|
||||
|
||||
$session_flush=0;
|
||||
@@ -457,6 +458,20 @@ if (!$T)
|
||||
if (!$Q) {print " - OPTIMIZE vicidial_inbound_groups \n";}
|
||||
|
||||
|
||||
$stmtA = "OPTIMIZE table vicidial_users;";
|
||||
if($DB){print STDERR "\n|$stmtA|\n";}
|
||||
if (!$T)
|
||||
{
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
$sthA->execute or die "executing: $stmtA ", $dbhA->errstr;
|
||||
$sthArows=$sthA->rows;
|
||||
@aryA = $sthA->fetchrow_array;
|
||||
if (!$Q) {print "|",$aryA[0],"|",$aryA[1],"|",$aryA[2],"|",$aryA[3],"|","\n";}
|
||||
$sthA->finish();
|
||||
}
|
||||
if (!$Q) {print " - OPTIMIZE vicidial_users \n";}
|
||||
|
||||
|
||||
### Gather active servers from the database
|
||||
$stmtA = "SELECT server_ip,server_id FROM servers where active='Y' and active_asterisk_server='Y';";
|
||||
$sthA = $dbhA->prepare($stmtA) or die "preparing: ",$dbhA->errstr;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2022-09-02
|
||||
NON-AGENT API DOCUMENT Started: 2008-07-24 Updated: 2022-09-20
|
||||
|
||||
This document describes the functions of an API(Application Programming
|
||||
Interface) for all functions NOT directly relating to the VICIDIAL Agent screen.
|
||||
@@ -203,6 +203,7 @@ Changes:
|
||||
220307-0937 - Added 'update_presets' function
|
||||
220310-0825 - Added DELETE action to the 'update_presets' function
|
||||
220902-0823 - Added dial_status_add/dial_status_remove options to update_campaign function
|
||||
220920-0814 - Added more "XDAY" options to add_lead duplicate checks
|
||||
|
||||
|
||||
API Functions use the 'function' variable
|
||||
@@ -1009,7 +1010,7 @@ duplicate_check - Check for duplicate records in the system, can select more tha
|
||||
DUPNAMEPHONELIST - check for duplicate first_name, last_name and phone_number in same list
|
||||
DUPNAMEPHONECAMP - check for duplicate first_name, last_name and phone_number in all lists for this list's campaign
|
||||
DUPNAMEPHONESYS - check for duplicate first_name, last_name and phone_number in entire system
|
||||
" 30/60/90/180/360DAY - Added to one of the above duplicate checks(i.e. "DUPSYS90DAY"), only checks leads loaded in last 90 days
|
||||
" 1/2/3/7/14/15/21/28/30/60/90/180/360DAY - Added to one of the above duplicate checks(i.e. "DUPSYS90DAY"), only checks leads loaded in last 90 days
|
||||
usacan_prefix_check - Y or N, default is N. Check for a valid 4th digit for USA and Canada phone numbers (cannot be 0 or 1)
|
||||
usacan_areacode_check - Y or N, default is N. Check for a valid areacode for USA and Canada phone numbers(also checks for 10-digit length)
|
||||
nanpa_ac_prefix_check - Y or N, default is N. Check for a valid NANPA areacode and prefix, if optional NANPA data is on the system
|
||||
|
||||
@@ -696,7 +696,11 @@ two_factor_override ENUM('NOT_ACTIVE','ENABLED','DISABLED') default 'NOT_ACTIVE
|
||||
manual_dial_filter VARCHAR(50) default 'DISABLED',
|
||||
user_location VARCHAR(100) default '',
|
||||
download_invalid_files ENUM('0','1') default '0',
|
||||
user_group_two VARCHAR(20) default ''
|
||||
user_group_two VARCHAR(20) default '',
|
||||
failed_login_attempts_today MEDIUMINT(8) UNSIGNED default '0',
|
||||
failed_login_count_today SMALLINT(6) UNSIGNED default '0',
|
||||
failed_last_ip_today VARCHAR(50) default '',
|
||||
failed_last_type_today VARCHAR(20) default ''
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE UNIQUE INDEX user ON vicidial_users (user);
|
||||
@@ -4795,6 +4799,18 @@ CREATE TABLE `wallboard_reports` (
|
||||
PRIMARY KEY (`wallboard_report_id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
|
||||
|
||||
CREATE TABLE vicidial_user_logins_daily (
|
||||
user VARCHAR(20),
|
||||
login_day DATE,
|
||||
last_login_date DATETIME default '2001-01-01 00:00:01',
|
||||
last_ip VARCHAR(50) default '',
|
||||
failed_login_attempts_today MEDIUMINT(8) UNSIGNED default '0',
|
||||
failed_login_count_today SMALLINT(6) UNSIGNED default '0',
|
||||
failed_last_ip_today VARCHAR(50) default '',
|
||||
failed_last_type_today VARCHAR(20) default '',
|
||||
index (user)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
|
||||
ALTER TABLE vicidial_email_list MODIFY message text character set utf8;
|
||||
|
||||
@@ -4936,6 +4952,7 @@ CREATE INDEX comment_a on live_inbound_log (comment_a);
|
||||
CREATE UNIQUE INDEX vicidial_campaign_statuses_key on vicidial_campaign_statuses(status, campaign_id);
|
||||
CREATE INDEX vlecc on vicidial_log_extended (caller_code);
|
||||
CREATE UNIQUE INDEX vvmmcount on vicidial_vmm_counts (lead_id,call_date);
|
||||
CREATE UNIQUE INDEX vicidial_user_logins_daily_user on vicidial_user_logins_daily(login_day, user);
|
||||
|
||||
CREATE INDEX vlali on vicidial_live_agents (lead_id);
|
||||
CREATE INDEX vlaus on vicidial_live_agents (user);
|
||||
@@ -5149,4 +5166,4 @@ INSERT INTO `wallboard_reports` VALUES ('AGENTS_AND_QUEUES','Agents and Queues',
|
||||
|
||||
UPDATE system_settings set vdc_agent_api_active='1';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1666',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
UPDATE system_settings SET db_schema_version='1667',db_schema_update_date=NOW(),reload_timestamp=NOW();
|
||||
|
||||
@@ -2018,3 +2018,24 @@ ALTER TABLE vicidial_user_groups ADD script_id VARCHAR(20) default '';
|
||||
ALTER TABLE vicidial_campaigns ADD user_group_script ENUM('DISABLED','ENABLED') default 'DISABLED';
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1666',db_schema_update_date=NOW() where db_schema_version < 1666;
|
||||
|
||||
ALTER TABLE vicidial_users ADD failed_login_attempts_today MEDIUMINT(8) UNSIGNED default '0';
|
||||
ALTER TABLE vicidial_users ADD failed_login_count_today SMALLINT(6) UNSIGNED default '0';
|
||||
ALTER TABLE vicidial_users ADD failed_last_ip_today VARCHAR(50) default '';
|
||||
ALTER TABLE vicidial_users ADD failed_last_type_today VARCHAR(20) default '';
|
||||
|
||||
CREATE TABLE vicidial_user_logins_daily (
|
||||
user VARCHAR(20),
|
||||
login_day DATE,
|
||||
last_login_date DATETIME default '2001-01-01 00:00:01',
|
||||
last_ip VARCHAR(50) default '',
|
||||
failed_login_attempts_today MEDIUMINT(8) UNSIGNED default '0',
|
||||
failed_login_count_today SMALLINT(6) UNSIGNED default '0',
|
||||
failed_last_ip_today VARCHAR(50) default '',
|
||||
failed_last_type_today VARCHAR(20) default '',
|
||||
index (user)
|
||||
) ENGINE=MyISAM;
|
||||
|
||||
CREATE UNIQUE INDEX vicidial_user_logins_daily_user on vicidial_user_logins_daily(login_day, user);
|
||||
|
||||
UPDATE system_settings SET db_schema_version='1667',db_schema_update_date=NOW() where db_schema_version < 1667;
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
# 210406-1740 - Moved 'dialable_leads' function to this script
|
||||
# 210615-0952 - Default security fix, CVE-2021-28854
|
||||
# 220827-1943 - VERM version
|
||||
# 220921-1224 - Added more failed login logging in user_authorization function
|
||||
#
|
||||
|
||||
##### BEGIN validate user login credentials, check for failed lock out #####
|
||||
@@ -121,18 +122,22 @@ function user_authorization($user,$pass,$user_option,$user_update,$api_call)
|
||||
|
||||
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';";
|
||||
$stmt="UPDATE vicidial_users set failed_login_count=(failed_login_count+1),failed_login_attempts_today=(failed_login_attempts_today+1),failed_login_count_today=(failed_login_count_today+1),failed_last_ip_today='$ip',failed_last_type_today='vBAD' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
}
|
||||
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';";
|
||||
$stmt="UPDATE vicidial_users set last_login_date=NOW(),failed_login_count=1,failed_last_ip_today='$ip',failed_login_attempts_today=(failed_login_attempts_today+1),failed_login_count_today=(failed_login_count_today+1),failed_last_type_today='vBAD' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
}
|
||||
else
|
||||
{$auth_key='LOCK';}
|
||||
{
|
||||
$auth_key='LOCK';
|
||||
$stmt="UPDATE vicidial_users set failed_login_attempts_today=(failed_login_attempts_today+1),failed_last_type_today='vLOCK' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($SSwebroot_writable > 0)
|
||||
@@ -257,6 +262,11 @@ function user_authorization($user,$pass,$user_option,$user_update,$api_call)
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="UPDATE vicidial_users set failed_login_attempts_today=(failed_login_attempts_today+1),failed_last_type_today='v$auth_key' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
}
|
||||
}
|
||||
return $auth_key;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
# functions for agent scripts
|
||||
#
|
||||
# Copyright (C) 2021 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
#
|
||||
# CHANGES:
|
||||
@@ -56,9 +56,10 @@
|
||||
# 210404-0902 - Added function to refresh a single field
|
||||
# 210603-1616 - Fix for specific custom field values with a slash in them
|
||||
# 210615-1032 - Default security fixes, CVE-2021-28854
|
||||
# 220921-1204 - Added more failed login logging in user_authorization function
|
||||
#
|
||||
|
||||
# $mysql_queries = 26
|
||||
# $mysql_queries = 28
|
||||
|
||||
##### BEGIN validate user login credentials, check for failed lock out #####
|
||||
function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$return_hash,$api_call,$source)
|
||||
@@ -138,7 +139,7 @@ function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$retur
|
||||
|
||||
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';";
|
||||
$stmt="UPDATE vicidial_users set failed_login_count=(failed_login_count+1),failed_login_attempts_today=(failed_login_attempts_today+1),failed_login_count_today=(failed_login_count_today+1),failed_last_ip_today='$ip',failed_last_type_today='cBAD' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05011',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
@@ -146,12 +147,17 @@ function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$retur
|
||||
{
|
||||
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';";
|
||||
$stmt="UPDATE vicidial_users set last_login_date=NOW(),failed_login_count=1,failed_last_ip_today='$ip',failed_login_attempts_today=(failed_login_attempts_today+1),failed_login_count_today=(failed_login_count_today+1),failed_last_type_today='cBAD' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($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';}
|
||||
{
|
||||
$auth_key='LOCK';
|
||||
$stmt="UPDATE vicidial_users set failed_login_attempts_today=(failed_login_attempts_today+1),failed_last_type_today='cLOCK' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05027',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($SSwebroot_writable > 0)
|
||||
@@ -322,6 +328,12 @@ function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$retur
|
||||
if ( ($return_hash == '1') and ($SSpass_hash_enabled > 0) and (strlen($pass_hash) > 12) )
|
||||
{$auth_key .= "|$pass_hash";}
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="UPDATE vicidial_users set failed_login_attempts_today=(failed_login_attempts_today+1),failed_last_type_today='c$auth_key' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05028',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
}
|
||||
return $auth_key;
|
||||
}
|
||||
|
||||
@@ -26,10 +26,11 @@
|
||||
# 201117-2117 - Changes for better compatibility with non-latin data input
|
||||
# 210616-2101 - Added optional CORS support, see options.php for details
|
||||
# 220220-0934 - Added allow_web_debug system setting
|
||||
# 220921-1702 - Added failed login reason messages
|
||||
#
|
||||
|
||||
$version = '2.14-21';
|
||||
$build = '220220-0934';
|
||||
$version = '2.14-22';
|
||||
$build = '220921-1702';
|
||||
$php_script = 'timeclock.php';
|
||||
|
||||
$StarTtimE = date("U");
|
||||
@@ -269,6 +270,24 @@ if ( ($stage == 'login') or ($stage == 'logout') )
|
||||
{
|
||||
### NOT A VALID USER/PASS
|
||||
$VDdisplayMESSAGE = _QXZ("The user and password you entered are not active in the system<BR>Please try again:");
|
||||
if ($auth_message == 'LOCK')
|
||||
{$VDdisplayMESSAGE = _QXZ("Too many login attempts, try again in 15 minutes")."<br />";}
|
||||
if ($auth_message == 'ERRNETWORK')
|
||||
{$VDdisplayMESSAGE = _QXZ("Too many network errors, please contact your administrator")."<br />";}
|
||||
if ($auth_message == 'ERRSERVERS')
|
||||
{$VDdisplayMESSAGE = _QXZ("No available servers, please contact your administrator")."<br />";}
|
||||
if ($auth_message == 'ERRPHONES')
|
||||
{$VDdisplayMESSAGE = _QXZ("No available phones, please contact your administrator")."<br />";}
|
||||
if ($auth_message == 'ERRDUPLICATE')
|
||||
{$VDdisplayMESSAGE = _QXZ("You are already logged in, please log out of your other session first")."<br />";}
|
||||
if ($auth_message == 'ERRAGENTS')
|
||||
{$VDdisplayMESSAGE = _QXZ("Too many agents logged in, please contact your administrator")."<br />";}
|
||||
if ($auth_message == 'ERRCAMPAGENTS')
|
||||
{$VDdisplayMESSAGE = _QXZ("Too many agents logged in to this campaign, please contact your manager")."<br />";}
|
||||
if ($auth_message == 'ERRCASE')
|
||||
{$VDdisplayMESSAGE = _QXZ("Login incorrect, user names are case sensitive")."<br />";}
|
||||
if ($auth_message == 'IPBLOCK')
|
||||
{$VDdisplayMESSAGE = _QXZ("Your IP Address is not allowed").": $ip<br />";}
|
||||
|
||||
echo"<HTML><HEAD>\n";
|
||||
echo"<TITLE>"._QXZ("Agent Timeclock")."</TITLE>\n";
|
||||
|
||||
@@ -4,15 +4,16 @@
|
||||
#
|
||||
# functions for agent scripts
|
||||
#
|
||||
# Copyright (C) 2021 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
#
|
||||
# CHANGES:
|
||||
# 151212-0826 - First Build for customer chat, based on agc/functions.php
|
||||
# 210615-1044 - Default security fixes, CVE-2021-28854
|
||||
# 220921-1233 - Added more failed login logging in user_authorization function
|
||||
#
|
||||
|
||||
# $mysql_queries = 20
|
||||
# $mysql_queries = 22
|
||||
|
||||
##### BEGIN validate user login credentials, check for failed lock out #####
|
||||
function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$return_hash)
|
||||
@@ -90,7 +91,7 @@ function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$retur
|
||||
|
||||
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';";
|
||||
$stmt="UPDATE vicidial_users set failed_login_count=(failed_login_count+1),failed_login_attempts_today=(failed_login_attempts_today+1),failed_login_count_today=(failed_login_count_today+1),failed_last_ip_today='$ip',failed_last_type_today='hBAD' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05011',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
@@ -98,12 +99,17 @@ function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$retur
|
||||
{
|
||||
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';";
|
||||
$stmt="UPDATE vicidial_users set last_login_date=NOW(),failed_login_count=1,failed_last_ip_today='$ip',failed_login_attempts_today=(failed_login_attempts_today+1),failed_login_count_today=(failed_login_count_today+1),failed_last_type_today='hBAD' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($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';}
|
||||
{
|
||||
$auth_key='LOCK';
|
||||
$stmt="UPDATE vicidial_users set failed_login_attempts_today=(failed_login_attempts_today+1),failed_last_type_today='hLOCK' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05021',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($SSwebroot_writable > 0)
|
||||
@@ -200,6 +206,12 @@ function user_authorization($user,$pass,$user_option,$user_update,$bcrypt,$retur
|
||||
if ( ($return_hash == '1') and ($SSpass_hash_enabled > 0) and (strlen($pass_hash) > 12) )
|
||||
{$auth_key .= "|$pass_hash";}
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="UPDATE vicidial_users set failed_login_attempts_today=(failed_login_attempts_today+1),failed_last_type_today='h$auth_key' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($mel > 0) {mysql_error_logging($NOW_TIME,$link,$mel,$stmt,'05022',$user,$server_ip,$session_name,$one_mysql_log);}
|
||||
}
|
||||
}
|
||||
return $auth_key;
|
||||
}
|
||||
|
||||
@@ -125,9 +125,9 @@ $PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF);
|
||||
$QUERY_STRING = getenv("QUERY_STRING");
|
||||
$groups=array();
|
||||
|
||||
$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary, Real-Time Whiteboard Report, VERM Reports, Inbound Report, Inbound Report by DID, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound DID Summary Report, Agent DID Report, Inbound DID Detail Report, Inbound IVR Report, Inbound Forecasting Report, Advanced Forecasting Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Callmenu Survey Report, Outbound Lead Source Report, Fronter - Closer Report, Fronter - Closer Detail Report, Lists Campaign Statuses Report, Lists Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report, Agent Time Detail, Agent Status Detail, Agent Inbound Status Summary, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, Single Agent Daily Time, User Group Login Report, User Group Hourly Report, User Group Detail Hourly Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report, Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Carrier Log Report, Campaign Debug, Shared Debug, Asterisk Debug, Hangup Cause Report, Lists Pass Report, Called Counts List IDs Report, Agent Debug Log Report, Agent Parked Call Report, Agent-Manager Chat Log, Recording Access Log Report, API Log Report, Real-Time Monitoring Log Report, AMD Log Report, SIP Event Report, Caller ID Log Report, Quality Control Report, Settings Compare, Phone Stats, Hopper List Report, In-Group User List, Webserver-URL Report, VDAD Debug Log Report, URL Log Report, Medialog Inventory Report, Asterisk Debug, SPH Report, Shared Debug, Process Report, Group Alias Report, Hangup Cause Report, IVR Filter Report, LAGGED Agent Log Report, Agent Disposition Report, Agent Performance Report, Carrier Log Report, Dial Log Report, Inbound Extension Stats, Agents Time On Calls, Callbacks Export';
|
||||
$Vreports = 'NONE, Real-Time Main Report, Real-Time Campaign Summary, Real-Time Whiteboard Report, VERM Reports, Inbound Report, Inbound Report by DID, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound DID Summary Report, Agent DID Report, Inbound DID Detail Report, Inbound IVR Report, Inbound Forecasting Report, Advanced Forecasting Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Callmenu Survey Report, Outbound Lead Source Report, Fronter - Closer Report, Fronter - Closer Detail Report, Lists Campaign Statuses Report, Lists Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report, Agent Time Detail, Agent Status Detail, Agent Inbound Status Summary, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, Single Agent Daily Time, User Group Login Report, User Group Hourly Report, User Group Detail Hourly Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report, Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Carrier Log Report, Campaign Debug, Shared Debug, Asterisk Debug, Hangup Cause Report, Lists Pass Report, Called Counts List IDs Report, Agent Debug Log Report, Agent Parked Call Report, Agent-Manager Chat Log, Recording Access Log Report, API Log Report, Real-Time Monitoring Log Report, AMD Log Report, SIP Event Report, Caller ID Log Report, Quality Control Report, Settings Compare, Phone Stats, Hopper List Report, In-Group User List, Webserver-URL Report, VDAD Debug Log Report, URL Log Report, Medialog Inventory Report, Asterisk Debug, SPH Report, Shared Debug, Process Report, Group Alias Report, Hangup Cause Report, IVR Filter Report, LAGGED Agent Log Report, Agent Disposition Report, Agent Performance Report, Carrier Log Report, Dial Log Report, Inbound Extension Stats, Agents Time On Calls, Callbacks Export, User Logins Report';
|
||||
|
||||
$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary, Real-Time Whiteboard Report, VERM Reports, Inbound Report, Inbound Report by DID, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound DID Summary Report, Agent DID Report, Inbound DID Detail Report, Inbound Email Report, Inbound Chat Report, Inbound IVR Report, Inbound Forecasting Report, Advanced Forecasting Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Callmenu Survey Report, Outbound Lead Source Report, Fronter - Closer Report, Fronter - Closer Detail Report, Lists Campaign Statuses Report, Lists Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report, Agent Time Detail, Agent Status Detail, Agent Inbound Status Summary, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, Single Agent Daily Time, User Group Login Report, User Group Hourly Report, User Group Detail Hourly Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report, Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Custom Reports Links, CallCard Search, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Lists Pass Report, Called Counts List IDs Report, Front Page System Summary, Report Page Servers Summary, Admin Utilities Page, Agent Debug Log Report, Agent Parked Call Report, Agent-Manager Chat Log, Recording Access Log Report, API Log Report, Real-Time Monitoring Log Report, AMD Log Report, SIP Event Report, Caller ID Log Report, Quality Control Report, Settings Compare, Phone Stats, Hopper List Report, In-Group User List, Webserver-URL Report, VDAD Debug Log Report, URL Log Report, Medialog Inventory Report, Asterisk Debug, SPH Report, Shared Debug, Process Report, Group Alias Report, Hangup Cause Report, IVR Filter Report, LAGGED Agent Log Report, Agent Disposition Report, Agent Performance Report, Carrier Log Report, Dial Log Report, Inbound Extension Stats, Agents Time On Calls, Callbacks Export, VERM QA Links';
|
||||
$UGreports = 'ALL REPORTS, NONE, Real-Time Main Report, Real-Time Campaign Summary, Real-Time Whiteboard Report, VERM Reports, Inbound Report, Inbound Report by DID, Inbound Service Level Report, Inbound Summary Hourly Report, Inbound Daily Report, Inbound DID Report, Inbound DID Summary Report, Agent DID Report, Inbound DID Detail Report, Inbound Email Report, Inbound Chat Report, Inbound IVR Report, Inbound Forecasting Report, Advanced Forecasting Report, Outbound Calling Report, Outbound Summary Interval Report, Outbound IVR Report, Callmenu Survey Report, Outbound Lead Source Report, Fronter - Closer Report, Fronter - Closer Detail Report, Lists Campaign Statuses Report, Lists Statuses Report, Campaign Status List Report, Export Calls Report, Export Leads Report, Agent Time Detail, Agent Status Detail, Agent Inbound Status Summary, Agent Performance Detail, Team Performance Detail, Performance Comparison Report, Single Agent Daily, Single Agent Daily Time, User Group Login Report, User Group Hourly Report, User Group Detail Hourly Report, User Timeclock Report, User Group Timeclock Status Report, User Timeclock Detail Report, Server Performance Report, Administration Change Log, List Update Stats, User Stats, User Time Sheet, Download List, Dialer Inventory Report, Custom Reports Links, CallCard Search, Maximum System Stats, Maximum Stats Detail, Search Leads Logs, Email Log Report, Lists Pass Report, Called Counts List IDs Report, Front Page System Summary, Report Page Servers Summary, Admin Utilities Page, Agent Debug Log Report, Agent Parked Call Report, Agent-Manager Chat Log, Recording Access Log Report, API Log Report, Real-Time Monitoring Log Report, AMD Log Report, SIP Event Report, Caller ID Log Report, Quality Control Report, Settings Compare, Phone Stats, Hopper List Report, In-Group User List, Webserver-URL Report, VDAD Debug Log Report, URL Log Report, Medialog Inventory Report, Asterisk Debug, SPH Report, Shared Debug, Process Report, Group Alias Report, Hangup Cause Report, IVR Filter Report, LAGGED Agent Log Report, Agent Disposition Report, Agent Performance Report, Carrier Log Report, Dial Log Report, Inbound Extension Stats, Agents Time On Calls, Callbacks Export, User Logins Report, VERM QA Links';
|
||||
|
||||
$Vtables = 'NONE,log_noanswer,did_agent_log,contact_information';
|
||||
|
||||
@@ -5933,12 +5933,13 @@ if ($SSscript_remove_js > 0)
|
||||
# 220827-0855 - Added BETA support for ConfBridge in Servers and Conferences
|
||||
# 220829-1036 - Added testing code for VERM(VICIdial Enhanced Reporting Module)
|
||||
# 220831-0850 - Added Campaign user_group_script override option, with User Group script option
|
||||
# 220921-1319 - Added more User failed login details for level 9 users
|
||||
#
|
||||
|
||||
# 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-865a';
|
||||
$build = '220831-0850';
|
||||
$admin_version = '2.14-866a';
|
||||
$build = '220921-1319';
|
||||
|
||||
$STARTtime = date("U");
|
||||
$SQLdate = date("Y-m-d H:i:s");
|
||||
@@ -24548,7 +24549,7 @@ if ($ADD==3)
|
||||
echo "<TABLE><TR><TD>\n";
|
||||
echo "<FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>";
|
||||
|
||||
$stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,modify_email_accounts,failed_login_count,last_login_date,last_ip,alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,agentcall_chat,admin_cf_show_hidden,user_hide_realtime,access_recordings,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list,ready_max_logout,export_gdpr_leads,pause_code_approval,max_hopper_calls,max_hopper_calls_hour,mute_recordings,hide_call_log_info,next_dial_my_callbacks,user_admin_redirect_url,max_inbound_filter_enabled,max_inbound_filter_statuses,max_inbound_filter_ingroups,max_inbound_filter_min_sec,status_group_id,mobile_number,two_factor_override,manual_dial_filter,user_location,download_invalid_files,user_group_two from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;";
|
||||
$stmt="SELECT user_id,user,pass,full_name,user_level,user_group,phone_login,phone_pass,delete_users,delete_user_groups,delete_lists,delete_campaigns,delete_ingroups,delete_remote_agents,load_leads,campaign_detail,ast_admin_access,ast_delete_phones,delete_scripts,modify_leads,hotkeys_active,change_agent_campaign,agent_choose_ingroups,closer_campaigns,scheduled_callbacks,agentonly_callbacks,agentcall_manual,vicidial_recording,vicidial_transfers,delete_filters,alter_agent_interface_options,closer_default_blended,delete_call_times,modify_call_times,modify_users,modify_campaigns,modify_lists,modify_scripts,modify_filters,modify_ingroups,modify_usergroups,modify_remoteagents,modify_servers,view_reports,vicidial_recording_override,alter_custdata_override,qc_enabled,qc_user_level,qc_pass,qc_finish,qc_commit,add_timeclock_log,modify_timeclock_log,delete_timeclock_log,alter_custphone_override,vdc_agent_api_access,modify_inbound_dids,delete_inbound_dids,active,alert_enabled,download_lists,agent_shift_enforcement_override,manager_shift_enforcement_override,shift_override_flag,export_reports,delete_from_dnc,email,user_code,territory,allow_alerts,agent_choose_territories,custom_one,custom_two,custom_three,custom_four,custom_five,voicemail_id,agent_call_log_view_override,callcard_admin,agent_choose_blended,realtime_block_user_info,custom_fields_modify,force_change_password,agent_lead_search_override,modify_shifts,modify_phones,modify_carriers,modify_labels,modify_statuses,modify_voicemail,modify_audiostore,modify_moh,modify_tts,preset_contact_search,modify_contacts,modify_same_user_level,admin_hide_lead_data,admin_hide_phone_data,agentcall_email,modify_email_accounts,failed_login_count,last_login_date,last_ip,alter_admin_interface_options,max_inbound_calls,modify_custom_dialplans,wrapup_seconds_override,modify_languages,selected_language,user_choose_language,ignore_group_on_search,api_list_restrict,api_allowed_functions,lead_filter_id,agentcall_chat,admin_cf_show_hidden,user_hide_realtime,access_recordings,modify_colors,user_nickname,user_new_lead_limit,api_only_user,modify_auto_reports,modify_ip_lists,ignore_ip_list,ready_max_logout,export_gdpr_leads,pause_code_approval,max_hopper_calls,max_hopper_calls_hour,mute_recordings,hide_call_log_info,next_dial_my_callbacks,user_admin_redirect_url,max_inbound_filter_enabled,max_inbound_filter_statuses,max_inbound_filter_ingroups,max_inbound_filter_min_sec,status_group_id,mobile_number,two_factor_override,manual_dial_filter,user_location,download_invalid_files,user_group_two,failed_login_attempts_today,failed_login_count_today,failed_last_ip_today,failed_last_type_today from vicidial_users where user='$user' $LOGadmin_viewable_groupsSQL;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$user_id = $row[0];
|
||||
@@ -24694,6 +24695,10 @@ if ($ADD==3)
|
||||
$user_location = $row[142];
|
||||
$download_invalid_files=$row[143];
|
||||
$user_group_two = $row[144];
|
||||
$failed_login_attempts_today=$row[145];
|
||||
$failed_login_count_today=$row[146];
|
||||
$failed_last_ip_today = $row[147];
|
||||
$failed_last_type_today=$row[148];
|
||||
|
||||
##### latest 2FA auth record data
|
||||
$last_auth='';
|
||||
@@ -24742,7 +24747,19 @@ if ($ADD==3)
|
||||
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Force Change Password").": </td><td align=left><select size=1 name=force_change_password><option value='Y'>"._QXZ("Y")."</option><option value='N'>"._QXZ("N")."</option><option value=\"$force_change_password\" SELECTED>"._QXZ("$force_change_password")."</option></select>$NWB#users-force_change_password$NWE</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Last Login Info").": </td><td align=left><b>$last_login_date - $failed_login_count - $last_ip $last_auth</b>$NWB#users-last_login_date$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Last Login Info").": </td><td align=left><b>$last_login_date - $failed_login_count - $last_ip $last_auth</b>$NWB#users-last_login_date$NWE ";
|
||||
if ($LOGuser_level > 8)
|
||||
{
|
||||
if ($failed_login_attempts_today > 0)
|
||||
{
|
||||
echo "<font size=2> <a href=\"user_logins_report.php?user=$user\">"._QXZ("Failed logins today")."</a>: $failed_login_attempts_today - $failed_login_count_today - $failed_last_ip_today - $failed_last_type_today</font>";
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "<font size=2> <a href=\"user_logins_report.php?user=$user\">"._QXZ("Logins summary")."</a></font>";
|
||||
}
|
||||
}
|
||||
echo "</td></tr>\n";
|
||||
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("Full Name").": </td><td align=left><input type=text name=full_name size=30 maxlength=30 value=\"$full_name\">$NWB#users-full_name$NWE</td></tr>\n";
|
||||
echo "<tr bgcolor=#$SSstd_row4_background><td align=right>"._QXZ("User Level").": </td><td align=left><select size=1 name=user_level>";
|
||||
@@ -49348,6 +49365,7 @@ if ($ADD==999994)
|
||||
echo "<LI><a href=\"AST_webserver_url_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"._QXZ("Webserver-URL Report")."</a></FONT>\n";
|
||||
echo "<LI><a href=\"AST_LAGGED_log_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"._QXZ("Agent LAGGED Report")."</a></FONT>\n";
|
||||
echo "<LI><a href=\"AST_usergroup_login_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"._QXZ("User Group Login Report")."</a></FONT>\n";
|
||||
echo "<LI><a href=\"user_logins_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"._QXZ("User Logins Report")."</a></FONT>\n";
|
||||
echo "<LI><a href=\"AST_agent_debug_log_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"._QXZ("Agent Debug Log Report")."</a></FONT>\n";
|
||||
echo "<LI><a href=\"AST_rt_monitor_log_report.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"._QXZ("Real-Time Monitoring Log Report")."</a></FONT>\n";
|
||||
echo "<LI><a href=\"AST_parkstats.php\"><FONT FACE=\"ARIAL,HELVETICA\" COLOR=BLACK SIZE=2>"._QXZ("Agent Parked Call Report")."</a></FONT>\n";
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
# functions for administrative scripts and reports
|
||||
#
|
||||
# Copyright (C) 2021 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
#
|
||||
# CHANGES:
|
||||
@@ -39,6 +39,7 @@
|
||||
# 210316-0924 - Small fix for 2FA consistency
|
||||
# 210406-1740 - Moved 'dialable_leads' function to this script
|
||||
# 210615-0952 - Default security fix, CVE-2021-28854
|
||||
# 220921-1209 - Added more failed login logging in user_authorization function
|
||||
#
|
||||
|
||||
##### BEGIN validate user login credentials, check for failed lock out #####
|
||||
@@ -120,18 +121,22 @@ function user_authorization($user,$pass,$user_option,$user_update,$api_call)
|
||||
|
||||
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';";
|
||||
$stmt="UPDATE vicidial_users set failed_login_count=(failed_login_count+1),failed_login_attempts_today=(failed_login_attempts_today+1),failed_login_count_today=(failed_login_count_today+1),failed_last_ip_today='$ip',failed_last_type_today='aBAD' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
}
|
||||
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';";
|
||||
$stmt="UPDATE vicidial_users set last_login_date=NOW(),failed_login_count=1,failed_last_ip_today='$ip',failed_login_attempts_today=(failed_login_attempts_today+1),failed_login_count_today=(failed_login_count_today+1),failed_last_type_today='aBAD' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
}
|
||||
else
|
||||
{$auth_key='LOCK';}
|
||||
{
|
||||
$auth_key='LOCK';
|
||||
$stmt="UPDATE vicidial_users set failed_login_attempts_today=(failed_login_attempts_today+1),failed_last_type_today='aLOCK' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($SSwebroot_writable > 0)
|
||||
@@ -256,6 +261,11 @@ function user_authorization($user,$pass,$user_option,$user_update,$api_call)
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$stmt="UPDATE vicidial_users set failed_login_attempts_today=(failed_login_attempts_today+1),failed_last_type_today='a$auth_key' where user='$user';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
}
|
||||
}
|
||||
return $auth_key;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# version: 20220831091601
|
||||
# version: 20220921215701
|
||||
users-user User ID <QXZ>This field is where you put the users ID number, can be up to 20 digits in length, Must be at least 2 characters in length. We strongly recommend not reusing user accounts for different users, for reporting accuracy. To disable a user account, set the Active option to -N-.</QXZ>
|
||||
users-pass Password <QXZ>This field is where you put the users password. Must be at least 2 characters in length. Only letters and numbers are allowed in user passwords. A medium strength user password will be at least 10 characters in length, and a strong user password will be at least 20 characters in length and have letters as well as at least one number. It is recommended that you use a longer password if possible, stringing together several unrelated words with no spaces, and a number somewhere in the string. The maximum size of a password is 100 characters.</QXZ>
|
||||
users-force_change_password Force Change Password <QXZ>If this option is set to Y then the user will be prompted to change their password the next time they log in to the administration webpage or the agent screen. Default is N.</QXZ>
|
||||
@@ -1335,6 +1335,7 @@ usergroup_login User Group Login Report <QXZ>This report includes information on
|
||||
agent_timeclock_detail User Timeclock Detail Report <QXZ>Pulls all timeclock records for agents meeting the selected parameters.</QXZ><BR><QXZ><U>TIME CLOCK</U> = Total amount of time agent spent logged in.</QXZ><BR><QXZ><U>TIME CLOCK PUNCHES</U> = A list of the punch-in and punch-out times for each agent. Punch-out times marked with an asterisk (*) denotes AUTOLOGOUT from timeclock.</QXZ>
|
||||
campaign_status_list_report Campaign Status List Report <QXZ>This report is designed to show the breakdown by list_id of the calls and their statuses for all lists within a campaign for a set time period.</QXZ><BR><QXZ><U>DISPOSITION</U> = The distinct dispositions made for the list within the time frame specified.</QXZ><BR><QXZ><U>CALLS</U> = The number of calls ending with the disposition listed.</QXZ><BR><QXZ><U>DURATION</U> = Sum of the length of the calls ending with the disposition listed.</QXZ><BR><QXZ><U>HANDLE TIME</U> = Sum of the time the calls ending with the disposition listed were handled by an agent (<U>TALK</U> + <U>DEAD</U>).</QXZ><BR><BR><QXZ><U>TOTAL CALLS</U> = Number of calls placed to leads belonging to lists in this campaign within the time frame specified.</QXZ><BR><QXZ><U>STATUS FLAGS BREAKDOWN</U> = Breakdown of the total calls into status categories, including counts per category and percentage relative to the number of calls to leads in the list within the time frame specified.</QXZ>
|
||||
campaign_debug Campaign Debug <QXZ>Shows campaign stats and debug output for a selected campaign.</QXZ>
|
||||
user_logins_report User Logins Report <QXZ>This report will show the last login information for a user on the last several days that they logged into the system</QXZ>
|
||||
carrier_log_report Carrier Log Report <QXZ>This report will show dial status breakdowns, SIP error reason breakdowns, and carrier log records for a selected date, and can be filtered by server.</QXZ>
|
||||
cid_log_report Caller ID Log Report <QXZ>This report will provide a breakdown by caller ID of calls from specified campaigns and specified statuses within a date range. Its primary purpose is to show if particular caller IDs have been flagged by carriers as being scam numbers.</QXZ>
|
||||
dial_log_report Dial Log Report <QXZ>This report will show individial dial log records for a single date, allowing filtering by server and SIP code.</QXZ>
|
||||
@@ -1506,6 +1507,7 @@ user_stats-agent_pause_logs Agent Pause Logs <QXZ>This report will show you the
|
||||
user_stats-agent_parked_call_logs Agent Parked Call Logs <QXZ>This report will show you the call details and durations for calls that this agent has parked on hold for the selected date range.</QXZ>
|
||||
user_stats-agent_talk_time_and_status Agent Talk Time and Status <QXZ>This section will show you all of the total number of calls and call durations by status of inbound and outbound calls handled by this agent during the selected time range. This data is based upon call log data, not agent activity log data, which is separate and may not show the same call durations.</QXZ>
|
||||
user_stats-agent_login_and_logout_time Agent Login and Logout Time <QXZ>This section will show you the Agent Screen Login and Logout events for this agent for the selected time range.</QXZ><BR><QXZ><U>EVENT</U> = Either a LOGIN or LOGOUT event, the agent logging into or out of the Agent Screen.</QXZ><BR><QXZ><U>DATE</U> = The date-time-stamp of the event.</QXZ><BR><QXZ><U>CAMPAIGN</U> = The campaign the agent was logging into or out of.</QXZ><BR><QXZ><U>GROUP</U> = The User Group of the agent at the time they logged in or out.</QXZ><BR><QXZ><U>SESSION</U> = The Session ID when the agent first logged in to that session.</QXZ><BR><QXZ><U>HOURS</U> = The time duration, in hours:minutes:seconds, of the agent session.</QXZ><BR><QXZ><U>SERVER</U> = The IP Address of the server that the agent logged into. For some LOGOUT events, this area may show that a manager force-logged-out the agent, with the user ID of the manager that forced the logout of the agent session.</QXZ><BR><QXZ><U>PHONE</U> = The phone account that the agent logged in with.</QXZ><BR><QXZ><U>COMPUTER</U> = The IP Address that the agent logged in from. If the server or agent are behind a seperated network, this IP Address may be for a network gateway device instead of the actual computer.</QXZ><BR><QXZ><U>PHONE LOGIN</U> = The Phone Login used when the agent logged into the agent screen. This may be different from the PHONE if Phone Aliases are in use on the system.</QXZ><BR><QXZ><U>PHONE IP</U> = If enabled on your system, this can show the IP address of the phone device that the agent connected to their session through.</QXZ>
|
||||
user_stats-agent_webserver_url_logins Agent Webserver and URL Logins <QXZ>This section will show what web servers and URLs the agent was using at the time they logged in for the selected time range.</QXZ><BR><QXZ><U>DATE</U> = The date-time-stamp of the event.</QXZ><BR><QXZ><U>CAMPAIGN</U> = The campaign the agent was logging into or out of.</QXZ><BR><QXZ><U>GROUP</U> = The User Group of the agent at the time they logged in or out.</QXZ><BR><QXZ><U>DIALER SERVER</U> = The IP Address of the dialer (not web) server that the agent logged into.</QXZ><BR><QXZ><U>WEB SERVER</U> = The webserver/hostname gathered from the agent interface at the time the agent logged in.</QXZ><BR><QXZ><U>LOGIN URL</U> = The full URL of the agent interface where the agent logged in.</QXZ>
|
||||
user_stats-timeclock_login_and_logout_time Timeclock Login and Logout Time <QXZ>This section will show the timeclock punch log for this User for the selected time range.</QXZ><BR><QXZ><U>ID EDIT</U> = This is the unique Timeclock punch ID number. If you are a manager with the ability to edit timeclock records then you can click on this ID number to see the record and modify the punch times and add comments to the punch record. If a punch record has been edited by a amanger or is a system forced logout, you will see a star next to the ID here.</QXZ><BR><QXZ><U>EVENT</U> = Either a LOGIN or LOGOUT event, the agent logging into or out of the Timeclock.</QXZ><BR><QXZ><U>DATE</U> = The date-time-stamp of the event.</QXZ><BR><QXZ><U>IP ADDRESS</U> = The IP Address that the agent logged in from. If the server or agent are behind a seperated network, this IP Address may be for a network gateway device instead of the actual computer.</QXZ><BR><QXZ><U>GROUP</U> = The User Group of the agent at the time they punched in or out of the timeclock.</QXZ><BR><QXZ><U>HOURS</U> = The time duration, in hours:minutes:seconds, of the timeclock session.</QXZ>
|
||||
user_stats-closer_ingroup_selection_logs Closer In-Group Selection Logs <QXZ>This section will show the In-Groups, Email-Groups and Chat-Groups that the agent is set to receive calls from after they log into the agent screen.</QXZ><BR><QXZ><U>DATE TIME</U> = The date-time-stamp when the specific agent selection action was completed.</QXZ><BR><QXZ><U>CAMPAIGN</U> = The campaign the agent was logging into.</QXZ><BR><QXZ><U>BLEND</U> = Whether the agent was set to also take outbound calls during this sesstion, 1 = Yes, 2 = No.</QXZ><BR><QXZ><U>GROUPS</U> = The list of In-Groups, Email-Groups and Chat-Groups that the agent is set to receive calls from starting at this selection record time.</QXZ><BR><QXZ><U>MANAGER</U> = If a manager has used the Real-Time Report to modify the agent selected in-groups, the user ID of the manager will appear in this column.</QXZ>
|
||||
user_stats-outbound_calls Outbound Calls for this Time Period <QXZ>This section will show the manual dial and auto-dial outbound calls handled by this agent during the selected time period, most recent call first.</QXZ><BR><QXZ><U>DATE TIME</U> = The date-time-stamp when the outbound call was initiated in the system.</QXZ><BR><QXZ><U>LENGTH</U> = The length of the outbound call in seconds.</QXZ><BR><QXZ><U>STATUS</U> = The status assigned to the call by the agent after the call was hung up.</QXZ><BR><QXZ><U>PHONE</U> = The phone number the call was placed to.</QXZ><BR><QXZ><U>CAMPAIGN</U> = The campaign the agent was logged into when the outbound call was placed.</QXZ><BR><QXZ><U>GROUP</U> = The User Group that the agent was a member of at the time the call was placed.</QXZ><BR><QXZ><U>LIST</U> = The List ID of the lead that was called at the time the call was placed.</QXZ><BR><QXZ><U>LEAD</U> = The Lead ID of the lead that was called. You can click on this link to see more details about this lead, including past calls and the ability to modify lead information.</QXZ><BR><QXZ><U>HANGUP REASON</U> = The reason the call was hung up, if the AGENT or CALLER hung up the call first.</QXZ>
|
||||
|
||||
@@ -196,10 +196,11 @@
|
||||
# 220312-0944 - Added vicidial_dial_cid_log logging
|
||||
# 220519-2206 - Small fix for 'update_lead' delete_lead feature
|
||||
# 220902-0823 - Added dial_status_add/dial_status_remove options to update_campaign function
|
||||
# 220920-0814 - Added more "XDAY" options to add_lead duplicate checks
|
||||
#
|
||||
|
||||
$version = '2.14-173';
|
||||
$build = '220902-0823';
|
||||
$version = '2.14-174';
|
||||
$build = '220920-0814';
|
||||
$php_script='non_agent_api.php';
|
||||
$api_url_log = 0;
|
||||
|
||||
@@ -14018,9 +14019,17 @@ if ($function == 'add_lead')
|
||||
|
||||
### START checking for duplicate if defined ###
|
||||
$multidaySQL='';
|
||||
if (preg_match("/30DAY|60DAY|90DAY|180DAY|360DAY/i",$duplicate_check))
|
||||
if (preg_match("/1DAY|2DAY|3DAY|7DAY|14DAY|15DAY|21DAY|28DAY|30DAY|60DAY|90DAY|180DAY|360DAY/i",$duplicate_check))
|
||||
{
|
||||
$day_val=30;
|
||||
if (preg_match("/1DAY/i",$duplicate_check)) {$day_val=1;}
|
||||
if (preg_match("/2DAY/i",$duplicate_check)) {$day_val=2;}
|
||||
if (preg_match("/3DAY/i",$duplicate_check)) {$day_val=3;}
|
||||
if (preg_match("/7DAY/i",$duplicate_check)) {$day_val=7;}
|
||||
if (preg_match("/14DAY/i",$duplicate_check)) {$day_val=14;}
|
||||
if (preg_match("/15DAY/i",$duplicate_check)) {$day_val=15;}
|
||||
if (preg_match("/21DAY/i",$duplicate_check)) {$day_val=21;}
|
||||
if (preg_match("/28DAY/i",$duplicate_check)) {$day_val=28;}
|
||||
if (preg_match("/30DAY/i",$duplicate_check)) {$day_val=30;}
|
||||
if (preg_match("/60DAY/i",$duplicate_check)) {$day_val=60;}
|
||||
if (preg_match("/90DAY/i",$duplicate_check)) {$day_val=90;}
|
||||
|
||||
@@ -0,0 +1,403 @@
|
||||
<?php
|
||||
# user_logins_report.php
|
||||
#
|
||||
# Copyright (C) 2022 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
|
||||
#
|
||||
# CHANGES
|
||||
# 110514-1231 - First build
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
|
||||
$report_name='User Logins Report';
|
||||
|
||||
require("dbconnect_mysqli.php");
|
||||
require("functions.php");
|
||||
|
||||
$PHP_AUTH_USER=$_SERVER['PHP_AUTH_USER'];
|
||||
$PHP_AUTH_PW=$_SERVER['PHP_AUTH_PW'];
|
||||
$PHP_SELF=$_SERVER['PHP_SELF'];
|
||||
$PHP_SELF = preg_replace('/\.php.*/i','.php',$PHP_SELF);
|
||||
if (isset($_GET["DB"])) {$DB=$_GET["DB"];}
|
||||
elseif (isset($_POST["DB"])) {$DB=$_POST["DB"];}
|
||||
if (isset($_GET["user"])) {$user=$_GET["user"];}
|
||||
elseif (isset($_POST["user"])) {$user=$_POST["user"];}
|
||||
if (isset($_GET["submit"])) {$submit=$_GET["submit"];}
|
||||
elseif (isset($_POST["submit"])) {$submit=$_POST["submit"];}
|
||||
if (isset($_GET["SUBMIT"])) {$SUBMIT=$_GET["SUBMIT"];}
|
||||
elseif (isset($_POST["SUBMIT"])) {$SUBMIT=$_POST["SUBMIT"];}
|
||||
|
||||
$DB=preg_replace("/[^0-9a-zA-Z]/","",$DB);
|
||||
|
||||
$NOW_DATE = date("Y-m-d");
|
||||
$NOW_TIME = date("Y-m-d H:i:s");
|
||||
$last_midnight = date("Y-m-d 00:00:00");
|
||||
$STARTtime = date("U");
|
||||
|
||||
#############################################
|
||||
##### START SYSTEM_SETTINGS LOOKUP #####
|
||||
$stmt = "SELECT use_non_latin,webroot_writable,outbound_autodial_active,user_territories_active,enable_languages,language_method,allow_shared_dial,allow_web_debug FROM system_settings;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
#if ($DB) {echo "$stmt\n";}
|
||||
$qm_conf_ct = mysqli_num_rows($rslt);
|
||||
if ($qm_conf_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$non_latin = $row[0];
|
||||
$webroot_writable = $row[1];
|
||||
$SSoutbound_autodial_active = $row[2];
|
||||
$user_territories_active = $row[3];
|
||||
$SSenable_languages = $row[4];
|
||||
$SSlanguage_method = $row[5];
|
||||
$SSallow_shared_dial = $row[6];
|
||||
$SSallow_web_debug = $row[7];
|
||||
}
|
||||
if ($SSallow_web_debug < 1) {$DB=0;}
|
||||
##### END SETTINGS LOOKUP #####
|
||||
###########################################
|
||||
|
||||
$submit = preg_replace('/[^-_0-9a-zA-Z]/', '', $submit);
|
||||
$SUBMIT = preg_replace('/[^-_0-9a-zA-Z]/', '', $SUBMIT);
|
||||
|
||||
if ($non_latin < 1)
|
||||
{
|
||||
$PHP_AUTH_USER = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = preg_replace('/[^-_0-9a-zA-Z]/', '', $PHP_AUTH_PW);
|
||||
$user = preg_replace('/[^-_0-9a-zA-Z]/', '', $user);
|
||||
}
|
||||
else
|
||||
{
|
||||
$PHP_AUTH_USER = preg_replace('/[^-_0-9\p{L}]/u', '', $PHP_AUTH_USER);
|
||||
$PHP_AUTH_PW = preg_replace('/[^-_0-9\p{L}]/u', '', $PHP_AUTH_PW);
|
||||
$user = preg_replace('/[^-_0-9\p{L}]/u', '', $user);
|
||||
}
|
||||
|
||||
$stmt="SELECT selected_language,user_group from vicidial_users where user='$PHP_AUTH_USER';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$sl_ct = mysqli_num_rows($rslt);
|
||||
if ($sl_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$VUselected_language = $row[0];
|
||||
$LOGuser_group = $row[1];
|
||||
}
|
||||
|
||||
$auth=0;
|
||||
$reports_auth=0;
|
||||
$admin_auth=0;
|
||||
$auth_message = user_authorization($PHP_AUTH_USER,$PHP_AUTH_PW,'',1,0);
|
||||
if ($auth_message == 'GOOD')
|
||||
{$auth=1;}
|
||||
|
||||
if ($auth > 0)
|
||||
{
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 7 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$admin_auth=$row[0];
|
||||
|
||||
$stmt="SELECT count(*) from vicidial_users where user='$PHP_AUTH_USER' and user_level > 6 and view_reports='1';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$reports_auth=$row[0];
|
||||
|
||||
if ($reports_auth < 1)
|
||||
{
|
||||
$VDdisplayMESSAGE = _QXZ("You are not allowed to view reports");
|
||||
Header ("Content-type: text/html; charset=utf-8");
|
||||
echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n";
|
||||
exit;
|
||||
}
|
||||
if ( ($reports_auth > 0) and ($admin_auth < 1) )
|
||||
{
|
||||
$ADD=999999;
|
||||
$reports_only_user=1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$VDdisplayMESSAGE = _QXZ("Login incorrect, please try again");
|
||||
if ($auth_message == 'LOCK')
|
||||
{
|
||||
$VDdisplayMESSAGE = _QXZ("Too many login attempts, try again in 15 minutes");
|
||||
Header ("Content-type: text/html; charset=utf-8");
|
||||
echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n";
|
||||
exit;
|
||||
}
|
||||
if ($auth_message == 'IPBLOCK')
|
||||
{
|
||||
$VDdisplayMESSAGE = _QXZ("Your IP Address is not allowed") . ": $ip";
|
||||
Header ("Content-type: text/html; charset=utf-8");
|
||||
echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$auth_message|\n";
|
||||
exit;
|
||||
}
|
||||
Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "$VDdisplayMESSAGE: |$PHP_AUTH_USER|$PHP_AUTH_PW|$auth_message|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$stmt="SELECT modify_campaigns,user_group from vicidial_users where user='$PHP_AUTH_USER';";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$LOGmodify_campaigns = $row[0];
|
||||
$LOGuser_group = $row[1];
|
||||
|
||||
if ($LOGmodify_campaigns < 1)
|
||||
{
|
||||
Header ("Content-type: text/html; charset=utf-8");
|
||||
echo _QXZ("You do not have permissions for campaign debugging").": |$PHP_AUTH_USER|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
$stmt="SELECT allowed_campaigns,allowed_reports,admin_viewable_groups,admin_viewable_call_times from vicidial_user_groups where user_group='$LOGuser_group';";
|
||||
if ($DB) {$HTML_text.="|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$LOGallowed_campaigns = $row[0];
|
||||
$LOGallowed_reports = $row[1];
|
||||
$LOGadmin_viewable_groups = $row[2];
|
||||
$LOGadmin_viewable_call_times = $row[3];
|
||||
|
||||
$LOGallowed_campaignsSQL='';
|
||||
$whereLOGallowed_campaignsSQL='';
|
||||
if ( (!preg_match('/\-ALL/i', $LOGallowed_campaigns)) )
|
||||
{
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ -/",'',$LOGallowed_campaigns);
|
||||
$rawLOGallowed_campaignsSQL = preg_replace("/ /","','",$rawLOGallowed_campaignsSQL);
|
||||
$LOGallowed_campaignsSQL = "and campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
$whereLOGallowed_campaignsSQL = "where campaign_id IN('$rawLOGallowed_campaignsSQL')";
|
||||
}
|
||||
$regexLOGallowed_campaigns = " $LOGallowed_campaigns ";
|
||||
|
||||
if ( (!preg_match("/$report_name/",$LOGallowed_reports)) and (!preg_match("/ALL REPORTS/",$LOGallowed_reports)) )
|
||||
{
|
||||
Header("WWW-Authenticate: Basic realm=\"CONTACT-CENTER-ADMIN\"");
|
||||
Header("HTTP/1.0 401 Unauthorized");
|
||||
echo "You are not allowed to view this report: |$PHP_AUTH_USER|$report_name|\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
##### BEGIN log visit to the vicidial_report_log table #####
|
||||
$LOGip = getenv("REMOTE_ADDR");
|
||||
$LOGbrowser = getenv("HTTP_USER_AGENT");
|
||||
$LOGscript_name = getenv("SCRIPT_NAME");
|
||||
$LOGserver_name = getenv("SERVER_NAME");
|
||||
$LOGserver_port = getenv("SERVER_PORT");
|
||||
$LOGrequest_uri = getenv("REQUEST_URI");
|
||||
$LOGhttp_referer = getenv("HTTP_REFERER");
|
||||
$LOGbrowser=preg_replace("/\'|\"|\\\\/","",$LOGbrowser);
|
||||
$LOGrequest_uri=preg_replace("/\'|\"|\\\\/","",$LOGrequest_uri);
|
||||
$LOGhttp_referer=preg_replace("/\'|\"|\\\\/","",$LOGhttp_referer);
|
||||
if (preg_match("/443/i",$LOGserver_port)) {$HTTPprotocol = 'https://';}
|
||||
else {$HTTPprotocol = 'http://';}
|
||||
if (($LOGserver_port == '80') or ($LOGserver_port == '443') ) {$LOGserver_port='';}
|
||||
else {$LOGserver_port = ":$LOGserver_port";}
|
||||
$LOGfull_url = "$HTTPprotocol$LOGserver_name$LOGserver_port$LOGrequest_uri";
|
||||
|
||||
$LOGhostname = php_uname('n');
|
||||
if (strlen($LOGhostname)<1) {$LOGhostname='X';}
|
||||
if (strlen($LOGserver_name)<1) {$LOGserver_name='X';}
|
||||
|
||||
$stmt="SELECT webserver_id FROM vicidial_webservers where webserver='$LOGserver_name' and hostname='$LOGhostname' LIMIT 1;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$webserver_id_ct = mysqli_num_rows($rslt);
|
||||
if ($webserver_id_ct > 0)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$webserver_id = $row[0];
|
||||
}
|
||||
else
|
||||
{
|
||||
##### insert webserver entry
|
||||
$stmt="INSERT INTO vicidial_webservers (webserver,hostname) values('$LOGserver_name','$LOGhostname');";
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$affected_rows = mysqli_affected_rows($link);
|
||||
$webserver_id = mysqli_insert_id($link);
|
||||
}
|
||||
|
||||
$stmt="INSERT INTO vicidial_report_log set event_date=NOW(), user='$PHP_AUTH_USER', ip_address='$LOGip', report_name='$report_name', browser='$LOGbrowser', referer='$LOGhttp_referer', notes='$LOGserver_name:$LOGserver_port $LOGscript_name', url='$LOGfull_url', webserver='$webserver_id';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$report_log_id = mysqli_insert_id($link);
|
||||
##### END log visit to the vicidial_report_log table #####
|
||||
|
||||
if ( (strlen($slave_db_server)>5) and (preg_match("/$report_name/",$reports_use_slave_db)) )
|
||||
{
|
||||
mysqli_close($link);
|
||||
$use_slave_server=1;
|
||||
$db_source = 'S';
|
||||
require("dbconnect_mysqli.php");
|
||||
$MAIN.="<!-- Using slave server $slave_db_server $db_source -->\n";
|
||||
}
|
||||
|
||||
$stmt="select user,full_name from vicidial_users order by user;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$campaigns_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($i < $campaigns_to_print)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
$users[$i] =$row[0];
|
||||
$full_name[$i] =$row[1];
|
||||
$i++;
|
||||
}
|
||||
|
||||
$NWB = "<IMG SRC=\"help.png\" onClick=\"FillAndShowHelpDiv(event, '";
|
||||
$NWE = "')\" WIDTH=20 HEIGHT=20 BORDER=0 ALT=\"HELP\" ALIGN=TOP>";
|
||||
?>
|
||||
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<STYLE type="text/css">
|
||||
<!--
|
||||
.green {color: white; background-color: green}
|
||||
.red {color: white; background-color: red}
|
||||
.blue {color: white; background-color: blue}
|
||||
.purple {color: white; background-color: purple}
|
||||
-->
|
||||
</STYLE>
|
||||
|
||||
<?php
|
||||
echo "<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n";
|
||||
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"vicidial_stylesheet.php\">\n";
|
||||
echo "<script language=\"JavaScript\" src=\"help.js\"></script>\n";
|
||||
echo "<TITLE>"._QXZ("Campaign Debug")."</TITLE></HEAD><BODY BGCOLOR=WHITE marginheight=0 marginwidth=0 leftmargin=0 topmargin=0>\n";
|
||||
echo "<div id='HelpDisplayDiv' class='help_info' style='display:none;'></div>";
|
||||
|
||||
$short_header=1;
|
||||
|
||||
require("admin_header.php");
|
||||
|
||||
echo "<b>"._QXZ("$report_name")."</b> $NWB#user_logins_report$NWE\n";
|
||||
|
||||
echo "<TABLE CELLPADDING=4 CELLSPACING=0><TR><TD>";
|
||||
echo "<FORM ACTION=\"$PHP_SELF\" METHOD=GET>\n";
|
||||
echo "<SELECT SIZE=1 NAME=user>\n";
|
||||
echo "<option ";
|
||||
if ($user == '--MOST-RECENT-ACTIVE-TODAY--') {echo "selected ";}
|
||||
echo "value='--MOST-RECENT-ACTIVE-TODAY--'>"._QXZ("--MOST-RECENT-ACTIVE-TODAY--")."</option>\n";
|
||||
echo "<option ";
|
||||
if ($user == '--MOST-RECENT-ACTIVE-ARCHIVE--') {echo "selected ";}
|
||||
echo "value='--MOST-RECENT-ACTIVE-ARCHIVE--'>"._QXZ("--MOST-RECENT-ACTIVE-ARCHIVE--")."</option>\n";
|
||||
$o=0;
|
||||
while ($campaigns_to_print > $o)
|
||||
{
|
||||
if ($users[$o] == $user) {echo "<option selected value=\"$users[$o]\">$users[$o] - $full_name[$o]</option>\n";}
|
||||
else {echo "<option value=\"$users[$o]\">$users[$o] - $full_name[$o]</option>\n";}
|
||||
$o++;
|
||||
}
|
||||
echo "</SELECT>\n";
|
||||
echo "<INPUT TYPE=SUBMIT NAME=SUBMIT VALUE='"._QXZ("SUBMIT")."'>\n";
|
||||
if ( ($user != '--MOST-RECENT-ACTIVE-ARCHIVE--') and ($user != '--MOST-RECENT-ACTIVE-TODAY--') )
|
||||
{echo " <a href=\"./admin.php?ADD=3&user=$user\">"._QXZ("MODIFY")."</a> \n";}
|
||||
echo "</FORM>\n\n";
|
||||
|
||||
echo "<PRE><FONT SIZE=2>\n\n";
|
||||
|
||||
|
||||
if (!$user)
|
||||
{
|
||||
echo "\n\n";
|
||||
echo _QXZ("PLEASE SELECT A USER ABOVE AND CLICK SUBMIT")."\n";
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
$multi_user=0;
|
||||
$stmt="select user,login_day,last_login_date,last_ip,failed_login_attempts_today,failed_login_count_today,failed_last_ip_today,failed_last_type_today from vicidial_user_logins_daily where user='" . mysqli_real_escape_string($link, $user) . "' order by login_day desc limit 1000;";
|
||||
if ($user == '--MOST-RECENT-ACTIVE-ARCHIVE--')
|
||||
{
|
||||
$multi_user=1;
|
||||
$stmt="select user,login_day,last_login_date,last_ip,failed_login_attempts_today,failed_login_count_today,failed_last_ip_today,failed_last_type_today from vicidial_user_logins_daily order by login_day desc, last_login_date desc limit 1000;";
|
||||
}
|
||||
if ($user == '--MOST-RECENT-ACTIVE-TODAY--')
|
||||
{
|
||||
$multi_user=1;
|
||||
$stmt="select user,'TODAY',last_login_date,last_ip,failed_login_attempts_today,failed_login_count_today,failed_last_ip_today,failed_last_type_today from vicidial_users where last_login_date >= \"$last_midnight\" order by last_login_date desc limit 1000;";
|
||||
}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$shortages_to_print = mysqli_num_rows($rslt);
|
||||
if ($shortages_to_print > 0)
|
||||
{
|
||||
echo _QXZ("User Logins Summary").":\n";
|
||||
echo "| "._QXZ("USER", 20)." ! "._QXZ("LOG DATE", 10)." ! "._QXZ("LAST LOGIN DATE", 20)." ! "._QXZ("LAST IP", 20)." ! "._QXZ("FAIL ATMPT", 10)." ! "._QXZ("FAIL COUNT", 10)." ! "._QXZ("LAST FAIL IP", 20)." ! "._QXZ("LAST FAIL TYPE", 20)." |\n";
|
||||
echo "+----------------------+------------+----------------------+----------------------+------------+------------+----------------------+----------------------+\n";
|
||||
}
|
||||
$i=0; $archive_output='';
|
||||
while ($shortages_to_print > $i)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
|
||||
$archive_output .= "| ".sprintf("%-20s", $row[0])." |";
|
||||
$archive_output .= " ".sprintf("%-10s", $row[1])." |";
|
||||
$archive_output .= " ".sprintf("%-20s", $row[2])." |";
|
||||
$archive_output .= " ".sprintf("%-20s", $row[3])." |";
|
||||
$archive_output .= " ".sprintf("%-10s", $row[4])." |";
|
||||
$archive_output .= " ".sprintf("%-10s", $row[5])." |";
|
||||
$archive_output .= " ".sprintf("%-20s", $row[6])." |";
|
||||
$archive_output .= " ".sprintf("%-20s", $row[7])." |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
if ($multi_user < 1)
|
||||
{
|
||||
$stmt="select user,'TODAY',last_login_date,last_ip,failed_login_attempts_today,failed_login_count_today,failed_last_ip_today,failed_last_type_today from vicidial_users where user='" . mysqli_real_escape_string($link, $user) . "' and last_login_date >= \"$last_midnight\" order by last_login_date desc limit 1000;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
if ($DB) {echo "$stmt\n";}
|
||||
$shortages_to_print = mysqli_num_rows($rslt);
|
||||
$i=0;
|
||||
while ($shortages_to_print > $i)
|
||||
{
|
||||
$row=mysqli_fetch_row($rslt);
|
||||
|
||||
echo "| ".sprintf("%-20s", $row[0])." |";
|
||||
echo " ".sprintf("%-10s", $row[1])." |";
|
||||
echo " ".sprintf("%-20s", $row[2])." |";
|
||||
echo " ".sprintf("%-20s", $row[3])." |";
|
||||
echo " ".sprintf("%-10s", $row[4])." |";
|
||||
echo " ".sprintf("%-10s", $row[5])." |";
|
||||
echo " ".sprintf("%-20s", $row[6])." |";
|
||||
echo " ".sprintf("%-20s", $row[7])." |\n";
|
||||
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
echo $archive_output;
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
if ($db_source == 'S')
|
||||
{
|
||||
mysqli_close($link);
|
||||
$use_slave_server=0;
|
||||
$db_source = 'M';
|
||||
require("dbconnect_mysqli.php");
|
||||
}
|
||||
|
||||
$endMS = microtime();
|
||||
$startMSary = explode(" ",$startMS);
|
||||
$endMSary = explode(" ",$endMS);
|
||||
$runS = ($endMSary[0] - $startMSary[0]);
|
||||
$runM = ($endMSary[1] - $startMSary[1]);
|
||||
$TOTALrun = ($runS + $runM);
|
||||
|
||||
$stmt="UPDATE vicidial_report_log set run_time='$TOTALrun' where report_log_id='$report_log_id';";
|
||||
if ($DB) {echo "|$stmt|\n";}
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
|
||||
?>
|
||||
|
||||
</PRE>
|
||||
|
||||
</TD></TR></TABLE>
|
||||
|
||||
</BODY></HTML>
|
||||
@@ -67,6 +67,7 @@
|
||||
# 220122-1701 - Added more variable filtering
|
||||
# 220221-0916 - Added allow_web_debug system setting
|
||||
# 220310-1427 - Fix for LOGOUT/LOGIN events sharing the same timedate
|
||||
# 220916-1744 - Added reporting section for webserver/URL logins
|
||||
#
|
||||
|
||||
$startMS = microtime();
|
||||
@@ -789,11 +790,15 @@ else
|
||||
$CSV_text2.="\""._QXZ("Agent Login and Logout Time")."\"\n";
|
||||
$CSV_text2.="\"\",\""._QXZ("EVENT")."\",\""._QXZ("DATE")."\",\""._QXZ("CAMPAIGN")."\",\""._QXZ("GROUP")."\",\""._QXZ("HOURS:MM:SS")."\",\""._QXZ("SESSION")."\",\""._QXZ("SERVER")."\",\""._QXZ("PHONE")."\",\""._QXZ("COMPUTER")."\",\""._QXZ("PHONE_LOGIN")."\",\""._QXZ("PHONE_IP")."\"\n";
|
||||
|
||||
$stmt="SELECT event,event_epoch,event_date,campaign_id,user_group,session_id,server_ip,extension,computer_ip,phone_login,phone_ip,if(event='LOGOUT' or event='TIMEOUTLOGOUT', 1, 0) as LOGpriority from ".$vicidial_user_log_table." where user='" . mysqli_real_escape_string($link, $user) . "' and event_date >= '" . mysqli_real_escape_string($link, $begin_date) . " 0:00:01' and event_date <= '" . mysqli_real_escape_string($link, $end_date) . " 23:59:59' order by event_date, LOGpriority asc;";
|
||||
$CSV_text15.="\""._QXZ("Agent Webserver and URL Login Time")."\"\n";
|
||||
$CSV_text15.="\""._QXZ("DATE")."\",\""._QXZ("CAMPAIGN")."\",\""._QXZ("GROUP")."\",\""._QXZ("DIALER SERVER")."\",\""._QXZ("WEB SERVER")."\",\""._QXZ("LOGIN URL")."\"\n";
|
||||
|
||||
$stmt="SELECT event,event_epoch,event_date,campaign_id,user_group,session_id,server_ip,extension,computer_ip,phone_login,phone_ip,if(event='LOGOUT' or event='TIMEOUTLOGOUT', 1, 0) as LOGpriority, webserver, login_url from ".$vicidial_user_log_table." where user='" . mysqli_real_escape_string($link, $user) . "' and event_date >= '" . mysqli_real_escape_string($link, $begin_date) . " 0:00:01' and event_date <= '" . mysqli_real_escape_string($link, $end_date) . " 23:59:59' order by event_date, LOGpriority asc;";
|
||||
$rslt=mysql_to_mysqli($stmt, $link);
|
||||
$events_to_print = mysqli_num_rows($rslt);
|
||||
|
||||
$total_calls=0;
|
||||
$total_logins=0;
|
||||
$o=0;
|
||||
$event_start_seconds='';
|
||||
$event_stop_seconds='';
|
||||
@@ -820,8 +825,46 @@ else
|
||||
$MAIN.="<td align=right><font size=2> $row[8] </td>\n";
|
||||
$MAIN.="<td align=right><font size=2> $row[9] </td>\n";
|
||||
$MAIN.="<td align=right><font size=2> $row[10] </td>\n";
|
||||
if ($LOGuser_level==9)
|
||||
{
|
||||
if ($total_logins%2==0)
|
||||
{$url_bgcolor='bgcolor="#'. $SSstd_row2_background .'"';}
|
||||
else
|
||||
{$url_bgcolor='bgcolor="#'. $SSstd_row1_background .'"';}
|
||||
|
||||
|
||||
$webserver_txt="";
|
||||
$url_txt="";
|
||||
if ($row[12]>0)
|
||||
{
|
||||
$webserver_stmt="select webserver, hostname from vicidial_webservers where webserver_id='$row[12]'";
|
||||
$webserver_rslt=mysql_to_mysqli($webserver_stmt, $link);
|
||||
$webserver_row=mysqli_fetch_row($webserver_rslt);
|
||||
$webserver_txt="$webserver_row[0] - $webserver_row[1]";
|
||||
$webserver_txt=preg_replace('/^\s\-\s|\s\-\s$/', '', $webserver_txt);
|
||||
}
|
||||
if ($row[13]>0)
|
||||
{
|
||||
$login_url_stmt="select url from vicidial_urls where url_id='$row[13]'";
|
||||
$login_url_rslt=mysql_to_mysqli($login_url_stmt, $link);
|
||||
$login_url_row=mysqli_fetch_row($login_url_rslt);
|
||||
$url_txt=trim("$login_url_row[0]");
|
||||
}
|
||||
|
||||
$URL_MAIN.="<tr $url_bgcolor>";
|
||||
$URL_MAIN.="<td align=right><font size=2> $row[2] </td>\n";
|
||||
$URL_MAIN.="<td align=right><font size=2> $row[3] </td>\n";
|
||||
$URL_MAIN.="<td align=right><font size=2> $row[4] </td>\n";
|
||||
$URL_MAIN.="<td align=right><font size=2> $row[6] </td>\n";
|
||||
$URL_MAIN.="<td align=right><font size=2> ".(!$webserver_txt ? " " : "$webserver_txt")." </td>\n";
|
||||
$URL_MAIN.="<td align=right><font size=2> ".(!$url_txt ? " " : "$url_txt")." </td>\n";
|
||||
$URL_MAIN.="</tr>\n";
|
||||
$CSV_text15.="\"$row[2]\",\"$row[3]\",\"$row[4]\",\"$row[6]\",\"$webserver_txt\",\"$url_txt\"\n";
|
||||
}
|
||||
$MAIN.="</tr>\n";
|
||||
$CSV_text2.="\"\",\"$row[0]\",$row[2]\",\"$row[3]\",\"$row[4]\",\"\",\"$row[5]\",\"$row[6]\",\"$row[7]\",\"$row[8]\",\"$row[9]\",\"$row[10]\"\n";
|
||||
|
||||
$total_logins++;
|
||||
}
|
||||
if (preg_match('/LOGOUT/', $row[0]))
|
||||
{
|
||||
@@ -874,6 +917,23 @@ else
|
||||
|
||||
|
||||
|
||||
##### webserver and url login records for user #####
|
||||
|
||||
if ($LOGuser_level==9)
|
||||
{
|
||||
$MAIN.="<br><br>\n";
|
||||
|
||||
$MAIN.="<center>\n";
|
||||
|
||||
$MAIN.="<FONT FACE=\"ARIAL,HELVETICA\" SIZE=3><B>"._QXZ("Agent Webserver and URL Logins").": $NWB#user_stats-agent_webserver_url_logins$NWE </FONT><FONT FACE=\"ARIAL,HELVETICA\" SIZE=2> <a href='$download_link&file_download=15'>["._QXZ("DOWNLOAD")."]</a></B></FONT>\n";
|
||||
$MAIN.="<TABLE width=800 cellspacing=0 cellpadding=1>\n";
|
||||
$MAIN.="<tr><td align=right><font size=2> "._QXZ("DATE")."</td><td align=right><font size=2> "._QXZ("CAMPAIGN")."</td><td align=right><font size=2> "._QXZ("GROUP")."</td><td align=right><font size=2>"._QXZ("DIALER SERVER")."</td><td align=right><font size=2>"._QXZ("WEB SERVER")."</td><td align=right><font size=2>"._QXZ("LOGIN URL")."</td></tr>\n";
|
||||
|
||||
$MAIN.=$URL_MAIN;
|
||||
|
||||
$MAIN.="</TABLE></center>\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
##### vicidial_timeclock log records for user #####
|
||||
|
||||
Reference in New Issue
Block a user