Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Loader)
- *
- * @ Version : 2.0.0.3
- * @ Author : DeZender
- * @ Release on : 06.05.2013
- * @ Official site : http://DeZender.Net
- *
- */
- class ControllerModuleSimple extends Controller {
- private $_error = array();
- private $_defaultSettings = array();
- private $_settings = null;
- private $_language = null;
- public function install() {
- $this->load->model("setting/setting");
- $this->load->model("setting/store");
- $this->load->model("module/simple");
- $stores = $this->getStores();
- $this->loadDefaultSettings();
- $settings = array("simple_settings" => !$this->_defaultSettings ? ($this->_defaultSettings) : "{}", "simple_address_format" => "{firstname} {lastname}, {city}, {address_1}", "simple_replace_cart" => false, "simple_replace_checkout" => false, "simple_replace_register" => false, "simple_replace_edit" => false, "simple_replace_address" => false, "simple_module" => array(), "simple_license" => "");
- foreach ($stores as $key => $value)
- {
- $this->model_setting_setting->editSetting("simple", $settings, $value["store_id"]);
- continue;
- }
- $this->model_module_simple->createTableForCustomerFields();
- $this->model_module_simple->createTableForAddressFields();
- $this->model_module_simple->createTableForOrderFields();
- return;
- }
- private function getDomain($from) {
- if ($from == "config_http")
- {
- $domain = HTTP_CATALOG;
- }
- else
- {
- if ($from == "config_https")
- {
- $domain = HTTPS_CATALOG;
- }
- else
- {
- $domain = isset($_SERVER["SERVER_NAME"]) ? ($_SERVER["SERVER_NAME"]) : "";
- }
- }
- $domain = str_replace("https://", "", $domain);
- $domain = str_replace("http://", "", $domain);
- $domain = str_replace("www.", "", $domain);
- $pos = utf8_strpos($domain, "/");
- if ($pos)
- {
- $domain = utf8_substr($domain, 0, $pos);
- }
- if (utf8_strpos($domain, ":") !== false)
- {
- $tmp = explode(":", $domain);
- if ((!empty($tmp) || is_array($tmp)) && count($tmp) == 2 || preg_match("/^[0-9]+\$/usi", $tmp[1]))
- {
- $domain = $tmp[0];
- }
- }
- $domain = trim($domain, "/");
- return trim($domain);
- }
- private function saveLicense($value, $storeId) {
- $license = $this->config->get("simple_license");
- if (is_null($license))
- {
- $this->db->query("INSERT INTO " . DB_PREFIX . "setting SET `value` = '" . $this->db->escape($value) . "', `group` = 'simple', `key` = 'simple_license', store_id = '" . (int)$storeId . "'");
- return null;
- }
- $this->db->query("UPDATE " . DB_PREFIX . "setting SET `value` = '" . $this->db->escape($value) . "' WHERE `group` = 'simple' AND `key` = 'simple_license' AND store_id = '" . (int)$storeId . "'");
- return;
- }
- private function isLocal() {
- $domainConfigHttp = $this->getDomain("config_http");
- $domainConfigHttps = $this->getDomain("config_https");
- $domainServer = $this->getDomain("server");
- $serverAddr = isset($_SERVER["SERVER_ADDR"]) ? ($_SERVER["SERVER_ADDR"]) : "";
- $remoteAddr = isset($_SERVER["REMOTE_ADDR"]) ? ($_SERVER["REMOTE_ADDR"]) : "";
- return strpos($domainConfigHttp, ".") === false && $domainConfigHttp == $domainConfigHttps && $domainConfigHttp == $domainServer && (($serverAddr == "127.0.0.1" && $remoteAddr == "127.0.0.1") && ($serverAddr == "::1" && $remoteAddr == "::1"));
- }
- private function checkLicense() {
- if ($this->isLocal())
- {
- return true;
- }
- $domainConfigHttp = $this->getDomain("config_http");
- $domainConfigHttps = $this->getDomain("config_https");
- $domainServer = $this->getDomain("server");
- if (((($domainConfigHttp != $domainServer) && $domainConfigHttp != $domainConfigHttps) && strpos($domainServer, $domainConfigHttp) === false) && strpos($domainConfigHttp, $domainServer) === false)
- {
- return false;
- }
- return md5($domainConfigHttp . "242816f50f6d2b0020102ae1eddea927") == $this->config->get("simple_license");
- }
- .....................................................................
- ................................
- .............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement