示例#1
1
 public function getFooter()
 {
     $parent_footer = parent::getFooter();
     if (!isset($this->order) or !Validate::isLoadedObject($this->order)) {
         return $parent_footer;
     }
     if (!Module::isInstalled('agilemultipleseller')) {
         return $parent_footer;
     }
     require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     $id_seller = AgileSellerManager::getObjectOwnerID('order', $this->order->id);
     $sellerinfo = new SellerInfo(SellerInfo::getIdBSellerId($id_seller), $this->order->id_lang);
     $id_lang = intval(Configuration::get('PS_COUNTRY_DEFAULT'));
     $this->smarty->assign(array('seller_name' => $sellerinfo->company, 'seller_address' => $sellerinfo->fulladdress($id_lang), 'seller_fax' => $sellerinfo->fax, 'seller_phone' => $sellerinfo->phone, 'sellerinfo' => $sellerinfo));
     return $this->smarty->fetch($this->getTemplate('footer'));
 }
 public function postProcess()
 {
     ${"GLOBALS"}["blpimnned"] = "id_order_seller";
     $dbodbxes = "id_order";
     ${${"GLOBALS"}["qusrvgm"]} = (int) Tools::getValue("id_order");
     if (!$this->context->customer->isLogged() && !Tools::getValue("secure_key")) {
         Tools::redirect("index.php?controller=authentication&back=my-account");
     }
     ${"GLOBALS"}["tvasln"] = "id_order";
     $jpdhpfqcj = "id_order";
     if (!(int) Configuration::get("PS_INVOICE")) {
         die(Tools::displayError("Invoices are disabled in this shop."));
     }
     if (isset(${${"GLOBALS"}["qusrvgm"]}) && Validate::isUnsignedId(${$dbodbxes})) {
         ${${"GLOBALS"}["ymjzko"]} = new Order(${$jpdhpfqcj});
     }
     if (!isset(${${"GLOBALS"}["ymjzko"]}) || !Validate::isLoadedObject(${${"GLOBALS"}["ymjzko"]})) {
         die(Tools::displayError("Invoice not found"));
     }
     ${${"GLOBALS"}["vewtbt"]} = AgileSellerManager::getObjectOwnerID("order", ${${"GLOBALS"}["tvasln"]});
     ${${"GLOBALS"}["sokafjqdei"]} = AgileSellerManager::getLinkedSellerID($this->context->customer->id);
     if (${${"GLOBALS"}["blpimnned"]} != ${${"GLOBALS"}["sokafjqdei"]}) {
         die(Tools::displayError("You do not have permission to see this invoice"));
     }
     if (Tools::isSubmit("secure_key") && $order->secure_key != Tools::getValue("secure_key")) {
         die(Tools::displayError("You do not have permission to see this invoice"));
     }
     if (!OrderState::invoiceAvailable($order->getCurrentState()) && !$order->invoice_number) {
         die(Tools::displayError("No invoice available"));
     }
     $this->order = ${${"GLOBALS"}["ymjzko"]};
 }
 private function listAllowed()
 {
     global $smarty;
     if (Module::isInstalled('agilemultipleseller')) {
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
         include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
         $id_owner = AgileSellerManager::getObjectOwnerID('product', Tools::getValue('id_product'));
         $smarty->assign(array('id_seller' => $id_owner));
         if ($id_owner > 0) {
             if (intval(Configuration::get('AGILE_MS_PRODUCT_APPROVAL')) == 1) {
                 $approved = AgileMultipleSeller::is_list_approved(Tools::getValue('id_product'));
                 if ($approved != 1) {
                     return false;
                 }
             }
             if (Module::isInstalled('agilesellerlistoptions')) {
                 include_once _PS_ROOT_DIR_ . "/modules/agilesellerlistoptions/agilesellerlistoptions.php";
                 $listoption = AgileSellerListOptions::get_product_list_option(Tools::getValue('id_product'), AgileSellerListOptions::ASLO_OPTION_LIST);
                 $liststatus = intval($listoption['status']);
                 $aslo_list_prod_id = intval(Configuration::get('ASLO_PROD_FOR_OPTION' . AgileSellerListOptions::ASLO_OPTION_LIST));
                 if ($liststatus != AgileSellerListOptions::ASLO_STATUS_IN_EFFECT && $aslo_list_prod_id != AgileSellerListOptions::ASLO_ALWAYS_FREE) {
                     return false;
                 }
             }
         }
     }
     return true;
 }
 public function init()
 {
     parent::init();
     if (!Module::isInstalled('agilemultipleseller')) {
         return;
     }
     $id_owner = AgileSellerManager::getObjectOwnerID('category', Tools::getValue('id_category'));
     $this->context->smarty->assign(array('show_assign_product_button' => (!$this->is_seller and $id_owner > 0) ? 1 : 0));
 }
 public function renderGenericForm($fields_form, $fields_value, $tpl_vars = array())
 {
     if ($fields_form['form']['form']['id_form'] == 'step_carrier_summary') {
         $fields_value['id_seller'] = AgileSellerManager::getObjectOwnerID('carrier', Tools::getValue('id_carrier'));
         if ($this->is_seller) {
             array_unshift($fields_form['form']['form']['input'], array('type' => 'hidden', 'label' => $this->l('Seller:'), 'name' => 'id_seller', 'required' => false));
         } else {
             array_unshift($fields_form['form']['form']['input'], array('type' => 'select', 'label' => $this->l('Seller:'), 'name' => 'id_seller', 'required' => false, 'default_value' => $fields_value['id_seller'], 'options' => array('query' => AgileSellerManager::getSellersNV(true, $this->l('Store Shared')), 'id' => 'id_seller', 'name' => 'name'), 'desc' => $this->l('If this is private seller data, please choose the seller. Otherwise please choose Store Shared')));
         }
     }
     return parent::renderGenericForm($fields_form, $fields_value, $tpl_vars);
 }
