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; }
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; }
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'); }