public function execute() { if (false === ($dl = GWF_Download::getByID(Common::getGetString('dlid')))) { return $this->module->error('err_dlid'); } if ($dl->getHashcode() !== Common::getGetString('token')) { return GWF_HTML::err('ERR_NO_PERMISSION'); } switch (Common::getGetString('action')) { case 'allow': return $this->onAllow($dl); case 'delete': return $this->onDelete($dl); case 'download': return $this->onDownload($dl); } return GWF_HTML::err('ERR_PARAMETER', array(__FILE__, __LINE__, 'action')); }
public function execute() { if (false === ($dl = GWF_Download::getByID(Common::getGet('id')))) { return $this->module->error('err_dlid'); } if (!$dl->mayEdit(GWF_Session::getUser())) { return GWF_HTML::err('ERR_NO_PERMISSION'); } if (false !== Common::getPost('edit')) { return $this->onEdit($dl); } if (false !== Common::getPost('delete')) { return $this->onDelete($dl); } if (false !== Common::getPost('reup')) { return $this->onReup($dl); } return $this->templateEdit($dl); }
public function execute() { if (false === ($dl = GWF_Download::getByID(Common::getGet('id')))) { return $this->module->error('err_dlid'); } $user = GWF_Session::getUser(); if (false !== ($error = $this->module->mayDownload($user, $dl))) { return $error; } if (false !== Common::getPost('dl_token')) { return $this->onDownloadByToken($dl, Common::getPost('token')); } if (false !== Common::getPost('on_order_2_x')) { return $this->onOrder($dl); } if (false !== ($token = Common::getGet('token'))) { return $this->templateOnDownload($dl, $token); } if ($dl->isPaidContent() && !GWF_DownloadToken::checkUser($this->module, $dl, $user)) { return $this->templatePay($dl); } return $this->templateOnDownload($dl); }