function actionDownload($iFileId) { $aFileInfo = $this->_oDb->getFileInfoByFileId((int) $iFileId); if (!$aFileInfo) { $this->_oTemplate->displayPageNotFound(); exit; } if (!$this->isAllowedDownload($aFileInfo)) { $this->_oTemplate->displayAccessDenied(); exit; } parent::_actionDownload($aFileInfo, 'media_id'); }
function actionDownload($iEntryId, $iMediaId) { $aFileInfo = $this->_oDb->getMedia((int) $iEntryId, (int) $iMediaId, 'files'); if (!$aFileInfo || !($aDataEntry = $this->_oDb->getEntryByIdAndOwner((int) $iEntryId, 0, true))) { $this->_oTemplate->displayPageNotFound(); exit; } if (!$this->isAllowedView($aDataEntry)) { $this->_oTemplate->displayAccessDenied(); exit; } parent::_actionDownload($aFileInfo, 'media_id'); }