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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user