From 63eaea57c4c41f0188aafb3a73005a917d5acf53 Mon Sep 17 00:00:00 2001 From: mattf Date: Wed, 18 Jan 2023 03:27:26 +0000 Subject: [PATCH] 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 --- bin/AST_settings_container_SQL.pl | 7 +++++-- install.pl | 11 ++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/bin/AST_settings_container_SQL.pl b/bin/AST_settings_container_SQL.pl index 3bcbe600..a287f451 100644 --- a/bin/AST_settings_container_SQL.pl +++ b/bin/AST_settings_container_SQL.pl @@ -10,10 +10,11 @@ # !!!!! IMPORTANT !!!!! # THE SQL STATEMENTS MUST NOT CONTAIN NEWLINES OR CARRIAGE RETURNS! # -# Copyright (C) 2016 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2023 Matt Florell 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";} } diff --git a/install.pl b/install.pl index d55a59af..fb2aa1ed 100644 --- a/install.pl +++ b/install.pl @@ -2,7 +2,7 @@ # install.pl version 2.14 # -# Copyright (C) 2022 Matt Florell LICENSE: AGPLv2 +# Copyright (C) 2023 Matt Florell LICENSE: AGPLv2 # # CHANGES @@ -49,6 +49,7 @@ # 220827-2239 - Added VERM web directory # 220829-1434 - Added 'C' keepalive option # 221228-2049 - Added KhompEnabled option +# 230117-2220 - Added --khomp-enable CLI flag # ############################################ @@ -239,6 +240,7 @@ if (length($ARGV[0])>1) print " [--fastagi_log_checkforwait=60] = define FastAGI log check-for-wait seconds\n"; print " [--build_multiserver_conf] = generates conf file examples for extensions.conf and iax.conf\n"; print " [--build_phones_conf] = generates conf file examples for extensions.conf, sip.conf and iax.conf\n"; + print " [--khomp-enable] = build khomp-activated scripts during install\n"; print "\n"; exit; @@ -626,6 +628,13 @@ if (length($ARGV[0])>1) $CLIcopy_web_lang='n'; } + if ($args =~ /--khomp-enable/i) # khomp enable flag + { + $CLIVARKhompEnabled=1; + $VARKhompEnabled=1; + print " CLI Khomp enabled: YES ($CLIVARKhompEnabled|$VARKhompEnabled)\n"; + } + if ($args =~ /--fastagi_log_min_servers=/i) # CLI defined fastagi min servers { @CLIDB_minserARY = split(/--fastagi_log_min_servers=/,$args);