/** * Download certificate */ public function downloadCertificate() { if ($cert_id = (int) $_GET['cert_id']) { /** @var srCertificate $cert */ $cert = srCertificate::find($cert_id); if ($cert->getUserId() == $this->user->getId() && $cert->getDefinition()->getDownloadable()) { parent::downloadCertificate(); } } }