From 79316680219bf12fff3cee8a39fbeec1fc09dea8 Mon Sep 17 00:00:00 2001 From: "alejandro.campos@artica.es" Date: Tue, 19 Oct 2021 15:34:17 +0200 Subject: [PATCH] add capability to upload files in ticket creation and update on Integria integration system --- pandora_console/include/functions_integriaims.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_integriaims.php b/pandora_console/include/functions_integriaims.php index af8d8c08df..af04f5064d 100644 --- a/pandora_console/include/functions_integriaims.php +++ b/pandora_console/include/functions_integriaims.php @@ -458,8 +458,6 @@ function get_tickets_integriaims($tickets_filters) function integriaims_upload_file($filename, $incident_id, $file_description) { - hd('aqui0', true); - hd($_FILES, true); if ($_FILES[$filename]['name'] != '') { $filename = io_safe_input($_FILES[$filename]['name']); $filesize = io_safe_input($_FILES[$filename]['size']); @@ -468,9 +466,8 @@ function integriaims_upload_file($filename, $incident_id, $file_description) $invalid_extensions = '/^(bat|exe|cmd|sh|php|php1|php2|php3|php4|php5|pl|cgi|386|dll|com|torrent|js|app|jar|iso| pif|vb|vbscript|wsf|asp|cer|csr|jsp|drv|sys|ade|adp|bas|chm|cpl|crt|csh|fxp|hlp|hta|inf|ins|isp|jse|htaccess| htpasswd|ksh|lnk|mdb|mde|mdt|mdw|msc|msi|msp|mst|ops|pcd|prg|reg|scr|sct|shb|shs|url|vbe|vbs|wsc|wsf|wsh)$/i'; - hd('aqui1', true); + if (!preg_match($invalid_extensions, $extension)) { - hd('aqui2', true); // The following is if you have clamavlib installed. // (php5-clamavlib) and enabled in php.ini // http://www.howtoforge.com/scan_viruses_with_php_clamavlib @@ -484,7 +481,7 @@ function integriaims_upload_file($filename, $incident_id, $file_description) } $filecontent = base64_encode(file_get_contents($_FILES[$filename]['tmp_name'])); - hd($filecontent, true); + $result_api_call = integria_api_call(null, null, null, null, 'attach_file', [$incident_id, $filename, $filesize, $file_description, $filecontent], false, '', '|;|'); // API method returns '0' string if success.