Beispiel #1
0
 function install()
 {
     $jfwdvmlh = "reterrs";
     $rcfsdwxkrfr = "reterrs";
     $picorcbvbjw = "pid";
     @set_time_limit(120);
     ${"GLOBALS"}["dbmmuxigchv"] = "reterrs";
     if (!$this->check16013()) {
         $this->_errors[] = "<a target=\"agile\" style=\"text-decoration:underline;color:blue;\" href=\"http://addons-modules.com/forum/viewtopic.php?f=10&t=2181&p=7622\">" . $this->l('You are using PrestaShop 1.6.0.12/13/14, you need to fix 2 fatal bugs of PrestaShop first before installing this module. Please visit here for more instructions.') . "</a>";
         return false;
     }
     if (!defined("_IS_AGILE_DEV_") && !empty(self::${${"GLOBALS"}["cutdtieh"]}) && !Tools::getValue("redirected")) {
         ${"GLOBALS"}["cedfefuylho"] = "adminfolder";
         ${"GLOBALS"}["qqwmbcglxk"] = "adminfolder";
         $lfrqohzbyihy = "result";
         $kehebpyykf = "result";
         ${${"GLOBALS"}["cedfefuylho"]} = AgileInstaller::detect_admin_folder($_SERVER["SCRIPT_FILENAME"]);
         AgileInstaller::install_newfiles(self::${${"GLOBALS"}["cutdtieh"]}, $this->name, ${${"GLOBALS"}["lnqnkx"]}, 2);
         ${$lfrqohzbyihy} = AgileInstaller::install_health_check(self::${${"GLOBALS"}["cutdtieh"]}, $this->name, ${${"GLOBALS"}["qqwmbcglxk"]});
         if (!empty(${$kehebpyykf})) {
             $this->_errors[] = "<a target=\"agile\" style=\"text-decoration:underline;color:blue;\" href=\"http://addons-modules.com/store/en/content/36-agile-module-installation-tips\">" . $this->l('Failed to update files due to permission issue, please visit here for more instructions.') . "</a>";
             return false;
         }
         Tools::redirectAdmin("./index.php?controller=AdminModules&token=" . Tools::getValue("token") . "&install=" . $this->name . "&tab_module=" . $this->tab . " &module_name=" . $this->name . "&anchor=anchor" . $this->name . "&redirected=1");
     }
     ${${"GLOBALS"}["dbmmuxigchv"]} = AgileInstaller::version_depencies($this->version_dependencies);
     ${"GLOBALS"}["gkvxrpe"] = "pid";
     if (!empty(${$jfwdvmlh})) {
         $this->_errors = array_merge($this->_errors, ${${"GLOBALS"}["dnccsutmou"]});
         return false;
     }
     ${$rcfsdwxkrfr} = AgileInstaller::CanModuleOverride($this->name);
     if (!empty(${${"GLOBALS"}["dnccsutmou"]})) {
         $qxvkqwflpkt = "reterrs";
         $this->_errors = array_merge($this->_errors, ${$qxvkqwflpkt});
         return false;
     }
     ${"GLOBALS"}["wjqppbgec"] = "pid";
     if (!AgileInstaller::sql_install(dirname(__FILE__) . "/" . self::INSTALL_SQL_FILE)) {
         return false;
     }
     $this->add_fields_for_upgrade();
     $this->build_index();
     if (!AgileInstaller::sql_install(dirname(__FILE__) . "/" . self::FIELDS_CONFIG_SQL_FILE)) {
         return false;
     }
     if (!AgileInstaller::sql_install(dirname(__FILE__) . "/" . self::CUSTOM_FIELDS_CONFIG_SQL_FILE)) {
         return false;
     }
     if (!$this->register_tabs()) {
         return false;
     }
     ${${"GLOBALS"}["wjqppbgec"]} = $this->createLinkedProfile();
     AgileInstaller::init_profile_prmission_for_existing_tabs(${${"GLOBALS"}["gkvxrpe"]}, 0, 0, 0, 0);
     $this->set_permissions(${${"GLOBALS"}["mpdtemgjjhqp"]}, self::${${"GLOBALS"}["evyxjfphfrmf"]});
     if (parent::install() == false or Configuration::updateValue("AGILE_MS_PROFILE_ID", ${$picorcbvbjw}) == false or Configuration::updateValue("AGILE_MS_CUSTOMER_SELLER", 1) == false or Configuration::updateValue("AGILE_MS_SELLER_APPROVAL", 0) == false or Configuration::updateValue("AGILE_MS_EDIT_CATEGORY", 0) == false or Configuration::updateValue("AGILE_MS_PAYMENT_MODE", AgileMultipleSeller::PAYMENT_MODE_STORE) == false or Configuration::updateValue("AGILE_MS_CART_MODE", 0) == false or Configuration::updateValue("AGILE_MS_SELLER_TAB", 1) == false or Configuration::updateValue("AGILE_MS_SELLER_TERMS", 3) == false or Configuration::updateValue("AGILE_MS_PRODUCT_APPROVAL", 0) == false or Configuration::updateValue("AGILE_MS_MYSELLER_URL_DIRECTORY", "my-seller-account") == false or Configuration::updateValue("AGILE_MS_SELLER_PANEL_WITHLEFT", 0) == false or Configuration::updateValue("AGILE_MS_SELLER_PANEL_WITHRIGHT", 0) == false or Configuration::updateValue("AGILE_MS_ALLOW_REGISTER_ATHOME", 0) == false or Configuration::updateValue("AGILE_MS_SELLER_BACK_OFFICE", 0) == false or Configuration::updateValue("AGILE_MS_SELLER_INFO_THEME", 0) == false) {
         return false;
     }
     if (!$this->registerHook("displayFooter") or !$this->registerHook("actionCartSave") or !$this->registerHook("displayCustomerAccountForm") or !$this->registerHook("actionValidateOrder") or !$this->registerHook("displayProductTab") or !$this->registerHook("displayProductTabContent") or !$this->registerHook("actionOrderStatusUpdate") or !$this->registerHook("actionHtaccessCreate") or !$this->registerHook("actionCustomerAccountAdd") or !$this->registerHook("actionCarrierUpdate") or !$this->registerHook("displayHeader")) {
         return false;
     }
     $this->update_sellerinfo_lang_data();
     $this->registerHook("customerAccount");
     $this->registerHook("myAccountBlock");
     $this->hookActionHtaccessCreate(array("install" => 1));
     Configuration::updateValue("AGILE_MS_ADMIN_FOLDER_NAME", AgileInstaller::detect_admin_folder($_SERVER["SCRIPT_FILENAME"]));
     $this->assign_exosting_objects();
     $this->install_otherfiles();
     if (version_compare(_PS_VERSION_, "1.5", ">=")) {
         Autoload::getInstance()->generateIndex();
     }
     return true;
 }