Ejemplo n.º 1
0
 public function execute()
 {
     if (false === ($attach = GWF_ForumAttachment::getByID(Common::getGet('aid')))) {
         return $this->module->error('err_attach');
     }
     if (false === ($post = $attach->getPost())) {
         return $this->module->error('err_post');
     }
     $user = GWF_Session::getUser();
     if (!$post->hasViewPermission($user)) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     if (!$attach->canDownload($user)) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     return $this->templateAttach($attach, $post, $user);
 }
Ejemplo n.º 2
0
 public function execute()
 {
     if (false === ($this->attach = GWF_ForumAttachment::getByID(Common::getGet('aid', 0)))) {
         return $this->module->error('err_attach');
     }
     if (false === ($this->post = $this->attach->getPost())) {
         return $this->module->error('err_post');
     }
     if (!$this->post->hasEditPermission()) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     if (false !== Common::getPost('edit')) {
         return $this->onEdit() . $this->templateEdit();
     }
     if (false !== Common::getPost('delete')) {
         return $this->onDelete();
     }
     return $this->templateEdit();
 }