From 6b34ab0485419c06b87af6e9540b41c5a5081268 Mon Sep 17 00:00:00 2001 From: mattf Date: Mon, 6 Apr 2020 04:36:54 +0000 Subject: [PATCH] Fix for Remote Agents where user deleted in admin.php git-svn-id: svn://192.168.202.10@3216 3d104415-ff17-0410-8863-d5cf3c621b8a --- www/vicidial/admin.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/www/vicidial/admin.php b/www/vicidial/admin.php index a0006561..ebdfd54b 100644 --- a/www/vicidial/admin.php +++ b/www/vicidial/admin.php @@ -4645,12 +4645,13 @@ else # 200401-1448 - Added email_agent_login_link.php feature # 200405-1805 - Added entries_per_page system setting option, fixed phone relocate conf file load issue # 200405-2339 - Added warnings for inactive voicemail server +# 200406-0033 - Fix for Remote Agents where user deleted # # 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-746a'; -$build = '200405-2339'; +$admin_version = '2.14-747a'; +$build = '200406-0033'; $STARTtime = date("U"); $SQLdate = date("Y-m-d H:i:s"); @@ -19609,8 +19610,11 @@ if ($ADD==6) $stmtC="DELETE from vicidial_inbound_group_agents where user='$user';"; $rslt=mysql_to_mysqli($stmtC, $link); + $stmtD="UPDATE vicidial_remote_agents SET status='INACTIVE' where user_start='$user';"; + $rslt=mysql_to_mysqli($stmtD, $link); + ### LOG INSERTION Admin Log Table ### - $SQL_log = "$stmtA|$stmtB|$stmtC|"; + $SQL_log = "$stmtA|$stmtB|$stmtC|$stmtD|"; $SQL_log = preg_replace('/;/', '', $SQL_log); $SQL_log = addslashes($SQL_log); $stmt="INSERT INTO vicidial_admin_log set event_date='$SQLdate', user='$PHP_AUTH_USER', ip_address='$ip', event_section='USERS', event_type='DELETE', record_id='$user', event_code='ADMIN DELETE USER', event_sql=\"$SQL_log\", event_notes='';";