From 59e2930bec922c53e6fee0d13401b8fc8b840e68 Mon Sep 17 00:00:00 2001 From: alejandro-campos Date: Tue, 1 Dec 2020 13:15:48 +0100 Subject: [PATCH] fixed global declaration in meta --- .../include/functions_filemanager.php | 29 +++++++++++++------ 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/pandora_console/include/functions_filemanager.php b/pandora_console/include/functions_filemanager.php index 2ff77d74fa..c4a1fc4e5b 100644 --- a/pandora_console/include/functions_filemanager.php +++ b/pandora_console/include/functions_filemanager.php @@ -117,17 +117,16 @@ if (!function_exists('mime_content_type')) { global $config; -$homedir_filemanager = trim($config['homedir']); -$sec2 = get_parameter('sec2'); -if ($sec2 == 'enterprise/godmode/agentes/collections' || $sec2 == 'advanced/collections') { - $homedir_filemanager .= '/attachment/collection/'; -} - - function upload_file($upload_file_or_zip, $default_real_directory) { global $config; - global $homedir_filemanager; + + $homedir_filemanager = trim($config['homedir']); + $sec2 = get_parameter('sec2'); + + if ($sec2 == 'enterprise/godmode/agentes/collections' || $sec2 == 'advanced/collections') { + $homedir_filemanager .= '/attachment/collection/'; + } $config['filemanager'] = []; $config['filemanager']['correct_upload_file'] = 0; @@ -249,7 +248,13 @@ if (isset($_SERVER['CONTENT_LENGTH'])) { function create_text_file($default_real_directory) { global $config; - global $homedir_filemanager; + + $homedir_filemanager = trim($config['homedir']); + $sec2 = get_parameter('sec2'); + + if ($sec2 == 'enterprise/godmode/agentes/collections' || $sec2 == 'advanced/collections') { + $homedir_filemanager .= '/attachment/collection/'; + } $config['filemanager'] = []; $config['filemanager']['correct_upload_file'] = 0; @@ -300,6 +305,12 @@ function create_text_file($default_real_directory) } +$homedir_filemanager = trim($config['homedir']); +$sec2 = get_parameter('sec2'); +if ($sec2 == 'enterprise/godmode/agentes/collections' || $sec2 == 'advanced/collections') { + $homedir_filemanager .= '/attachment/collection/'; +} + // CREATE DIR $create_dir = (bool) get_parameter('create_dir'); if ($create_dir) {