Fix for admin logging in AST_settings_container_SQL.pl

Added --khomp-enable CLI flag to install.pl

git-svn-id: svn://192.168.202.10@3671 3d104415-ff17-0410-8863-d5cf3c621b8a
This commit is contained in:
mattf
2023-01-18 03:27:26 +00:00
parent c8bb6502f1
commit 63eaea57c4
2 changed files with 15 additions and 3 deletions
+5 -2
View File
@@ -10,10 +10,11 @@
# !!!!! IMPORTANT !!!!!
# THE SQL STATEMENTS MUST NOT CONTAIN NEWLINES OR CARRIAGE RETURNS!
#
# Copyright (C) 2016 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
# Copyright (C) 2023 Matt Florell <vicidial@gmail.com> LICENSE: AGPLv2
#
# CHANGES
# 160118-1638 - First build
# 230117-2210 - Fix for admin log issue
#
### begin parsing run-time options ###
@@ -172,7 +173,9 @@ if (length($container_sql)>5)
if (!$T) { $affected_rows = $dbhA->do($stmtA);}
if (!$Q) {print " - line $i executed, affected: $affected_rows rows\n";}
$stmtB="INSERT INTO vicidial_admin_log set event_date=NOW(), user='VDAD', ip_address='1.1.1.1', event_section='CONTAINERS', event_type='OTHER', record_id='$container', event_code='CONTAINER SQL RUN', event_sql=\"$container_lines[$i]\", event_notes='line $i executed, $affected_rows rows affected';";
$temp_lines = $container_lines[$i];
$temp_lines =~ s/"/'/gi;
$stmtB="INSERT INTO vicidial_admin_log set event_date=NOW(), user='VDAD', ip_address='1.1.1.1', event_section='CONTAINERS', event_type='OTHER', record_id='$container', event_code='CONTAINER SQL RUN', event_sql=\"$temp_lines\", event_notes='line $i executed, $affected_rows rows affected';";
if (!$T) { $Iaffected_rows = $dbhA->do($stmtB);}
if ($DBX) {print " - admin log insert debug: |$Iaffected_rows|$stmtB|\n";}
}