From a976d7dacc6d29f739930e7f669267339d4db0fe Mon Sep 17 00:00:00 2001 From: Achim Ennenbach Date: Mon, 9 Jul 2018 19:16:25 +0200 Subject: [PATCH] Fixes #2930 Added errormessage if request fails --- e107_languages/English/English.php | 1 + request.php | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/e107_languages/English/English.php b/e107_languages/English/English.php index 80d464ade..805de095f 100644 --- a/e107_languages/English/English.php +++ b/e107_languages/English/English.php @@ -115,6 +115,7 @@ define("LAN_FILES","Files"); define("LAN_SIZE", "Size"); define("LAN_VERSION", "Version"); define("LAN_DOWNLOAD", "Download"); +define("LAN_DOWNLOAD_NO_PERMISSION", "File not found or you have no permission to download this file!"); define("LAN_WEBSITE", "Website"); define("LAN_COMMENTS", "Comments"); define("LAN_LOCATION", "Location"); diff --git a/request.php b/request.php index 7acb9a38f..f772e2eb2 100644 --- a/request.php +++ b/request.php @@ -53,7 +53,14 @@ if(!empty($_GET['file'])) // eg. request.php?file=1 $row = $sql->fetch(); // $file = $tp->replaceConstants($row['media_url'],'rel'); e107::getFile()->send($row['media_url']); - } + } + else + { + require_once(HEADERF); + echo e107::getMessage()->addError(LAN_DOWNLOAD_NO_PERMISSION)->render(); + require_once(FOOTERF); + } + } elseif(e107::isInstalled('download')) //BC Legacy Support. (Downloads Plugin) {