示例#6
0
文件: Mail.php 项目: evilscripts/gy
 public static function Send($id_lang, $template, $subject, $templateVars, $to, $toName = NULL, $from = NULL, $fromName = NULL, $fileAttachment = NULL, $modeSMTP = NULL, $templatePath = _PS_MAIL_DIR_, $die = false, $id_shop = NULL, $bcc = null)
 {
     if (Module::isInstalled('agileprepaidcredit') and $template == 'payment_error') {
         if (AgilePrepaidCredit::isPaymentErrorCausedByTokens($templateVars) > 0) {
             return true;
         }
     }
     $order_info_templates = array('order_conf', 'bankwire', 'cheque', 'new_order');
     if (Module::isInstalled('agilesellershipping') and in_array($template, $order_info_templates)) {
         AgileSellerManager::adjust_shipping_cost_carriers($templateVars);
     }
     if (Module::isInstalled('agilepickupcenter') and $template == 'order_conf') {
         require_once _PS_ROOT_DIR_ . "/modules/agilepickupcenter/agilepickupcenter.php";
         $amodule = new AgilePickupCenter();
         $templateVars = $amodule->transform_mail_data($templateVars);
         if (isset($templateVars['{carrier_email}']) and Validate::isEmail($templateVars['{carrier_email}'])) {
             parent::Send($id_lang, $template, $subject, $templateVars, $templateVars['{carrier_email}'], $toName, $from, $fromName, $fileAttachment, $modeSMTP, $templatePath, $die, $id_shop, $bcc);
         }
     }
     if (in_array($template, $order_info_templates)) {
         $shop_email = Configuration::get('PS_SHOP_EMAIL');
         if (Module::isInstalled('agilemultipleseller')) {
             require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
             $templateVars = AgileSellerManager::appendMailTemplateVars($templateVars, $id_lang);
         }
         if (Module::isInstalled('agileprepaidcredit') and in_array($template, array('bankwire', 'cheque'))) {
             require_once _PS_ROOT_DIR_ . "/modules/agileprepaidcredit/agileprepaidcredit.php";
             $templateVars = AgilePrepaidCredit::replace_amount2pay($templateVars);
         }
         parent::Send($id_lang, $template, $subject, $templateVars, $shop_email, $toName, $from, $fromName, $fileAttachment, $modeSMTP, $templatePath, $die, $id_shop, $bcc);
     }
     if (Module::isInstalled('agilemultipleseller') and $template == 'order_customer_comment') {
         $id_order = intval($templateVars['{id_order}']);
         $id_seller = AgileSellerManager::getObjectOwnerID('order', $id_order);
         $seller = new Employee($id_seller);
         parent::Send($id_lang, $template, $subject, $templateVars, $seller->email, $toName, $from, $fromName, $fileAttachment, $modeSMTP, $templatePath, $die, $id_shop, $bcc);
     }
     if (Module::isInstalled('agilemultipleseller') and $template == 'order_conf') {
         require_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/agilemultipleseller.php";
         AgileMultipleSeller::sendNewOrderMail($id_lang, $templateVars, $from, $fromName, $fileAttachment, $modeSMTP, $die, $id_shop, $bcc);
     }
     return parent::Send($id_lang, $template, $subject, $templateVars, $to, $toName, $from, $fromName, $fileAttachment, $modeSMTP, $templatePath, $die, $id_shop, $bcc);
 }
示例#7
0
 public static function getCarriers($id_lang, $active = false, $delete = false, $id_zone = false, $ids_group = NULL, $modules_filters = 1)
 {
     global $cookie, $cart;
     $carriers = parent::getCarriers($id_lang, $active, $delete, $id_zone, $ids_group, $modules_filters);
     if (!Module::isInstalled('agilemultipleseller')) {
         return $carriers;
     }
     $id_seller_for_filter = AgileSellerManager::get_id_seller_for_filter();
     if ((int) $id_seller_for_filter <= 0) {
         return $carriers;
     }
     $retCarriers = array();
     foreach ($carriers as $carrier) {
         $id_owner = AgileSellerManager::getObjectOwnerID('carrier', $carrier['id_carrier']);
         if ($id_seller_for_filter == $id_owner || $id_owner == 0) {
             $retCarriers[] = $carrier;
         }
     }
     return $retCarriers;
 }
示例#8
0
 public static function getCustomerOrders($id_customer, $showHiddenStatus = false, Context $context = null)
 {
     $res = parent::getCustomerOrders($id_customer, $showHiddenStatus, $context);
     if (!Module::isInstalled('agilemultipleseller')) {
         return $res;
     }
     if ($context == null) {
         $context = Context::getContext();
     }
     if ($context->cookie->id_employee == 0 || $context->cookie->profile != (int) Configuration::get('AGILE_MS_PROFILE_ID')) {
         return $res;
     }
     $ret = array();
     foreach ($res as $data) {
         $id_owner = AgileSellerManager::getObjectOwnerID('order', $data['id_order']);
         if ($id_owner != $context->cookie->id_employee) {
             continue;
         }
         $ret[] = $data;
     }
     return $ret;
 }
示例#9
0
 public function init()
 {
     parent::init();
     ${"GLOBALS"}["tvubeipssbhz"] = "id_product";
     $bxgngnjmt = "action";
     $this->orderBy = Tools::getValue("agile_orderby");
     $this->orderWay = Tools::getValue("agile_orderway");
     $cegzdngh = "id_product";
     ${$bxgngnjmt} = Tools::getValue("process");
     ${$cegzdngh} = Tools::getValue("id_product");
     if (isset(${${"GLOBALS"}["xmejvhmbjf"]}) && isset(${${"GLOBALS"}["tvubeipssbhz"]})) {
         ${"GLOBALS"}["qcujxbitt"] = "action";
         $ljdeuuxtnpu = "action";
         if (${${"GLOBALS"}["qcujxbitt"]} == "delete") {
             $this->sellerinfo = new SellerInfo(SellerInfo::getIdByCustomerId($this->context->customer->id), $this->context->language->id);
             if ($this->sellerinfo->id_seller > 0 and $this->sellerinfo->id_seller == AgileSellerManager::getObjectOwnerID("product", ${${"GLOBALS"}["kswjllrrkq"]})) {
                 ${"GLOBALS"}["jbichwqsqmye"] = "product";
                 $gmydjry = "product";
                 ${${"GLOBALS"}["xbssqyr"]} = new Product((int) ${${"GLOBALS"}["kswjllrrkq"]});
                 $this->beforeDelete(${${"GLOBALS"}["jbichwqsqmye"]});
                 if (!$product->delete()) {
                     $this->errors[] = Tools::displayError("Error occured during deleting the product.");
                 }
                 $this->afterDelete(${$gmydjry}, $product->id);
             } else {
                 $this->errors[] = Tools::displayError("You do not have permission to delete this product or the product is not found.");
             }
         } else {
             if (${${"GLOBALS"}["xmejvhmbjf"]} == "inactive" || ${$ljdeuuxtnpu} == "active") {
                 $gvvbmjfbht = "id_product";
                 ${${"GLOBALS"}["xbssqyr"]} = new Product((int) ${$gvvbmjfbht});
                 $product->active = !$product->active;
                 $product->update();
                 $this->sellerinfo = new SellerInfo(SellerInfo::getIdByCustomerId($this->context->customer->id), $this->context->language->id);
                 AgileSellerManager::assignObjectOwner("product", ${${"GLOBALS"}["kswjllrrkq"]}, $this->sellerinfo->id_seller);
             }
         }
     }
 }
