Merge branch 'ent-7333-fallos-vista-setup' into 'develop'

Added path check to config attachment store

See merge request artica/pandorafms!4049
This commit is contained in:
Daniel Rodriguez 2021-04-27 10:34:09 +00:00
commit d9a63c4682
1 changed files with 13 additions and 1 deletions

View File

@ -200,8 +200,20 @@ function config_update_config()
$error_update[] = __('Use cert.');
}
if (!config_update_value('attachment_store', (string) get_parameter('attachment_store'))) {
$attachment_store = (string) get_parameter('attachment_store');
if (file_exists($attachment_store) === false
|| is_writable($attachment_store) === false
) {
$error_update[] = __('Attachment store');
$error_update[] .= __(
"Path doesn't exists or is not writable"
);
} else {
if (config_update_value('attachment_store', $attachment_store) === false) {
$error_update[] = __(
'Attachment store.'
);
}
}
if (!config_update_value('list_ACL_IPs_for_API', (string) get_parameter('list_ACL_IPs_for_API'))) {