mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Make sure user has appropriate rights to report a broken download
Prevents 'spam' broken download reports
This commit is contained in:
@@ -904,10 +904,16 @@ class download
|
|||||||
$ns = e107::getRender();
|
$ns = e107::getRender();
|
||||||
$frm = e107::getForm();
|
$frm = e107::getForm();
|
||||||
$pref = e107::getPref();
|
$pref = e107::getPref();
|
||||||
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
$dlrow = $this->rows;
|
$dlrow = $this->rows;
|
||||||
|
|
||||||
|
// Check if user is allowed to make reports, and if user is allowed to view the actual download item
|
||||||
|
if(!check_class($dlrow['download_class']) || !check_class($pref['download_reportbroken']))
|
||||||
|
{
|
||||||
|
$mes->addError(LAN_dl_79);
|
||||||
|
return $ns->tablerender(LAN_PLUGIN_DOWNLOAD_NAME, $mes->render(), 'download-report', true);
|
||||||
|
}
|
||||||
|
|
||||||
$download_name = $tp->toDB($dlrow['download_name']);
|
$download_name = $tp->toDB($dlrow['download_name']);
|
||||||
$download_sef = $dlrow['download_sef'];
|
$download_sef = $dlrow['download_sef'];
|
||||||
@@ -961,7 +967,6 @@ class download
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
||||||
$text = $frm->breadcrumb($breadcrumb);
|
$text = $frm->breadcrumb($breadcrumb);
|
||||||
|
|
||||||
|
|
||||||
|
@@ -94,5 +94,6 @@ define("LAN_dl_75", "no image available ");
|
|||||||
define("LAN_dl_77", "Downloads"); // Intentional duplicate - some languages need it to be different. This is for number of downloads
|
define("LAN_dl_77", "Downloads"); // Intentional duplicate - some languages need it to be different. This is for number of downloads
|
||||||
|
|
||||||
define('LAN_dl_78', "That download has been disabled or discontinued. Please check in the [downloads area] for a more recent version.");
|
define('LAN_dl_78', "That download has been disabled or discontinued. Please check in the [downloads area] for a more recent version.");
|
||||||
|
define("LAN_dl_79", "You do not have the correct permissions to report this download item as broken.");
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Reference in New Issue
Block a user