Ejemplo n.º 1
0
 public function validate_cmt_id($arg)
 {
     $arg = (int) $arg;
     if ($arg === 0) {
         return false;
     }
     return GWF_Comment::getByID($arg) === false ? $this->lang('err_comment') : false;
 }
Ejemplo n.º 2
0
 private function sanitize($cmt_id)
 {
     if (false === ($c = GWF_Comment::getByID($cmt_id))) {
         return $this->module->error('err_comment');
     }
     if (Common::getGetString('ctoken', '') !== $c->getHashcode()) {
         return $this->module->error('err_hashcode');
     }
     $this->comment = $c;
     return false;
 }
Ejemplo n.º 3
0
 public function execute()
 {
     if (false === ($comment = GWF_Comment::getByID(Common::getGetString('cmt_id')))) {
         return $this->module->error('err_comment');
     }
     if (false === ($comments = $comment->getComments())) {
         return $this->module->error('err_comments');
     }
     if (!$comments->canModerate(GWF_Session::getUser())) {
         return GWF_HTML::err('ERR_NO_PERMISSION');
     }
     if (false === $comment->onVisible(true)) {
         return GWF_HTML::err('ERR_DATABASE', array(__FILE__, __LINE__));
     }
     return $this->module->message('msg_visible');
 }