From b09dc9264d77326d752de833ae009dccd4491e2e Mon Sep 17 00:00:00 2001 From: IgorA100 Date: Fri, 6 Feb 2026 16:43:19 +0300 Subject: [PATCH] When downloading event files, create the "ZM_DIR_EXPORTS" directory if it does not exist (download.php) --- web/ajax/modals/download.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/ajax/modals/download.php b/web/ajax/modals/download.php index 90f89f2c1..8a5f3061f 100644 --- a/web/ajax/modals/download.php +++ b/web/ajax/modals/download.php @@ -7,6 +7,15 @@ if (!canView('Events')) { return; } +if (!file_exists(ZM_DIR_EXPORTS)) { + if (!(@mkdir(ZM_DIR_EXPORTS))) { + ZM\Fatal('Can\'t create exports dir at \''.ZM_DIR_EXPORTS.'\'. Probably insufficient access rights.'); + } +} else if (is_file(ZM_DIR_EXPORTS)) { + ZM\Fatal('Instead of the \''.ZM_DIR_EXPORTS.'\' directory there is a file.'); +} +chmod(ZM_DIR_EXPORTS, 0700); + $eid = isset($_REQUEST['eid']) ? $_REQUEST['eid'] : ''; $eids = isset($_REQUEST['eids']) ? $_REQUEST['eids'] : array(); $generated = isset($_REQUEST['generated']) ? $_REQUEST['generated'] : '';