public function initContent() { ${"GLOBALS"}["numrrlvipbq"] = "sellermessages"; parent::initContent(); ${"GLOBALS"}["wlsqmfslnmw"] = "sellermessages_nb"; ${${"GLOBALS"}["wlsqmfslnmw"]} = AgileSellerMessage::getSellerMessages($this->sellerinfo->id_seller, 0, 0, true); $hgwdfineowv = "sellermessages"; $this->pagination(${${"GLOBALS"}["xomdbo"]}); ${${"GLOBALS"}["numrrlvipbq"]} = AgileSellerMessage::getSellerMessages($this->sellerinfo->id_seller, 0, 0, false, $this->p, $this->n); self::$smarty->assign(array("seller_tab_id" => 8, "id_customer" => $this->context->customer->id, "sellermessages" => ${$hgwdfineowv}, "hide_email" => intval(Configuration::get("ASMGER_HIDE_EMAIL")))); $this->setTemplate("sellermessages.tpl"); }
private function postSellerQuestionProcess() { ${"GLOBALS"}["dobkxjwuyoz"] = "id_product"; if (!$this->active) { return; } ${"GLOBALS"}["llplcjvixp"] = "product"; $kvfeflymnmc = "fileAttachment1"; $gdohupdmgx = "id_product"; global $smarty, $cookie, $link; $fosprgukoz = "filename2"; $qsdcujfu = "filename1"; if (!Tools::isSubmit("submitSellerQuestion")) { return; } ${$kvfeflymnmc} = NULL; ${"GLOBALS"}["qlkohovaab"] = "id_product"; ${"GLOBALS"}["yxvlukxtk"] = "iso"; if (isset($_FILES["fileUpload1"]["name"]) and !empty($_FILES["fileUpload1"]["name"]) and !empty($_FILES["fileUpload1"]["tmp_name"])) { $sgeskqjmyb = "filename1"; ${$sgeskqjmyb} = uniqid() . substr($_FILES["fileUpload1"]["name"], -5); } ${"GLOBALS"}["yywsubtdhy"] = "id_seller"; ${"GLOBALS"}["sefokehhep"] = "iso"; if (isset($_FILES["fileUpload2"]["name"]) and !empty($_FILES["fileUpload2"]["name"]) and !empty($_FILES["fileUpload2"]["tmp_name"])) { $vwjkey = "filename2"; ${$vwjkey} = uniqid() . substr($_FILES["fileUpload2"]["name"], -5); } if (isset($_FILES["fileUpload3"]["name"]) and !empty($_FILES["fileUpload3"]["name"]) and !empty($_FILES["fileUpload3"]["tmp_name"])) { ${"GLOBALS"}["rdhxjqzv"] = "filename3"; ${${"GLOBALS"}["rdhxjqzv"]} = uniqid() . substr($_FILES["fileUpload3"]["name"], -5); } ${"GLOBALS"}["opdspz"] = "filename3"; ${"GLOBALS"}["orifpplublu"] = "message"; ${"GLOBALS"}["odzrfwy"] = "product"; ${${"GLOBALS"}["dobkxjwuyoz"]} = intval(Tools::getValue("id_product")); ${${"GLOBALS"}["odzrfwy"]} = new Product(${${"GLOBALS"}["qlkohovaab"]}, false, $cookie->id_lang); ${${"GLOBALS"}["yywsubtdhy"]} = AgileSellerManager::getObjectOwnerID("product", ${$gdohupdmgx}); $mhuniseayd = "folder"; ${${"GLOBALS"}["qcctnih"]} = new Employee(${${"GLOBALS"}["ihicvjpboh"]} > 0 ? ${${"GLOBALS"}["ihicvjpboh"]} : 1); $sgzneu = "from_email"; if (!Validate::isLoadedObject(${${"GLOBALS"}["qcctnih"]})) { retuen; } ${${"GLOBALS"}["orifpplublu"]} = new AgileSellerMessage(); ${"GLOBALS"}["qmxjxnymlhj"] = "folder"; $message->id_seller = AgileSellerManager::getObjectOwnerID("product", intval(Tools::getValue("id_product"))); $message->id_product = intval(Tools::getValue("id_product")); $message->id_customer = $cookie->id_customer; ${"GLOBALS"}["wwesuagw"] = "product"; $ebswejkvfel = "template"; $message->id_order = 0; ${"GLOBALS"}["hklhozy"] = "donotreply_email"; $message->is_customer_message = 1; if (intval(Configuration::get("ASMGER_APPROVAL_REQUIRED"))) { $message->active = 0; } else { $message->active = 1; } $message->id_lang = $cookie->id_lang; $message->ip_address = $_SERVER["REMOTE_ADDR"]; $message->from_email = Tools::getValue("customer_email"); $message->from_name = Tools::getValue("customer_name"); $message->subject = $this->get_message_subject(${${"GLOBALS"}["wwesuagw"]}); $message->message = strip_tags(Tools::getValue("customer_message")); if (AgileSellerMessage::hasSamePost($message->from_name, $message->ip_address, $message->message, $message->id_product)) { $this->_postErrors[] = $this->l('You can not post the same question within this time interval'); } if (Configuration::get("ASMGER_USE_CAPCHA") and strtolower($_SESSION["AntiSpamImageSellerMessage"]) != strtolower(Tools::getValue("anti_spam_code_sellermessage"))) { $this->_postErrors[] = $this->l('Text verification does not match'); } $qztsxxiddu = "folder"; if (!$message->message) { $this->_postErrors[] = $this->l('Question content is required.'); } if (!Tools::getValue("customer_name")) { $this->_postErrors[] = $this->l('Your name is required.'); } ${$mhuniseayd} = self::prepareAttFolder(intval(${${"GLOBALS"}["ihicvjpboh"]})); if (isset(${$qsdcujfu}) and rename($_FILES["fileUpload1"]["tmp_name"], ${$qztsxxiddu} . ${${"GLOBALS"}["qyyvjwslt"]})) { ${"GLOBALS"}["wkykkmfsj"] = "fname"; $qtnrdwylfl = "filename1"; ${${"GLOBALS"}["wkykkmfsj"]} = basename($_FILES["fileUpload1"]["name"]); ${"GLOBALS"}["hkvnbfeavubl"] = "fname"; $message->attshname1 = ${${"GLOBALS"}["hkvnbfeavubl"]}; $message->attpsname1 = ${$qtnrdwylfl}; } $dwrdosz = "folder"; if (isset(${$fosprgukoz}) and rename($_FILES["fileUpload2"]["tmp_name"], ${${"GLOBALS"}["qmxjxnymlhj"]} . ${${"GLOBALS"}["hxovtsmjrnp"]})) { ${${"GLOBALS"}["mclwpc"]} = basename($_FILES["fileUpload2"]["name"]); ${"GLOBALS"}["szujqfmgev"] = "fname"; $message->attshname2 = ${${"GLOBALS"}["szujqfmgev"]}; ${"GLOBALS"}["krimvxw"] = "filename2"; $message->attpsname2 = ${${"GLOBALS"}["krimvxw"]}; } if (isset(${${"GLOBALS"}["lhcvvctpfsvn"]}) and rename($_FILES["fileUpload3"]["tmp_name"], ${$dwrdosz} . ${${"GLOBALS"}["opdspz"]})) { ${"GLOBALS"}["phlqwvdbb"] = "fname"; ${"GLOBALS"}["seobnqsgxvw"] = "filename3"; ${${"GLOBALS"}["phlqwvdbb"]} = basename($_FILES["fileUpload3"]["name"]); $pbrfkehwo = "fname"; $message->attshname3 = ${$pbrfkehwo}; $message->attpsname3 = ${${"GLOBALS"}["seobnqsgxvw"]}; } if (!empty($this->_postErrors)) { return; } $message->save(); $ajezwxxmb = "templateVars"; ${${"GLOBALS"}["hklhozy"]} = Configuration::get("ASMGER_DONOTREPLY_EMAIL"); ${"GLOBALS"}["kblgpmqec"] = "subject"; ${"GLOBALS"}["jkcvivwfif"] = "product"; ${${"GLOBALS"}["swryjfvdb"]} = intval(Configuration::get("ASMGER_HIDE_EMAIL")); if (${${"GLOBALS"}["swryjfvdb"]}) { ${${"GLOBALS"}["hwmgcsiehbfr"]} = ${${"GLOBALS"}["onxgkz"]}; } else { ${${"GLOBALS"}["hwmgcsiehbfr"]} = $message->from_email; } ${"GLOBALS"}["syhtehhpk"] = "template"; ${${"GLOBALS"}["llplcjvixp"]} = new Product($message->id_product, false, $cookie->id_lang); ${${"GLOBALS"}["vqsvjvnyrtt"]} = $this->get_message_subject(${${"GLOBALS"}["jkcvivwfif"]}); ${${"GLOBALS"}["ppciqc"]} = "mtoseller"; ${${"GLOBALS"}["rndqhylugl"]} = array("{from_email}" => ${${"GLOBALS"}["hwmgcsiehbfr"]}, "{customer_name}" => $message->from_name, "{shop_name}" => Configuration::get("PS_SHOP_NAME"), "{shop_url}" => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__, "{product_name}" => $product->name, "{product_link}" => $link->getProductLink($message->id_product), "{message}" => $message->message); ${${"GLOBALS"}["ohoeks"]} = $cookie->id_lang; ${${"GLOBALS"}["yxvlukxtk"]} = Language::getIsoById((int) ${${"GLOBALS"}["ohoeks"]}); if (file_exists(dirname(__FILE__) . "/mails/" . ${${"GLOBALS"}["rlbydnmfxrw"]} . "/" . ${${"GLOBALS"}["ppciqc"]} . ".txt") and file_exists(dirname(__FILE__) . "/mails/" . ${${"GLOBALS"}["sefokehhep"]} . "/" . ${$ebswejkvfel} . ".html")) { Mail::Send(${${"GLOBALS"}["ohoeks"]}, ${${"GLOBALS"}["syhtehhpk"]}, ${${"GLOBALS"}["kblgpmqec"]}, ${$ajezwxxmb}, $seller->email, NULL, ${$sgzneu}, $message->from_name, NULL, NULL, dirname(__FILE__) . "/mails/"); } if (intval(Configuration::get("ASMGER_EMAIL_COPYADMIN")) > 0) { ${"GLOBALS"}["admxdw"] = "template"; ${"GLOBALS"}["rhhzhlpmgg"] = "iso"; ${"GLOBALS"}["mgvffxloyz"] = "template"; ${"GLOBALS"}["dqotcou"] = "iso"; ${"GLOBALS"}["yrbvprtgmm"] = "id_lang"; if (file_exists(dirname(__FILE__) . "/mails/" . ${${"GLOBALS"}["rhhzhlpmgg"]} . "/" . ${${"GLOBALS"}["ppciqc"]} . ".txt") and file_exists(dirname(__FILE__) . "/mails/" . ${${"GLOBALS"}["dqotcou"]} . "/" . ${${"GLOBALS"}["admxdw"]} . ".html")) { Mail::Send(${${"GLOBALS"}["yrbvprtgmm"]}, ${${"GLOBALS"}["mgvffxloyz"]}, ${${"GLOBALS"}["vqsvjvnyrtt"]}, ${${"GLOBALS"}["rndqhylugl"]}, Configuration::get("PS_SHOP_EMAIL"), NULL, NULL, NULL, NULL, NULL, dirname(__FILE__) . "/mails/"); } } }