示例#10
0
 public static function get_id_seller_for_filter()
 {
     ${"GLOBALS"}["qiiongrev"] = "product";
     ${"GLOBALS"}["yeykkaps"] = "products";
     $ikevdmetmg = "sellerinfo";
     global $cookie, $cart;
     include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     $kqcbjrlxynx = "pagename";
     ${"GLOBALS"}["umyseswefycc"] = "product";
     ${${"GLOBALS"}["wbxvbzu"]} = AgileHelper::getPageName();
     switch (${$kqcbjrlxynx}) {
         case "sellercarrierdetail.php":
         case "sellercarrierranges.php":
         case "sellercarriers.php":
             ${$ikevdmetmg} = new SellerInfo(SellerInfo::getIdByCustomerId($cookie->id_customer));
             return $sellerinfo->id_seller;
         case "sellerproductdetail.php":
         case "adminproducts.php":
             if (!Module::isInstalled("agilemultipleseller")) {
                 return 0;
             }
             if (Module::isInstalled("agilesellershipping")) {
                 return AgileSellerManager::getObjectOwnerID("product", (int) Tools::getValue("id_product"));
             } else {
                 if ((int) $cookie->id_employee > 0 and (int) $cookie->profile == (int) Configuration::get("AGILE_MS_PROFILE_ID")) {
                     return (int) $cookie->id_employee;
                 }
                 return 0;
             }
             break;
         case "admincarriers.php":
         case "adminshipping.php":
         case "adminrangeprice.php":
         case "adminrangeweight.php":
             if ((int) $cookie->id_employee > 0 and (int) $cookie->profile == (int) Configuration::get("AGILE_MS_PROFILE_ID")) {
                 return (int) $cookie->id_employee;
             }
             return 0;
         default:
             if (Module::isInstalled("agilesellershipping")) {
                 return 0;
             }
             if ((int) Configuration::get("AGILE_MS_CART_MODE") != 1) {
                 return 0;
             }
             if (!Validate::isLoadedObject(${${"GLOBALS"}["ecvudvgddzt"]})) {
                 return 0;
             }
             ${${"GLOBALS"}["jrxrnmbebk"]} = $cart->getProducts();
             if (!sizeof(${${"GLOBALS"}["jrxrnmbebk"]})) {
                 return 0;
             }
             ${${"GLOBALS"}["qiiongrev"]} = array_shift(${${"GLOBALS"}["yeykkaps"]});
             return intval(AgileSellerManager::getObjectOwnerID("product", ${${"GLOBALS"}["umyseswefycc"]}["id_product"]));
     }
 }
示例#11
0
${"GLOBALS"}["lfghcw"] = "id_seller";
$ntguafqd = "action";
require_once dirname(__FILE__) . "/../../config/config.inc.php";
require_once dirname(__FILE__) . "/../../init.php";
require_once dirname(__FILE__) . "/agilemultipleseller.php";
$tsxqgqfuyd = "action";
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
${"GLOBALS"}["lzguktzczwfp"] = "id_seller";
if (!isset(Context::getContext()->customer) || !Context::getContext()->customer->id || !Context::getContext()->customer->isLogged()) {
    die(Tools::jsonEncode(array("status" => "error", "message" => Tools::displayError("Permission denied"))));
}
${${"GLOBALS"}["lfghcw"]} = AgileSellerManager::getLinkedSellerID(Context::getContext()->customer->id);
${$rnxrpiazvd} = intval(Tools::getValue("id_product"));
${"GLOBALS"}["okfswszsrpim"] = "action";
$kjbefxe = "action";
if (${${"GLOBALS"}["lfghcw"]} > 0 and ${${"GLOBALS"}["dwydims"]} > 0 and ${${"GLOBALS"}["lzguktzczwfp"]} != AgileSellerManager::getObjectOwnerID("product", ${${"GLOBALS"}["dwydims"]})) {
    die(Tools::jsonEncode(array("status" => "error", "message" => Tools::displayError("Permission denied"))));
}
${${"GLOBALS"}["okfswszsrpim"]} = Tools::getValue("action");
$strbdkmkszb = "action";
if (${$ntguafqd} == "updateImagePosition") {
    die(ajaxProcessUpdateImagePosition());
}
if (${${"GLOBALS"}["kfciqhovvbq"]} == "deleteProductImage") {
    die(ajaxProcessDeleteProductImage());
}
if (${${"GLOBALS"}["kfciqhovvbq"]} == "UpdateCover") {
    die(ajaxProcessUpdateCover());
}
if (${$kjbefxe} == "UpdateProductImageShopAsso") {
    die(ajaxProcessUpdateProductImageShopAsso());
示例#12
0
${"GLOBALS"}["ibxcivfzq"] = "id_product";
${"GLOBALS"}["xgstnxdbghr"] = "amodule";
${"GLOBALS"}["hqbmibkbotjk"] = "cartProducts";
require_once dirname(__FILE__) . "/../../config/config.inc.php";
require_once dirname(__FILE__) . "/../../init.php";
require_once dirname(__FILE__) . "/agilemultipleseller.php";
${"GLOBALS"}["esxaacg"] = "cartProducts";
$ybpyjoj = "cart";
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
if (!${$ybpyjoj}) {
    return;
}
if (intval(Configuration::get("AGILE_MS_CART_MODE")) == AgileMultipleSeller::CART_MODE_MULTIPLE_SELLER) {
    die("OK");
}
${${"GLOBALS"}["hqbmibkbotjk"]} = $cart->getProducts();
if (empty(${${"GLOBALS"}["esxaacg"]})) {
    die("OK");
}
${"GLOBALS"}["pdipnbsi"] = "product";
${${"GLOBALS"}["xgstnxdbghr"]} = new AgileMultipleSeller();
${${"GLOBALS"}["ibxcivfzq"]} = intval(Tools::getValue("id_product"));
${${"GLOBALS"}["qzpehthyxv"]} = AgileSellerManager::getObjectOwnerID("product", ${${"GLOBALS"}["ibxcivfzq"]});
foreach (${${"GLOBALS"}["hqbmibkbotjk"]} as ${${"GLOBALS"}["pdipnbsi"]}) {
    ${"GLOBALS"}["exmfcqtbvsst"] = "id_owner";
    ${${"GLOBALS"}["lwovhblqe"]} = AgileSellerManager::getObjectOwnerID("product", ${${"GLOBALS"}["kcrxatzs"]}["id_product"]);
    if (${${"GLOBALS"}["lwovhblqe"]} != ${${"GLOBALS"}["exmfcqtbvsst"]}) {
        die($amodule->getL("ProductIsFromDifferentSellerInCart"));
    }
}
die("OK");
 public static function sendNewProductEmail($id_product)
 {
     $xggjsvkh = "configuration";
     global $cookie;
     ${"GLOBALS"}["xbjyuoys"] = "temp_folder";
     ${"GLOBALS"}["vjxxjrtfrf"] = "id_lang";
     $xinjhagz = "id_product";
     ${$xggjsvkh} = Configuration::getMultiple(array("PS_SHOP_EMAIL", "PS_SHOP_NAME"));
     if (intval(Configuration::get("AGILE_MS_PRODUCT_APPROVAL")) != 1) {
         return;
     }
     $cqsinufwsm = "companyName";
     ${"GLOBALS"}["okfxuwdv"] = "product";
     ${${"GLOBALS"}["cloygkl"]} = new Product(${${"GLOBALS"}["jcoawuufl"]}, false, $cookie->id_lang);
     $etqhqhju = "employee";
     ${${"GLOBALS"}["qdndcj"]} = AgileSellerManager::getObjectOwnerID("product", ${$xinjhagz});
     ${"GLOBALS"}["ysdqyel"] = "employee";
     $xmedjmaw = "iso";
     ${"GLOBALS"}["nuyqlbamq"] = "companyName";
     $uvjwwq = "sellerinfo";
     ${${"GLOBALS"}["ysdqyel"]} = new Employee(${${"GLOBALS"}["qdndcj"]});
     $jlkaces = "temp_folder";
     if (!Validate::isLoadedObject(${$etqhqhju}) or !Validate::isLoadedObject(${${"GLOBALS"}["okfxuwdv"]})) {
         return;
     }
     $ghlvsitdsd = "iso";
     include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     ${$uvjwwq} = new SellerInfo(SellerInfo::getIdBSellerId(${${"GLOBALS"}["qdndcj"]}), $cookie->id_lang);
     ${${"GLOBALS"}["xqwnedvrkeb"]} = $cookie->id_lang;
     ${$xmedjmaw} = Language::getIsoById(${${"GLOBALS"}["vjxxjrtfrf"]});
     ${${"GLOBALS"}["xipiacxo"]} = $sellerinfo->company;
     if (empty(${${"GLOBALS"}["nuyqlbamq"]})) {
         ${${"GLOBALS"}["xipiacxo"]} = $employee->firstName + $employee->lastName;
     }
     ${${"GLOBALS"}["tkxwrio"]} = array("{seller_company}" => ${$cqsinufwsm}, "{seller_id}" => $employee->id, "{product_name}" => $product->name, "{product_id}" => $product->id, "{shop_name}" => Configuration::get("PS_SHOP_NAME"), "{shop_url}" => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__, "{shop_logo}" => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . "img/logo.jpg");
     ${"GLOBALS"}["tzzidbejopm"] = "temp_folder";
     ${$jlkaces} = _PS_ROOT_DIR_ . "/modules/agilemultipleseller/mails/";
     if (!file_exists(${${"GLOBALS"}["tzzidbejopm"]} . ${${"GLOBALS"}["gkzsuno"]} . "/new_product.txt") or !file_exists(${${"GLOBALS"}["xbjyuoys"]} . ${${"GLOBALS"}["gkzsuno"]} . "/new_product.html")) {
         $hmfysdpkb = "iso";
         ${"GLOBALS"}["nzwsvuszmn"] = "id_lang";
         ${${"GLOBALS"}["xqwnedvrkeb"]} = (int) Configuration::get("PS_LANG_DEFAULT");
         ${$hmfysdpkb} = Language::getIsoById(${${"GLOBALS"}["nzwsvuszmn"]});
     }
     if (file_exists(${${"GLOBALS"}["qrcgvjrrwwd"]} . ${$ghlvsitdsd} . "/new_product.txt") and file_exists(${${"GLOBALS"}["qrcgvjrrwwd"]} . ${${"GLOBALS"}["gkzsuno"]} . "/new_product.html")) {
         $pnpqspg = "id_lang";
         $eoeoxctjohan = "configuration";
         $ghasalo = "templateVars";
         $folgfpf = "configuration";
         AgileMultipleSellerMailer::SendTranslateSubject(${$pnpqspg}, "new_product", ${$ghasalo}, ${$folgfpf}["PS_SHOP_EMAIL"], "Administrator", ${${"GLOBALS"}["hhrxtypttw"]}["PS_SHOP_EMAIL"], ${$eoeoxctjohan}["PS_SHOP_NAME"], NULL, NULL, ${${"GLOBALS"}["qrcgvjrrwwd"]});
     }
 }
 public function initContent()
 {
     ${"GLOBALS"}["wcbwhorf"] = "id_order";
     parent::initContent();
     if (!(${${"GLOBALS"}["tdrhijkvhp"]} = (int) Tools::getValue("id_order")) || !Validate::isUnsignedId(${${"GLOBALS"}["wcbwhorf"]})) {
         $this->errors[] = Tools::displayError("Order ID required");
     } else {
         ${"GLOBALS"}["vtkcznmlk"] = "id_customer_seller";
         ${"GLOBALS"}["bwkdjg"] = "id_order";
         ${${"GLOBALS"}["thtbvco"]} = new Order(${${"GLOBALS"}["bwkdjg"]});
         ${"GLOBALS"}["tkggscllp"] = "order";
         ${${"GLOBALS"}["gfrblyem"]} = AgileSellerManager::getObjectOwnerID("order", $order->id);
         ${${"GLOBALS"}["taultlaseq"]} = AgileSellerManager::getLinkedSellerID($this->context->customer->id);
         if (Validate::isLoadedObject(${${"GLOBALS"}["thtbvco"]}) && ${${"GLOBALS"}["gfrblyem"]} == ${${"GLOBALS"}["vtkcznmlk"]} && ${${"GLOBALS"}["taultlaseq"]} > 0) {
             $fwsweyfqnpv = "dlv_adr_fields";
             $gcjosivnd = "carrier";
             ${"GLOBALS"}["pffjtshcnb"] = "deliveryAddressFormatedValues";
             $uztnjfwuwsv = "customizedDatas";
             $uvmwhue = "addressDelivery";
             ${"GLOBALS"}["atrcjjwf"] = "carrier";
             ${"GLOBALS"}["flawpcbih"] = "products";
             ${${"GLOBALS"}["tthrzd"]} = (int) $order->getCurrentState();
             ${$gcjosivnd} = new Carrier((int) $order->id_carrier, (int) $order->id_lang);
             ${"GLOBALS"}["rovfqvkjb"] = "addressDelivery";
             ${${"GLOBALS"}["hoviucftx"]} = new Address((int) $order->id_address_invoice);
             $mjqwhmgoyrm = "customizedDatas";
             ${"GLOBALS"}["qguglflbdd"] = "dlv_adr_fields";
             $sitqckqhoebi = "inv_adr_fields";
             $vejelhbyrbl = "addressDelivery";
             ${"GLOBALS"}["zpyvneijb"] = "addressInvoice";
             $tsvbkseunn = "dlv_adr_fields";
             ${"GLOBALS"}["cdlqrupc"] = "inv_adr_fields";
             ${${"GLOBALS"}["rovfqvkjb"]} = new Address((int) $order->id_address_delivery);
             ${$sitqckqhoebi} = AddressFormat::getOrderedAddressFields($addressInvoice->id_country);
             $shfzuivbjgg = "inv_adr_fields";
             ${${"GLOBALS"}["qguglflbdd"]} = AddressFormat::getOrderedAddressFields($addressDelivery->id_country);
             ${${"GLOBALS"}["elucej"]} = AddressFormat::getFormattedAddressFieldsValues(${${"GLOBALS"}["hoviucftx"]}, ${$shfzuivbjgg});
             ${${"GLOBALS"}["pffjtshcnb"]} = AddressFormat::getFormattedAddressFieldsValues(${${"GLOBALS"}["gkxhkddsjf"]}, ${$fwsweyfqnpv});
             $tbfgtqy = "order";
             if ($order->total_discounts > 0) {
                 $this->context->smarty->assign("total_old", (double) ($order->total_paid - $order->total_discounts));
             }
             ${"GLOBALS"}["ikavgzhqpt"] = "deliveryAddressFormatedValues";
             ${${"GLOBALS"}["flawpcbih"]} = $order->getProducts();
             ${${"GLOBALS"}["gdodxcerle"]} = Product::getAllCustomizedDatas((int) $order->id_cart);
             Product::addCustomizationPrice(${${"GLOBALS"}["umrxyqn"]}, ${$mjqwhmgoyrm});
             $buaccdx = "carrier";
             ${${"GLOBALS"}["cdmray"]} = new Customer($order->id_customer);
             ${"GLOBALS"}["betrwosx"] = "products";
             ${${"GLOBALS"}["bfrxhizen"]} = $order->getCurrentOrderState();
             ${${"GLOBALS"}["sslziuxrs"]} = OrderState::getOrderStates((int) $this->context->language->id);
             ${"GLOBALS"}["bwcmquq"] = "addressInvoice";
             $this->context->smarty->assign(array("order_states" => ${${"GLOBALS"}["sslziuxrs"]}));
             $this->context->smarty->assign(array("shop_name" => strval(Configuration::get("PS_SHOP_NAME")), "order" => ${${"GLOBALS"}["thtbvco"]}, "return_allowed" => (int) $order->isReturnable(), "currency" => new Currency($order->id_currency), "order_cur_state" => (int) ${${"GLOBALS"}["tthrzd"]}, "invoiceAllowed" => (int) Configuration::get("PS_INVOICE"), "invoice" => OrderState::invoiceAvailable(${${"GLOBALS"}["tthrzd"]}) && $order->invoice_number, "order_history" => $order->getHistory($this->context->language->id, false, true), "products" => ${${"GLOBALS"}["betrwosx"]}, "discounts" => $order->getCartRules(), "carrier" => ${${"GLOBALS"}["atrcjjwf"]}, "address_invoice" => ${${"GLOBALS"}["bwcmquq"]}, "invoiceState" => Validate::isLoadedObject(${${"GLOBALS"}["zpyvneijb"]}) && $addressInvoice->id_state ? new State($addressInvoice->id_state) : false, "address_delivery" => ${$uvmwhue}, "inv_adr_fields" => ${${"GLOBALS"}["cdlqrupc"]}, "dlv_adr_fields" => ${$tsvbkseunn}, "invoiceAddressFormatedValues" => ${${"GLOBALS"}["elucej"]}, "deliveryAddressFormatedValues" => ${${"GLOBALS"}["ikavgzhqpt"]}, "deliveryState" => Validate::isLoadedObject(${${"GLOBALS"}["gkxhkddsjf"]}) && $addressDelivery->id_state ? new State($addressDelivery->id_state) : false, "is_guest" => false, "messages" => CustomerMessage::getMessagesByOrderId((int) $order->id, false), "CUSTOMIZE_FILE" => Product::CUSTOMIZE_FILE, "CUSTOMIZE_TEXTFIELD" => Product::CUSTOMIZE_TEXTFIELD, "isRecyclable" => Configuration::get("PS_RECYCLABLE_PACK"), "use_tax" => Configuration::get("PS_TAX"), "group_use_tax" => Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC, "customizedDatas" => ${$uztnjfwuwsv}));
             if ($carrier->url && $order->shipping_number) {
                 $this->context->smarty->assign("followup", str_replace("@", $order->shipping_number, $carrier->url));
             }
             $this->context->smarty->assign("HOOK_ORDERDETAILDISPLAYED", Hook::exec("displayOrderDetail", array("order" => ${${"GLOBALS"}["thtbvco"]})));
             Hook::exec("actionOrderDetail", array("carrier" => ${${"GLOBALS"}["tvqrewgc"]}, "order" => ${$tbfgtqy}));
             unset(${$buaccdx}, ${${"GLOBALS"}["hoviucftx"]}, ${$vejelhbyrbl});
         } else {
             $this->errors[] = Tools::displayError("Cannot find this order");
         }
         unset(${${"GLOBALS"}["tkggscllp"]});
     }
     self::$smarty->assign(array("seller_tab_id" => 4));
     $this->setTemplate("sellerorderdetail.tpl");
 }
示例#15
0
文件: Cart.php 项目: evilscripts/gy
 private function getTotalAmountOfSeller($products, $id_seller)
 {
     $total = 0;
     foreach ($products as $key => $product) {
         $id_owner = intval(AgileSellerManager::getObjectOwnerID('product', $product['id_product']));
         if ($id_seller != $id_owner) {
             continue;
         }
         $total += $product['price_wt'] * $product['cart_quantity'];
     }
     return $total;
 }
示例#16
0
 public function viewAccess($disable = false)
 {
     global $cookie;
     if (!Module::isInstalled('agilemultipleseller')) {
         return parent::viewAccess($disable);
     }
     $eaccess = AgileSellerManager::get_entity_access($this->table);
     if ($this->is_seller and $objid = intval(Tools::getValue('id_' . $this->table))) {
         if ($objid == $cookie->id_employee and $this->table == 'employee') {
             return true;
         }
         $id_owner = AgileSellerManager::getObjectOwnerID($this->table, $objid);
         if ($id_owner > 0 or $eaccess['is_exclusive']) {
             if (!AgileSellerManager::hasOwnership($this->table, $objid)) {
                 return false;
             }
         } else {
             if (isset($_GET['update' . $this->table])) {
                 return false;
             }
         }
     }
     return parent::viewAccess($disable);
 }
 public static function get_id_seller_for_filter()
 {
     global $cookie, $cart;
     include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     $pagename = AgileHelper::getPageName();
     switch ($pagename) {
         case 'sellercarrierdetail.php':
         case 'sellercarrierranges.php':
         case 'sellercarriers.php':
             $sellerinfo = new SellerInfo(SellerInfo::getIdByCustomerId($cookie->id_customer));
             return $sellerinfo->id_seller;
         case 'sellerproductdetail.php':
         case 'adminproducts.php':
             if (!Module::isInstalled('agilemultipleseller')) {
                 return 0;
             }
             if (Module::isInstalled('agilesellershipping')) {
                 return AgileSellerManager::getObjectOwnerID('product', (int) Tools::getValue("id_product"));
             } else {
                 if ((int) $cookie->id_employee > 0 and (int) $cookie->profile == (int) Configuration::get('AGILE_MS_PROFILE_ID')) {
                     return (int) $cookie->id_employee;
                 }
                 return 0;
             }
             break;
         case 'admincarriers.php':
         case 'adminshipping.php':
         case 'adminrangeprice.php':
         case 'adminrangeweight.php':
             if ((int) $cookie->id_employee > 0 and (int) $cookie->profile == (int) Configuration::get('AGILE_MS_PROFILE_ID')) {
                 return (int) $cookie->id_employee;
             }
             return 0;
         default:
             if (Module::isInstalled('agilesellershipping')) {
                 return 0;
             }
             if ((int) Configuration::get('AGILE_MS_CART_MODE') != 1) {
                 return 0;
             }
             if (!Validate::isLoadedObject($cart)) {
                 return 0;
             }
             $products = $cart->getProducts();
             if (!sizeof($products)) {
                 return 0;
             }
             $product = array_shift($products);
             return intval(AgileSellerManager::getObjectOwnerID('product', $product['id_product']));
     }
 }
示例#18
0
 public static function get_id_seller_for_filter()
 {
     $cqmvhxpb = "cart";
     global $cookie, $cart;
     $otkayuubyr = "products";
     $ddyjux = "products";
     $jjjtvliarvey = "product";
     include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     ${${"GLOBALS"}["dtkrspxpn"]} = AgileHelper::getPageName();
     switch (${${"GLOBALS"}["dtkrspxpn"]}) {
         case "sellercarrierdetail.php":
         case "sellercarrierranges.php":
         case "sellercarriers.php":
             ${${"GLOBALS"}["qoouzqshac"]} = new SellerInfo(SellerInfo::getIdByCustomerId($cookie->id_customer));
             return $sellerinfo->id_seller;
         case "sellerproductdetail.php":
         case "adminproducts.php":
             if (!Module::isInstalled("agilemultipleseller")) {
                 return 0;
             }
             if (Module::isInstalled("agilesellershipping")) {
                 return AgileSellerManager::getObjectOwnerID("product", (int) Tools::getValue("id_product"));
             } else {
                 if ((int) $cookie->id_employee > 0 and (int) $cookie->profile == (int) Configuration::get("AGILE_MS_PROFILE_ID")) {
                     return (int) $cookie->id_employee;
                 }
                 return 0;
             }
             break;
         case "admincarriers.php":
         case "adminshipping.php":
         case "adminrangeprice.php":
         case "adminrangeweight.php":
             if ((int) $cookie->id_employee > 0 and (int) $cookie->profile == (int) Configuration::get("AGILE_MS_PROFILE_ID")) {
                 return (int) $cookie->id_employee;
             }
             return 0;
         default:
             if (Module::isInstalled("agilesellershipping")) {
                 return 0;
             }
             if ((int) Configuration::get("AGILE_MS_CART_MODE") != 1) {
                 return 0;
             }
             if (!Validate::isLoadedObject(${$cqmvhxpb})) {
                 return 0;
             }
             ${${"GLOBALS"}["lxauxtunuqb"]} = $cart->getProducts();
             if (!sizeof(${$otkayuubyr})) {
                 return 0;
             }
             ${${"GLOBALS"}["fixxjqo"]} = array_shift(${$ddyjux});
             return intval(AgileSellerManager::getObjectOwnerID("product", ${$jjjtvliarvey}["id_product"]));
     }
 }
示例#19
0
 public function getCMSLink($cms, $alias = null, $ssl = null, $id_lang = null, $id_shop = null, $relative_protocol = false)
 {
     if (!Module::isInstalled('agilemultipleshop')) {
         return parent::getCMSLink($cms, $alias = null, $ssl = null, $id_lang = null, $id_shop, $relative_protocol);
     }
     $url_choice_cms = (int) Configuration::get('ASP_URL_CHOICE_CMS');
     if (!$id_lang) {
         $id_lang = Context::getContext()->language->id;
     }
     $id_seller = AgileSellerManager::getObjectOwnerID('cms', is_object($cms) ? $cms->id : (int) $cms);
     $url = $this->getAgileBaseUrl($url_choice_cms == 2, $id_seller, $ssl, $relative_protocol) . $this->getLangLink($id_lang, null, $id_shop);
     $dispatcher = Dispatcher::getInstance();
     if (!is_object($cms)) {
         if ($alias !== null && !$dispatcher->hasKeyword('cms_rule', $id_lang, 'meta_keywords', $id_shop) && !$dispatcher->hasKeyword('cms_rule', $id_lang, 'meta_title', $id_shop)) {
             return $url . $dispatcher->createUrl('cms_rule', $id_lang, array('id' => (int) $cms, 'rewrite' => (string) $alias), $this->allow, '', $id_shop);
         }
         $cms = new CMS($cms, $id_lang);
     }
     $params = array();
     $params['id'] = $cms->id;
     $params['rewrite'] = !$alias ? is_array($cms->link_rewrite) ? $cms->link_rewrite[(int) $id_lang] : $cms->link_rewrite : $alias;
     $params['meta_keywords'] = '';
     if (isset($cms->meta_keywords) && !empty($cms->meta_keywords)) {
         $params['meta_keywords'] = is_array($cms->meta_keywords) ? Tools::str2url($cms->meta_keywords[(int) $id_lang]) : Tools::str2url($cms->meta_keywords);
     }
     $params['meta_title'] = '';
     if (isset($cms->meta_title) && !empty($cms->meta_title)) {
         $params['meta_title'] = is_array($cms->meta_title) ? Tools::str2url($cms->meta_title[(int) $id_lang]) : Tools::str2url($cms->meta_title);
     }
     return $url . $dispatcher->createUrl('cms_rule', $id_lang, $params, $this->allow, '', $id_shop);
 }
示例#20
0
 public function init()
 {
     if (Tools::getValue("is_seller") && isset($this->context->customer) && $this->context->customer->id && $this->context->customer->isLogged() && Tools::getValue('key')) {
         $filename = str_replace("-orderdetail", "", Tools::getValue('key'));
         if (!Validate::isSha1($filename)) {
             die(Tools::displayError());
         }
         $file = _PS_DOWNLOAD_DIR_ . strval(preg_replace('/\\.{2,}/', '.', $filename));
         $id_product_download = ProductDownload::getIdFromFilename($filename);
         $product_download = new ProductDownload($id_product_download);
         $id_product = $product_download->id_product;
         $id_seller = AgileSellerManager::getLinkedSellerID($this->context->customer->id);
         if ($id_seller != AgileSellerManager::getObjectOwnerID('product', $id_product)) {
             die(Tools::displayError('No access permission'));
         }
         $filename = ProductDownload::getFilenameFromFilename($filename);
         if (empty($filename)) {
             $newFileName = Tools::getValue('filename');
             if (!empty($newFileName)) {
                 $filename = Tools::getValue('filename');
             } else {
                 $filename = 'file';
             }
         }
         if (!file_exists($file)) {
             Tools::redirect('index.php');
         }
         $mimeType = false;
         if (function_exists('finfo_open')) {
             $finfo = @finfo_open(FILEINFO_MIME);
             $mimeType = @finfo_file($finfo, $file);
             @finfo_close($finfo);
         } else {
             if (function_exists('mime_content_type')) {
                 $mimeType = @mime_content_type($file);
             } else {
                 if (function_exists('exec')) {
                     $mimeType = trim(@exec('file -b --mime-type ' . escapeshellarg($file)));
                     if (!$mimeType) {
                         $mimeType = trim(@exec('file --mime ' . escapeshellarg($file)));
                     }
                     if (!$mimeType) {
                         $mimeType = trim(@exec('file -bi ' . escapeshellarg($file)));
                     }
                 }
             }
         }
         if (empty($mimeType)) {
             $bName = basename($filename);
             $bName = explode('.', $bName);
             $bName = strtolower($bName[count($bName) - 1]);
             $mimeTypes = array('ez' => 'application/andrew-inset', 'hqx' => 'application/mac-binhex40', 'cpt' => 'application/mac-compactpro', 'doc' => 'application/msword', 'oda' => 'application/oda', 'pdf' => 'application/pdf', 'ai' => 'application/postscript', 'eps' => 'application/postscript', 'ps' => 'application/postscript', 'smi' => 'application/smil', 'smil' => 'application/smil', 'wbxml' => 'application/vnd.wap.wbxml', 'wmlc' => 'application/vnd.wap.wmlc', 'wmlsc' => 'application/vnd.wap.wmlscriptc', 'bcpio' => 'application/x-bcpio', 'vcd' => 'application/x-cdlink', 'pgn' => 'application/x-chess-pgn', 'cpio' => 'application/x-cpio', 'csh' => 'application/x-csh', 'dcr' => 'application/x-director', 'dir' => 'application/x-director', 'dxr' => 'application/x-director', 'dvi' => 'application/x-dvi', 'spl' => 'application/x-futuresplash', 'gtar' => 'application/x-gtar', 'hdf' => 'application/x-hdf', 'js' => 'application/x-javascript', 'skp' => 'application/x-koan', 'skd' => 'application/x-koan', 'skt' => 'application/x-koan', 'skm' => 'application/x-koan', 'latex' => 'application/x-latex', 'nc' => 'application/x-netcdf', 'cdf' => 'application/x-netcdf', 'sh' => 'application/x-sh', 'shar' => 'application/x-shar', 'swf' => 'application/x-shockwave-flash', 'sit' => 'application/x-stuffit', 'sv4cpio' => 'application/x-sv4cpio', 'sv4crc' => 'application/x-sv4crc', 'tar' => 'application/x-tar', 'tcl' => 'application/x-tcl', 'tex' => 'application/x-tex', 'texinfo' => 'application/x-texinfo', 'texi' => 'application/x-texinfo', 't' => 'application/x-troff', 'tr' => 'application/x-troff', 'roff' => 'application/x-troff', 'man' => 'application/x-troff-man', 'me' => 'application/x-troff-me', 'ms' => 'application/x-troff-ms', 'ustar' => 'application/x-ustar', 'src' => 'application/x-wais-source', 'xhtml' => 'application/xhtml+xml', 'xht' => 'application/xhtml+xml', 'zip' => 'application/zip', 'au' => 'audio/basic', 'snd' => 'audio/basic', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'kar' => 'audio/midi', 'mpga' => 'audio/mpeg', 'mp2' => 'audio/mpeg', 'mp3' => 'audio/mpeg', 'aif' => 'audio/x-aiff', 'aiff' => 'audio/x-aiff', 'aifc' => 'audio/x-aiff', 'm3u' => 'audio/x-mpegurl', 'ram' => 'audio/x-pn-realaudio', 'rm' => 'audio/x-pn-realaudio', 'rpm' => 'audio/x-pn-realaudio-plugin', 'ra' => 'audio/x-realaudio', 'wav' => 'audio/x-wav', 'pdb' => 'chemical/x-pdb', 'xyz' => 'chemical/x-xyz', 'bmp' => 'image/bmp', 'gif' => 'image/gif', 'ief' => 'image/ief', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'jpe' => 'image/jpeg', 'png' => 'image/png', 'tiff' => 'image/tiff', 'tif' => 'image/tif', 'djvu' => 'image/vnd.djvu', 'djv' => 'image/vnd.djvu', 'wbmp' => 'image/vnd.wap.wbmp', 'ras' => 'image/x-cmu-raster', 'pnm' => 'image/x-portable-anymap', 'pbm' => 'image/x-portable-bitmap', 'pgm' => 'image/x-portable-graymap', 'ppm' => 'image/x-portable-pixmap', 'rgb' => 'image/x-rgb', 'xbm' => 'image/x-xbitmap', 'xpm' => 'image/x-xpixmap', 'xwd' => 'image/x-windowdump', 'igs' => 'model/iges', 'iges' => 'model/iges', 'msh' => 'model/mesh', 'mesh' => 'model/mesh', 'silo' => 'model/mesh', 'wrl' => 'model/vrml', 'vrml' => 'model/vrml', 'css' => 'text/css', 'html' => 'text/html', 'htm' => 'text/html', 'asc' => 'text/plain', 'txt' => 'text/plain', 'rtx' => 'text/richtext', 'rtf' => 'text/rtf', 'sgml' => 'text/sgml', 'sgm' => 'text/sgml', 'tsv' => 'text/tab-seperated-values', 'wml' => 'text/vnd.wap.wml', 'wmls' => 'text/vnd.wap.wmlscript', 'etx' => 'text/x-setext', 'xml' => 'text/xml', 'xsl' => 'text/xml', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mpe' => 'video/mpeg', 'qt' => 'video/quicktime', 'mov' => 'video/quicktime', 'mxu' => 'video/vnd.mpegurl', 'avi' => 'video/x-msvideo', 'movie' => 'video/x-sgi-movie', 'ice' => 'x-conference-xcooltalk');
             if (isset($mimeTypes[$bName])) {
                 $mimeType = $mimeTypes[$bName];
             } else {
                 $mimeType = 'application/octet-stream';
             }
         }
         header('Content-Transfer-Encoding: binary');
         header('Content-Type: ' . $mimeType);
         header('Content-Length: ' . filesize($file));
         header('Content-Disposition: attachment; filename="' . $filename . '"');
         ob_end_flush();
         $fp = fopen($file, 'rb');
         while (!feof($fp)) {
             echo fgets($fp, 16384);
         }
         exit;
     }
     parent::init();
 }
 public static function get_id_seller_for_filter()
 {
     global $cookie, $cart;
     ${"GLOBALS"}["wquxrsphrgth"] = "products";
     include_once _PS_ROOT_DIR_ . "/modules/agilemultipleseller/SellerInfo.php";
     ${${"GLOBALS"}["ndbmvygvvo"]} = AgileHelper::getPageName();
     $euwkqll = "product";
     ${"GLOBALS"}["ooocmd"] = "cart";
     switch (${${"GLOBALS"}["ndbmvygvvo"]}) {
         case "sellercarrierdetail.php":
         case "sellercarrierranges.php":
         case "sellercarriers.php":
             ${${"GLOBALS"}["qwrpbc"]} = new SellerInfo(SellerInfo::getIdByCustomerId($cookie->id_customer));
             return $sellerinfo->id_seller;
         case "sellerproductdetail.php":
         case "adminproducts.php":
             if (!Module::isInstalled("agilemultipleseller")) {
                 return 0;
             }
             if (Module::isInstalled("agilesellershipping")) {
                 return AgileSellerManager::getObjectOwnerID("product", (int) Tools::getValue("id_product"));
             } else {
                 if ((int) $cookie->id_employee > 0 and (int) $cookie->profile == (int) Configuration::get("AGILE_MS_PROFILE_ID")) {
                     return (int) $cookie->id_employee;
                 }
                 return 0;
             }
             break;
         case "admincarriers.php":
         case "adminshipping.php":
         case "adminrangeprice.php":
         case "adminrangeweight.php":
             if ((int) $cookie->id_employee > 0 and (int) $cookie->profile == (int) Configuration::get("AGILE_MS_PROFILE_ID")) {
                 return (int) $cookie->id_employee;
             }
             return 0;
         default:
             if (Module::isInstalled("agilesellershipping")) {
                 return 0;
             }
             if ((int) Configuration::get("AGILE_MS_CART_MODE") != 1) {
                 return 0;
             }
             if (!Validate::isLoadedObject(${${"GLOBALS"}["ooocmd"]})) {
                 return 0;
             }
             ${${"GLOBALS"}["jthbfhfsfrjl"]} = $cart->getProducts();
             if (!sizeof(${${"GLOBALS"}["wquxrsphrgth"]})) {
                 return 0;
             }
             ${$euwkqll} = array_shift(${${"GLOBALS"}["jthbfhfsfrjl"]});
             return intval(AgileSellerManager::getObjectOwnerID("product", ${${"GLOBALS"}["kdwdapxs"]}["id_product"]));
     }
 }
 private function hasOwnerShip()
 {
     if ($this->id_object > 0) {
         if (!Validate::isLoadedObject($this->object)) {
             return false;
         } else {
             $bdhvealzjd = "id_product_seller";
             $qidpgxmddirk = "id_product_seller";
             ${$bdhvealzjd} = AgileSellerManager::getObjectOwnerID("product", $this->object->id);
             ${${"GLOBALS"}["kibqfcx"]} = AgileSellerManager::getLinkedSellerID($this->context->customer->id);
             if (${$qidpgxmddirk} != ${${"GLOBALS"}["kibqfcx"]} and ${${"GLOBALS"}["kibqfcx"]} > 0) {
                 return false;
             }
         }
     }
     return true;
 }
示例#23
0
 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/");
         }
     }
 }
示例#24
0
 public function processDuplicate()
 {
     if (!Module::isInstalled('agilemultipleseller')) {
         parent::processDuplicate();
     } else {
         if (Validate::isLoadedObject($product = new Product((int) Tools::getValue('id_product')))) {
             $id_product_old = $product->id;
             if (empty($product->price) && Shop::getContext() == Shop::CONTEXT_GROUP) {
                 $shops = ShopGroup::getShopsFromGroup(Shop::getContextShopGroupID());
                 foreach ($shops as $shop) {
                     if ($product->isAssociatedToShop($shop['id_shop'])) {
                         $product_price = new Product($id_product_old, false, null, $shop['id_shop']);
                         $product->price = $product_price->price;
                     }
                 }
             }
             unset($product->id);
             unset($product->id_product);
             $product->indexed = 0;
             $product->active = 0;
             if ($product->add() && Category::duplicateProductCategories($id_product_old, $product->id) && ($combination_images = Product::duplicateAttributes($id_product_old, $product->id)) !== false && GroupReduction::duplicateReduction($id_product_old, $product->id) && Product::duplicateAccessories($id_product_old, $product->id) && Product::duplicateFeatures($id_product_old, $product->id) && Product::duplicateSpecificPrices($id_product_old, $product->id) && Pack::duplicate($id_product_old, $product->id) && Product::duplicateCustomizationFields($id_product_old, $product->id) && Product::duplicateTags($id_product_old, $product->id) && Product::duplicateDownload($id_product_old, $product->id)) {
                 if ($product->hasAttributes()) {
                     Product::updateDefaultAttribute($product->id);
                 }
                 AgileSellerManager::assignObjectOwner('product', $product->id, AgileSellerManager::getObjectOwnerID('product', $id_product_old));
                 if (!Tools::getValue('noimage') && !Image::duplicateProductImages($id_product_old, $product->id, $combination_images)) {
                     $this->errors[] = Tools::displayError('An error occurred while copying images.');
                 } else {
                     Hook::exec('actionProductAdd', array('product' => $product));
                     if (in_array($product->visibility, array('both', 'search')) && Configuration::get('PS_SEARCH_INDEXATION')) {
                         Search::indexation(false, $product->id);
                     }
                     $this->redirect_after = self::$currentIndex . (Tools::getIsset('id_category') ? '&id_category=' . (int) Tools::getValue('id_category') : '') . '&conf=19&token=' . $this->token;
                 }
             } else {
                 $this->errors[] = Tools::displayError('An error occurred while creating an object.');
             }
         }
     }
 }
示例#25
0
 public static function getSellerLogoFilePath($id_order)
 {
     $sgjhhlshb = "id_order";
     $bdlfirw = "id_seller";
     ${$bdlfirw} = intval(AgileSellerManager::getObjectOwnerID("order", ${$sgjhhlshb}));
     ${${"GLOBALS"}["ngzhniutoqka"]} = self::getIdBSellerId(${${"GLOBALS"}["cmiueifue"]});
     $gmfcsouumjq = "sellerinfo";
     ${${"GLOBALS"}["bfvcihexrq"]} = new SellerInfo(${${"GLOBALS"}["ngzhniutoqka"]});
     if (!Validate::isLoadedObject(${$gmfcsouumjq})) {
         return "";
     }
     return self::seller_logo_physical_path($sellerinfo->id);
 }