Example #1
0
 public function execute()
 {
     if (false === ($this->post = GWF_ForumPost::getPost(Common::getGet('pid', 0)))) {
         return $this->module->error('err_post');
     }
     if (!$this->post->hasEditPermission()) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     if (false !== Common::getPost('add')) {
         return $this->onAdd();
     }
     return $this->templateAdd();
 }
Example #2
0
 private function sanitize()
 {
     if (false === ($this->post = $this->module->getCurrentPost())) {
         return $this->module->error('err_post');
     }
     if (false === ($this->thread = $this->module->getCurrentThread())) {
         return $this->module->error('err_thread');
     }
     if (!$this->post->hasEditPermission()) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     return false;
 }
Example #3
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();
 }