Skip to content
Snippets Groups Projects
Commit 27f447e0 authored by Reinhold Kainhofer's avatar Reinhold Kainhofer
Browse files

Better error message when download file is unavailable

parent 8845ebf8
Branches
Tags
No related merge requests found
BASE=downloads_for_sale BASE=downloads_for_sale
PLUGINTYPE=vmcustom PLUGINTYPE=vmcustom
VERSION=1.2 VERSION=1.3
PLUGINFILES=$(BASE).php $(BASE).script.php $(BASE).xml index.html PLUGINFILES=$(BASE).php $(BASE).script.php $(BASE).xml index.html
......
...@@ -148,7 +148,7 @@ class plgVmCustomDownloads_for_Sale extends vmCustomPlugin { ...@@ -148,7 +148,7 @@ class plgVmCustomDownloads_for_Sale extends vmCustomPlugin {
jimport('joomla.filesystem.file'); jimport('joomla.filesystem.file');
$media = $this->getDownloadFile($media_id); $media = $this->getDownloadFile($media_id);
if (!$media) { if (!$media) {
JFactory::getApplication()->enqueueMessage(JText::_('VMCUSTOM_DLSALE_ERROR_NO_FILE_SET'), 'error'); JFactory::getApplication()->enqueueMessage(JText::sprintf('VMCUSTOM_DLSALE_ERROR_MEDIA_NOT_CONFIGURED', $media_id), 'error');
return false; return false;
} }
header("Content-Type: " . $media->file_mimetype); header("Content-Type: " . $media->file_mimetype);
...@@ -156,7 +156,7 @@ class plgVmCustomDownloads_for_Sale extends vmCustomPlugin { ...@@ -156,7 +156,7 @@ class plgVmCustomDownloads_for_Sale extends vmCustomPlugin {
if (!@readfile($media->file_url)) { if (!@readfile($media->file_url)) {
header_remove("Content-Type"); header_remove("Content-Type");
header_remove("Content-Disposition"); header_remove("Content-Disposition");
JFactory::getApplication()->enqueueMessage(JText::_('VMCUSTOM_DLSALE_ERROR_NO_FILE_SET'), 'error'); JFactory::getApplication()->enqueueMessage(JText::sprintf('VMCUSTOM_DLSALE_ERROR_NO_FILE_SET', $media_id, $media->file_url), 'error');
return false; return false;
} }
JExit(); JExit();
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<authorUrl>http://www.kainhofer.com/</authorUrl> <authorUrl>http://www.kainhofer.com/</authorUrl>
<copyright>Copyright (C) 2013 Reinhold Kainhofer. All rights reserved.</copyright> <copyright>Copyright (C) 2013 Reinhold Kainhofer. All rights reserved.</copyright>
<license>http://www.gnu.org/licenses/gpl.html GNU/GPL v3+</license> <license>http://www.gnu.org/licenses/gpl.html GNU/GPL v3+</license>
<version>1.2.0</version> <version>1.3.0</version>
<description>VMCUSTOM_DLSALE_DESC</description> <description>VMCUSTOM_DLSALE_DESC</description>
<files> <files>
<filename plugin="downloads_for_sale">downloads_for_sale.php</filename> <filename plugin="downloads_for_sale">downloads_for_sale.php</filename>
......
...@@ -26,7 +26,8 @@ VMCUSTOM_DLSALE_DOWNLOAD_FILE="Datei zum Download" ...@@ -26,7 +26,8 @@ VMCUSTOM_DLSALE_DOWNLOAD_FILE="Datei zum Download"
VMCUSTOM_DLSALE_ERROR_NOT_AUTHORIZED="Nicht zum Download authorisiert. Bitte loggen Sie sich als entsprechender Benutzer ein." VMCUSTOM_DLSALE_ERROR_NOT_AUTHORIZED="Nicht zum Download authorisiert. Bitte loggen Sie sich als entsprechender Benutzer ein."
VMCUSTOM_DLSALE_ERROR_CUSTOMFIELDID="Benutzerfeld-ID fehlt in der URL." VMCUSTOM_DLSALE_ERROR_CUSTOMFIELDID="Benutzerfeld-ID fehlt in der URL."
VMCUSTOM_DLSALE_ERROR_LOAD_FAILURE="Konnte Benutzerfeld-Daten nicht laden." VMCUSTOM_DLSALE_ERROR_LOAD_FAILURE="Konnte Benutzerfeld-Daten nicht laden."
VMCUSTOM_DLSALE_ERROR_NO_FILE_SET="Mediendatei ist nicht verfügbar." VMCUSTOM_DLSALE_ERROR_MEDIA_NOT_CONFIGURED="Mediendatei nicht konfiguriert (ID=%s)."
VMCUSTOM_DLSALE_ERROR_NO_FILE_SET="Mediendatei ist nicht verfügbar (ID=%s)."
VMCUSTOM_DLSALE_ERROR_ORDER_NOT_FOUND="Konnte die Bestellungsinformationen nicht in der Datenbank finden." VMCUSTOM_DLSALE_ERROR_ORDER_NOT_FOUND="Konnte die Bestellungsinformationen nicht in der Datenbank finden."
VMCUSTOM_DLSALE_ERROR_WRONG_PASSWD="Ungültige Bestellungsnummer und/oder Passwort." VMCUSTOM_DLSALE_ERROR_WRONG_PASSWD="Ungültige Bestellungsnummer und/oder Passwort."
VMCUSTOM_DLSALE_ERROR_STATUS_NOT_AUTHORIZED="Bestellungsstatus erlaubt keinen Download." VMCUSTOM_DLSALE_ERROR_STATUS_NOT_AUTHORIZED="Bestellungsstatus erlaubt keinen Download."
......
...@@ -26,7 +26,8 @@ VMCUSTOM_DLSALE_DOWNLOAD_FILE="Download file" ...@@ -26,7 +26,8 @@ VMCUSTOM_DLSALE_DOWNLOAD_FILE="Download file"
VMCUSTOM_DLSALE_ERROR_NOT_AUTHORIZED="Not authorized to download. Please log in." VMCUSTOM_DLSALE_ERROR_NOT_AUTHORIZED="Not authorized to download. Please log in."
VMCUSTOM_DLSALE_ERROR_CUSTOMFIELDID="Custom field ID missing in the URL." VMCUSTOM_DLSALE_ERROR_CUSTOMFIELDID="Custom field ID missing in the URL."
VMCUSTOM_DLSALE_ERROR_LOAD_FAILURE="Unable to load custom field data." VMCUSTOM_DLSALE_ERROR_LOAD_FAILURE="Unable to load custom field data."
VMCUSTOM_DLSALE_ERROR_NO_FILE_SET="Media file is not available." VMCUSTOM_DLSALE_ERROR_MEDIA_NOT_CONFIGURED="Media file not configured (ID=%s)."
VMCUSTOM_DLSALE_ERROR_NO_FILE_SET="Media file is not available (ID=%s, path=%s)."
VMCUSTOM_DLSALE_ERROR_ORDER_NOT_FOUND="Unable to find order data in database." VMCUSTOM_DLSALE_ERROR_ORDER_NOT_FOUND="Unable to find order data in database."
VMCUSTOM_DLSALE_ERROR_WRONG_PASSWD="Invalid combination of order number and password." VMCUSTOM_DLSALE_ERROR_WRONG_PASSWD="Invalid combination of order number and password."
VMCUSTOM_DLSALE_ERROR_STATUS_NOT_AUTHORIZED="Order status does not allow download." VMCUSTOM_DLSALE_ERROR_STATUS_NOT_AUTHORIZED="Order status does not allow download."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment