* * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA * @copyright 2007-2016 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ class ContactControllerCore extends FrontController { public $php_self = 'contact'; public $ssl = true; /** * Start forms process * @see FrontController::postProcess() */ public function postProcess() { if (Tools::isSubmit('submitMessage')) { $saveContactKey = $this->context->cookie->contactFormKey; $extension = array('.txt', '.rtf', '.doc', '.docx', '.pdf', '.zip', '.png', '.jpeg', '.gif', '.jpg'); $file_attachment = Tools::fileAttachment('fileUpload'); $message = Tools::getValue('message'); // Html entities is not usefull, iscleanHtml check there is no bad html tags. $url = Tools::getValue('url'); if (!($from = trim(Tools::getValue('from'))) || !Validate::isEmail($from)) { $this->errors[] = Tools::displayError('Invalid email address.'); } elseif (!$message) { $this->errors[] = Tools::displayError('The message cannot be blank.'); } elseif (!Validate::isCleanHtml($message)) { $this->errors[] = Tools::displayError('Invalid message'); } elseif (!($id_contact = (int)Tools::getValue('id_contact')) || !(Validate::isLoadedObject($contact = new Contact($id_contact, $this->context->language->id)))) { $this->errors[] = Tools::displayError('Please select a subject from the list provided. '); } elseif (!empty($file_attachment['name']) && $file_attachment['error'] != 0) { $this->errors[] = Tools::displayError('An error occurred during the file-upload process.'); } elseif (!empty($file_attachment['name']) && !in_array(Tools::strtolower(substr($file_attachment['name'], -4)), $extension) && !in_array(Tools::strtolower(substr($file_attachment['name'], -5)), $extension)) { $this->errors[] = Tools::displayError('Bad file extension'); } elseif ($url === false || !empty($url) || $saveContactKey != (Tools::getValue('contactKey'))) { $this->errors[] = Tools::displayError('An error occurred while sending the message.'); } else { $customer = $this->context->customer; if (!$customer->id) { @@ -247,9 +251,13 @@ public function initContent() $this->context->smarty->assign('customerThread', $customer_thread); } $contactKey = md5(uniqid(microtime(), true)); $this->context->cookie->__set('contactFormKey', $contactKey); $this->context->smarty->assign(array( 'contacts' => Contact::getContacts($this->context->language->id), 'message' => html_entity_decode(Tools::getValue('message')) 'message' => html_entity_decode(Tools::getValue('message')), 'contactKey' => $contactKey, )); $this->setTemplate(_PS_THEME_DIR_.'contact-form.tpl'); } /** * Assign template vars related to order list and product list ordered by the customer */ protected function assignOrderList() { if ($this->context->customer->isLogged()) { $this->context->smarty->assign('isLogged', 1); $products = array(); $result = Db::getInstance()->executeS(' SELECT id_order FROM '._DB_PREFIX_.'orders WHERE id_customer = '.(int)$this->context->customer->id.Shop::addSqlRestriction(Shop::SHARE_ORDER).' ORDER BY date_add'); $orders = array(); foreach ($result as $row) { $order = new Order($row['id_order']);
Fatal error: Class 'ContactControllerCore' not found in /www/hosting/kbrk.cz/www/classes/PrestaShopAutoload.php(114) : eval()'d code on line 1