Fixed issues with files upload

This commit is contained in:
José González 2021-08-23 15:35:47 +02:00
parent e3619915cc
commit 6358f3fc9b
2 changed files with 13 additions and 2 deletions

View File

@ -76,7 +76,7 @@ echo '<h4>'.__('Index of %s', $directory).'</h4>';
$upload_file_or_zip = (bool) get_parameter('upload_file_or_zip'); $upload_file_or_zip = (bool) get_parameter('upload_file_or_zip');
$create_text_file = (bool) get_parameter('create_text_file'); $create_text_file = (bool) get_parameter('create_text_file');
$default_real_directory = realpath($config['homedir'].'/'.$fallback_directory); $default_real_directory = realpath($config['homedir'].'/');
if ($upload_file_or_zip === true) { if ($upload_file_or_zip === true) {
upload_file($upload_file_or_zip, $default_real_directory); upload_file($upload_file_or_zip, $default_real_directory);

View File

@ -139,6 +139,13 @@ function upload_file($upload_file_or_zip, $default_real_directory)
$config['filemanager']['correct_upload_file'] = 0; $config['filemanager']['correct_upload_file'] = 0;
$config['filemanager']['message'] = null; $config['filemanager']['message'] = null;
$homedir_filemanager = trim($config['homedir']);
$sec2 = get_parameter('sec2');
if ($sec2 === 'enterprise/godmode/agentes/collections' || $sec2 === 'advanced/collections') {
$homedir_filemanager .= io_safe_output($config['attachment_store']).'/collection';
}
check_login(); check_login();
if (! check_acl($config['id_user'], 0, 'AW')) { if (! check_acl($config['id_user'], 0, 'AW')) {
@ -295,7 +302,11 @@ $create_dir = (bool) get_parameter('create_dir');
if ($create_dir === true) { if ($create_dir === true) {
global $config; global $config;
$homedir_filemanager = io_safe_output($config['attachment_store']).'/collection'; $homedir_filemanager = trim($config['homedir']);
$sec2 = get_parameter('sec2');
if ($sec2 === 'enterprise/godmode/agentes/collections' || $sec2 === 'advanced/collections') {
$homedir_filemanager .= io_safe_output($config['attachment_store']).'/collection';
}
$config['filemanager'] = []; $config['filemanager'] = [];
$config['filemanager']['correct_create_dir'] = 0; $config['filemanager']['correct_create_dir'] = 0;