1
0
mirror of https://github.com/e107inc/e107.git synced 2025-04-14 17:42:10 +02:00

Make sure user has appropriate rights to report a broken download

Prevents 'spam' broken download reports
This commit is contained in:
Tijn Kuyper 2019-10-29 12:56:57 +01:00
parent 8a27ac2b31
commit b01f5cbb19
No known key found for this signature in database
GPG Key ID: AAEA3CC2C5A308F2
2 changed files with 9 additions and 3 deletions

View File

@ -904,10 +904,16 @@ class download
$ns = e107::getRender();
$frm = e107::getForm();
$pref = e107::getPref();
$mes = e107::getMessage();
$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_sef = $dlrow['download_sef'];
@ -961,7 +967,6 @@ class download
}
else
{
$text = $frm->breadcrumb($breadcrumb);

View File

@ -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_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.");
?>