protected function ajaxProcessReportAbuse() { if (!Tools::isSubmit('id_product_comment')) { die('0'); } if (ProductComment::isAlreadyReport(Tools::getValue('id_product_comment'), $this->context->cookie->id_customer)) { die('0'); } if (ProductComment::reportComment((int) Tools::getValue('id_product_comment'), $this->context->cookie->id_customer)) { die('1'); } die('0'); }
/* * 2015-2016 DOGS * @author J.Podracky, L.Fisher * @copyright 2015-2016 F2FCREATIVE */ // The usage of this file is deprecated !!! require_once dirname(__FILE__) . '/../../config/config.inc.php'; require_once dirname(__FILE__) . '/../../init.php'; require_once dirname(__FILE__) . '/ProductCommentCriterion.php'; include_once dirname(__FILE__) . '/ProductComment.php'; include_once dirname(__FILE__) . '/productcomments.php'; $productCom = new productcomments(); if (Tools::getValue('action') && Tools::getValue('id_product_comment') && Context::getContext()->cookie->id_customer) { if (Tools::getValue('action') == 'report') { if (!ProductComment::isAlreadyReport(Tools::getValue('id_product_comment'), Context::getContext()->cookie->id_customer) && ProductComment::reportComment((int) Tools::getValue('id_product_comment'), (int) Context::getContext()->cookie->id_customer)) { die('0'); } } else { if (Tools::getValue('action') == 'usefulness' && Tools::getValue('value') && Tools::getValue('value')) { if (!ProductComment::isAlreadyUsefulness(Tools::getValue('id_product_comment'), Context::getContext()->cookie->id_customer) && ProductComment::setCommentUsefulness((int) Tools::getValue('id_product_comment'), (bool) Tools::getValue('value'), Context::getContext()->cookie->id_customer)) { die('0'); } } } } else { if (Tools::getValue('action') && Tools::getValue('secure_key') == $productCom->secure_key) { $review = Tools::jsonDecode(Tools::getValue('review')); $id_product = 0; $content = null; $title = null;