Decoded Output

Download
<?php class Justselling_Configurator_Block_Loading extends Mage_Core_Block_Template{const PACKAGE_NAME = "productconfigurator";const MODULE_NAME = "Justselling_Configurator";const PRODUCT_ID = "3";const API_USER = 'license';const API_KEY = 'ru474r784trefugfu';const MODE_PRODUCTION = 'production';const MODE_DEVELOPMENT = 'development'; const SECURE_URL_HASH_KEY = 'aHR0cDovL3d3dy5wcm9kdWN0LWNvbmZpZ3VyYXRvci5iaXovYXBpL2luY2hvby9qc29u'; private $x0b = "";private $x0c = "";private $x0d = "";private $x0e = NULL;private $x0f = NULL;private $x10 = NULL;protected function _toHtml(){$x11 = parent::_toHtml();try {$x12 = $this->checkLicense();} catch (Exception $x13) {$x12 = false;}if (!$x12) {$x14 = $this->getNoLicenseJsHtml();$x11 = $x14 . $x11;}return $x11;}public function checkLicense(){$x15 = $this->getMageSecureUrlHashKey();$x16 =Mage::getStoreConfig(self::PACKAGE_NAME .'/general/licensekey');if (!$x16) {return 0;}$x17 = $this->getMageDomains(); $x18 = md5($x16) ;foreach ($x17 as $x19) {$x1a = gethostbyname($x19);$x18 .=md5($x19).sha1($x1a);}$this->activationString = $x18 . sha1(substr($x15, 4, 11)); $this->activationDir = $this->getActivationDir();$this->activationFile = $this->getActivationFile();if (file_exists($this->activationFile)) {$x1b = "";$x1c = fopen($this->activationFile, "r");if ($x1c) {$x1b = fgets($x1c);fclose($x1c);}if ($x1b == md5("P") .$this->activationString) {Mage::getSingleton('core/session')->setEdition("P");return 1;} elseif ($x1b == md5("U") .$this->activationString) {Mage::getSingleton('core/session')->setEdition("U");return 1;} else {if ($x1b == md5("B") .$this->activationString) {return 1;} else { $x1d = $this->httpJsonCheck($x16);return $x1d;}}} $x1d = $this->httpJsonCheck($x16);return $x1d;}private function getNoLicenseJsHtml(){$x1e = "No valid license key for magento extension: <strong>" . self::MODULE_NAME . '</strong>.<br/>Get one on <a style="color:black" href="http://www.mage-extension-store.com/">www.mage-extension-store.com</a>.';$x1f = '"text-align: center; background: red; position: absolute; top: 0; bottom: 0; width: 100%; height: 20px; padding: 20px;z-index:99999;"';$x20 = "var div = '<div style=" . $x1f . ">" . $x1e . "</div>';";$x14 = "<script type='text/javascript'>". $x20. "$$('body')[0].insert(div); 

                       </script>";return $x14;}private function getActivationDir(){return Mage::getBaseDir('var') . "/jslicense";}private function getActivationFile(){return $this->getActivationDir() . "/" . self::PACKAGE_NAME . ".txt";}private function getMagePackageName(){return self::PACKAGE_NAME;}private function getMagePackageVersion(){$x21 = self::MODULE_NAME;return (string)Mage::getConfig()->getNode()->modules->$x21->version;}private function getMageSecureUrlHashKey(){return base64_decode(self::SECURE_URL_HASH_KEY);}private function getMageVersion(){$x22 = Mage::getVersionInfo();$x23 = $x22['major'].".".$x22['minor'].".".$x22['revision'].".".$x22['patch'];return $x23;}private function getMageLocale(){$x24 = explode('_', Mage::app()->getLocale()->getLocale());return strtolower($x24[0]);}private function getMageEditionName(){if ($this->isMageProfessionalEdition())return 'professional';if ($this->isMageEnterpriseEdition())return 'enterprise';if ($this->isMageCommunityEdition())return 'community';if ($this->isMageGoEdition())return 'magento go';return 'undefined';}private function isMageGoEdition(){return class_exists('Saas_Db', false);}private function isMageProfessionalEdition(){if ($this->isMageGoEdition())return false;if (in_array('Professional_License', $this->getMageModules()))return true;return false;}private function isMageEnterpriseEdition(){if ($this->isMageGoEdition())return false;if (in_array('Enterprise_License', $this->getMageModules()))return true;return false;}private function isMageCommunityEdition(){if ($this->isMageGoEdition() || $this->isMageProfessionalEdition() || $this->isMageEnterpriseEdition())return false;return true;}private function getMageDbTables(){return Mage::getSingleton('core/resource')->getConnection('core_read')->listTables();}private function getMageDbTablesPrefix(){return ( string )Mage::getConfig()->getTablePrefix();}private function getMageDbVersion(){return Mage::getSingleton('core/resource')->getConnection('core_read')->getServerVersion();}private function getMageDbApiName(){$x25 = Mage::getSingleton('core/resource')->getConnection('core_read')->getConnection();return $x25 instanceof PDO ? $x25->getAttribute(PDO::ATTR_CLIENT_VERSION) : 'N/A';}private function getMageDbSettings(){$x26 = "SHOW VARIABLES WHERE `Variable_name` IN ('connect_timeout','wait_timeout')";$x27 = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($x26);$x28 = array();foreach ($x27 as $x29) {$x28 [$x29 ['Variable_name']] = $x29 ['Value'];}return $x28;}private function getMageDbName(){return ( string )Mage::getConfig()->getNode('global/resources/default_setup/connection/dbname');}private function getMageModules(){return array_keys(( array )Mage::getConfig()->getNode('modules')->children());}private function getMageBaseCurrency(){return ( string )Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE);}private function getMageDefaultWebsite(){if (is_null($this->defaultWebsite)) {$this->defaultWebsite = Mage::getModel('core/website')->load(1, 'is_default');if (is_null($this->defaultWebsite->getId())) {$this->defaultWebsite = Mage::getModel('core/website')->load(0);if (is_null($this->defaultWebsite->getId())) {throw new Exception ('Failed: Getting default website');}}}return $this->defaultWebsite;}private function getMageDomains(){$x2a = array();foreach (Mage::getModel('core/store')->getCollection() as $x2b) {$x2c =Mage::app()->getStore($x2b->getId())->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);$x2c = preg_replace("/http:\/\//", "", $x2c);$x2c = preg_replace("/https:\/\//", "", $x2c);$x2c = preg_replace("/\/.*$/", "", $x2c);$x2a [] = $x2c;}$x2a = array_unique($x2a);return $x2a;}private function getMageDomainsUnique(){return sizeof(array_unique($this->getMageDomains()));}private function getMageDefaultWebsiteId(){return ( int )$this->getMageDefaultWebsite()->getId();}private function getMageDefaultStoreGroup(){if (is_null($this->defaultStoreGroup)) {$x0e = $this->getMageDefaultWebsite();$x2d = $x0e->getMageDefaultGroupId();$this->defaultStoreGroup = Mage::getModel('core/store_group')->load($x2d);if (is_null($this->defaultStoreGroup->getId())) {$this->defaultStoreGroup = Mage::getModel('core/store_group')->load(0);if (is_null($this->defaultStoreGroup->getId())) {throw new Exception ('Failed: Getting default store group');}}}return $this->defaultStoreGroup;}private function getMageDefaultStoreGroupId(){return ( int )$this->getMageDefaultStoreGroup()->getId();}private function getMageDefaultStore(){if (is_null($this->defaultStore)) {$x0f = $this->getMageDefaultStoreGroup();$x2e = $x0f->getMageDefaultStoreId();$this->defaultStore = Mage::getModel('core/store')->load($x2e);if (is_null($this->defaultStore->getId())) {$this->defaultStore = Mage::getModel('core/store')->load(0);if (is_null($this->defaultStore->getId())) {throw new Exception ('Failed: Getting default store');}}}return $this->defaultStore;}private function getMageDefaultStoreId(){return ( int )$this->getMageDefaultStore()->getId();}private function isMageSingleStoreMode(){return Mage::getModel('core/store')->getCollection()->getSize() <= 2;}private function isMageMultiStoreMode(){return !$this->isMageSingleStoreMode();}private function getMageHost(){$x19 = $this->getMageDomain();return $x19 == '' ? $this->getIp() : $x19;}private function getMageDomain(){$x2f = isset ($_SERVER ['HTTP_HOST']) ? $_SERVER ['HTTP_HOST'] : NULL;if (!is_null($x2f)) {strpos($x2f, 'www.') === 0 && $x2f = substr($x2f, 4);return strtolower(trim($x2f));}return "undefined";}private function getMageIp(){$x30 = isset ($_SERVER ['SERVER_ADDR']) ? $_SERVER ['SERVER_ADDR'] : NULL;is_null($x30) && $x30 = isset ($_SERVER ['LOCAL_ADDR']) ? $_SERVER ['LOCAL_ADDR'] : NULL;if (!is_null($x30)) {return strtolower(trim($x30));}return "undefined";}private function isMageDeveloperMode(){return ( bool )Mage::getIsDeveloperMode();}private function getMageOs(){return php_uname();}private function getMagePhpVersion(){return @phpversion();}private function getMagePhpApiName(){return @php_sapi_name();}private function getMagePhpSettings(){return array('memory_limit' => $this->getMageMemoryLimit(),'max_execution_time' => @ini_get('max_execution_time'));}private function getMageMemoryLimit($x31 = true){$x32 = trim(ini_get('memory_limit'));if ($x32 == '') {return 0;}$x33 = strtolower(substr($x32, -1));switch ($x33) {case 'g' :$x32 *= 1024;case 'm' :$x32 *= 1024;case 'k' :$x32 *= 1024;}if ($x31) {$x32 /= 1024 * 1024;}return $x32;}private function getMageRequest($x34 = NULL){$x35 = array('mode' => $this->isMageDeveloperMode() ? self::MODE_DEVELOPMENT : self::MODE_PRODUCTION,'client' => array('platform' => array('edition' => $this->getMageEditionName(),'version' => $this->getMageVersion(),'os' => $this->getMageOs(),'multi' => $this->isMageMultiStoreMode(),'domains' => $this->getMageDomains(),'unique' => $this->getMageDomainsUnique()),'module' => array('name' => $this->getMagePackageName(),'version' => $this->getMagePackageVersion()),'php' => array('version' => $this->getMagePhpVersion(),'settings' => $this->getMagePhpSettings()),'location' => array('domain' => $this->getMageDomain(),'ip' => $this->getMageIp(),'base' => str_replace('index.php/', '', Mage::getBaseUrl())),'db' => array('name' => $this->getMageDbName(),'version' => $this->getMageDbVersion(),'prefix' => $this->getMageDbTablesPrefix(),'settings' => $this->getMageDbSettings()),'locale' => array('locale' => $this->getMageLocale(),'currency' => $this->getMageBaseCurrency())),'auth' => array(),'command' => $x34);return $x35;}private function httpJsonCheck($x36 = NULL){$x37 = "";$x38 = array('jsonrpc' => '2.0','method' => 'login','params' => array(self::API_USER,self::API_KEY),'id' => time());$x39 = new Zend_Http_Client ();$x39->setUri($this->getMageSecureUrlHashKey());$x39->setMethod(Zend_Http_Client::POST);$x39->setRawData(json_encode($x38));$x2c = json_decode($x39->request()->getBody());if ($x2c)$x37 = $x2c->result;if ($x37) {$x38 = array('jsonrpc' => '2.0','method' => 'call','params' => array($x37,'justselling.activatelicensev2',array('licensekey' => sprintf("%004s", self::PRODUCT_ID) . '-' .$x36,'params' => $this->getMageRequest())),'id' => time());$x39->setRawData(json_encode($x38));$x2c = json_decode($x39->request()->getBody());$x3a = $x2c->result;if ($x3a->status) {$x3b = $x3a->edition;if ($x3b == '2') {$x3b = 'P';Mage::getSingleton('core/session')->setEdition("P");Mage::getModel('core/config')->saveConfig('productconfigurator/general/edition', "Professionel ".Mage::helper("configurator")->getConfiguratorVersion());Mage::app()->getCacheInstance()->cleanType("config")->clean();} elseif ($x3b == '3') {$x3b = 'U';Mage::getSingleton('core/session')->setEdition("U");Mage::getModel('core/config')->saveConfig('productconfigurator/general/edition', "Ultimate ".Mage::helper("configurator")->getConfiguratorVersion() );Mage::app()->getCacheInstance()->cleanType("config")->clean();} else {$x3b = 'B';Mage::getSingleton('core/session')->setEdition("B");Mage::getModel('core/config')->saveConfig('productconfigurator/general/edition', "Basic ".Mage::helper("configurator")->getConfiguratorVersion() );Mage::app()->getCacheInstance()->cleanType("config")->clean();}$x18 = md5($x3b) . $this->activationString;if (!file_exists($this->activationDir)) {mkdir($this->activationDir, 0777);}$x1c = fopen($this->activationFile, "w");if (!$x1c) {Mage::getModel('core/config')->saveConfig('productconfigurator/general/edition', "Unable to write activation file, check permissions!");Mage::app()->getCacheInstance()->cleanType("config")->clean();Mage::throwException($this->__('Unable to write activation file, check permissions!'));return 0;} else {Mage::Log("activation: " . $x18);fwrite($x1c, $x18);fclose($x1c);return "ok " . var_export($x2c, true);}} else {$x3a = $x2c->result;$x3c = $x3a->message;Mage::getModel('core/config')->saveConfig('productconfigurator/general/edition', "Activation failed: ".$x3c);Mage::app()->getCacheInstance()->cleanType("config")->clean();Mage::throwException($this->__('Product configurator activation problem 02: ' . var_export($x2c, true)));return 0;}}}} ?>

Function Calls

None

Variables

None

Stats

MD51ae2bfe65fab55954cddc7b02c01374b
Eval Count0
Decode Time176 ms

Original Code

<?php class Justselling_Configurator_Block_Loading extends Mage_Core_Block_Template{const PACKAGE_NAME = "\x70r\x6f\x64\165\143tc\x6fnf\x69\147ur\141t\x6fr";const MODULE_NAME = "\x4aus\164\163\145l\x6ci\156\x67_\103\157\156\x66\151\147\x75\162\141t\x6f\x72";const PRODUCT_ID = "\x33";const API_USER = 'license';const API_KEY = 'ru474r784trefugfu';const MODE_PRODUCTION = 'production';const MODE_DEVELOPMENT = 'development'; const SECURE_URL_HASH_KEY = 'aHR0cDovL3d3dy5wcm9kdWN0LWNvbmZpZ3VyYXRvci5iaXovYXBpL2luY2hvby9qc29u'; private $x0b = "";private $x0c = "";private $x0d = "";private $x0e = NULL;private $x0f = NULL;private $x10 = NULL;protected function _toHtml(){$x11 = parent::_toHtml();try {$x12 = $this->checkLicense();} catch (Exception $x13) {$x12 = false;}if (!$x12) {$x14 = $this->getNoLicenseJsHtml();$x11 = $x14 . $x11;}return $x11;}public function checkLicense(){$x15 = $this->getMageSecureUrlHashKey();$x16 =Mage::getStoreConfig(self::PACKAGE_NAME .'/general/licensekey');if (!$x16) {return 0;}$x17 = $this->getMageDomains(); $x18 = md5($x16) ;foreach ($x17 as $x19) {$x1a = gethostbyname($x19);$x18 .=md5($x19).sha1($x1a);}$this->activationString = $x18 . sha1(substr($x15, 4, 11)); $this->activationDir = $this->getActivationDir();$this->activationFile = $this->getActivationFile();if (file_exists($this->activationFile)) {$x1b = "";$x1c = fopen($this->activationFile, "\x72");if ($x1c) {$x1b = fgets($x1c);fclose($x1c);}if ($x1b == md5("\x50") .$this->activationString) {Mage::getSingleton('core/session')->setEdition("\x50");return 1;} elseif ($x1b == md5("\125") .$this->activationString) {Mage::getSingleton('core/session')->setEdition("\125");return 1;} else {if ($x1b == md5("B") .$this->activationString) {return 1;} else { $x1d = $this->httpJsonCheck($x16);return $x1d;}}} $x1d = $this->httpJsonCheck($x16);return $x1d;}private function getNoLicenseJsHtml(){$x1e = "\x4e\157\x20\166\141lid \154\151c\145n\x73e\x20\x6b\x65\x79 fo\162\040m\141\x67\145\x6e\x74o \x65\170\x74\145nsi\x6f\156:\x20<\163t\162\x6f\x6e\147\x3e" . self::MODULE_NAME . '</strong>.<br/>Get one on <a style="color:black" href="http://www.mage-extension-store.com/">www.mage-extension-store.com</a>.';$x1f = '"text-align: center; background: red; position: absolute; top: 0; bottom: 0; width: 100%; height: 20px; padding: 20px;z-index:99999;"';$x20 = "\166\141r \144\151\x76 \075\x20'<d\151\166\040\x73\164y\154\x65\x3d" . $x1f . "\x3e" . $x1e . "\x3c/\x64\151\166>'\073";$x14 = "\x3c\x73c\162\x69\160\164\040t\x79\x70e\x3d't\x65x\164\x2fj\x61\166\x61s\143r\x69\x70\164'\x3e". $x20. "$$('\x62o\x64\x79'\x29\x5b\x30\135\x2e\x69\x6e\x73e\x72\x74\050\x64\151\166)\x3b
\x0a\x20\x20\040 \x20\040\040\040 \040\x20  \x20 \040 \040\040\x20\040 \040\x3c\057\x73crip\x74\076";return $x14;}private function getActivationDir(){return Mage::getBaseDir('var') . "\x2f\x6as\x6c\x69ce\156\163\145";}private function getActivationFile(){return $this->getActivationDir() . "\057" . self::PACKAGE_NAME . "\056\x74\x78t";}private function getMagePackageName(){return self::PACKAGE_NAME;}private function getMagePackageVersion(){$x21 = self::MODULE_NAME;return (string)Mage::getConfig()->getNode()->modules->$x21->version;}private function getMageSecureUrlHashKey(){return base64_decode(self::SECURE_URL_HASH_KEY);}private function getMageVersion(){$x22 = Mage::getVersionInfo();$x23 = $x22['major']."\x2e".$x22['minor']."\056".$x22['revision'].".".$x22['patch'];return $x23;}private function getMageLocale(){$x24 = explode('_', Mage::app()->getLocale()->getLocale());return strtolower($x24[0]);}private function getMageEditionName(){if ($this->isMageProfessionalEdition())return 'professional';if ($this->isMageEnterpriseEdition())return 'enterprise';if ($this->isMageCommunityEdition())return 'community';if ($this->isMageGoEdition())return 'magento go';return 'undefined';}private function isMageGoEdition(){return class_exists('Saas_Db', false);}private function isMageProfessionalEdition(){if ($this->isMageGoEdition())return false;if (in_array('Professional_License', $this->getMageModules()))return true;return false;}private function isMageEnterpriseEdition(){if ($this->isMageGoEdition())return false;if (in_array('Enterprise_License', $this->getMageModules()))return true;return false;}private function isMageCommunityEdition(){if ($this->isMageGoEdition() || $this->isMageProfessionalEdition() || $this->isMageEnterpriseEdition())return false;return true;}private function getMageDbTables(){return Mage::getSingleton('core/resource')->getConnection('core_read')->listTables();}private function getMageDbTablesPrefix(){return ( string )Mage::getConfig()->getTablePrefix();}private function getMageDbVersion(){return Mage::getSingleton('core/resource')->getConnection('core_read')->getServerVersion();}private function getMageDbApiName(){$x25 = Mage::getSingleton('core/resource')->getConnection('core_read')->getConnection();return $x25 instanceof PDO ? $x25->getAttribute(PDO::ATTR_CLIENT_VERSION) : 'N/A';}private function getMageDbSettings(){$x26 = "\x53\x48\117\x57\040V\101R\x49\x41\102\114E\x53\040\127\x48\105\x52\x45 \x60\126ar\x69\141\x62l\145_\x6e\x61\155\145\x60\x20\111N\x20\x28'\x63\x6f\x6en\x65\143\164\137\x74im\x65o\165\164','\x77a\151\164_\x74\x69\155\145\x6fut')";$x27 = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchAll($x26);$x28 = array();foreach ($x27 as $x29) {$x28 [$x29 ['Variable_name']] = $x29 ['Value'];}return $x28;}private function getMageDbName(){return ( string )Mage::getConfig()->getNode('global/resources/default_setup/connection/dbname');}private function getMageModules(){return array_keys(( array )Mage::getConfig()->getNode('modules')->children());}private function getMageBaseCurrency(){return ( string )Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE);}private function getMageDefaultWebsite(){if (is_null($this->defaultWebsite)) {$this->defaultWebsite = Mage::getModel('core/website')->load(1, 'is_default');if (is_null($this->defaultWebsite->getId())) {$this->defaultWebsite = Mage::getModel('core/website')->load(0);if (is_null($this->defaultWebsite->getId())) {throw new Exception ('Failed: Getting default website');}}}return $this->defaultWebsite;}private function getMageDomains(){$x2a = array();foreach (Mage::getModel('core/store')->getCollection() as $x2b) {$x2c =Mage::app()->getStore($x2b->getId())->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);$x2c = preg_replace("/h\164\164\160:\/\/\057", "", $x2c);$x2c = preg_replace("\057\150t\164\160\163\072\/\/\x2f", "", $x2c);$x2c = preg_replace("\057\/\056\x2a$\057", "", $x2c);$x2a [] = $x2c;}$x2a = array_unique($x2a);return $x2a;}private function getMageDomainsUnique(){return sizeof(array_unique($this->getMageDomains()));}private function getMageDefaultWebsiteId(){return ( int )$this->getMageDefaultWebsite()->getId();}private function getMageDefaultStoreGroup(){if (is_null($this->defaultStoreGroup)) {$x0e = $this->getMageDefaultWebsite();$x2d = $x0e->getMageDefaultGroupId();$this->defaultStoreGroup = Mage::getModel('core/store_group')->load($x2d);if (is_null($this->defaultStoreGroup->getId())) {$this->defaultStoreGroup = Mage::getModel('core/store_group')->load(0);if (is_null($this->defaultStoreGroup->getId())) {throw new Exception ('Failed: Getting default store group');}}}return $this->defaultStoreGroup;}private function getMageDefaultStoreGroupId(){return ( int )$this->getMageDefaultStoreGroup()->getId();}private function getMageDefaultStore(){if (is_null($this->defaultStore)) {$x0f = $this->getMageDefaultStoreGroup();$x2e = $x0f->getMageDefaultStoreId();$this->defaultStore = Mage::getModel('core/store')->load($x2e);if (is_null($this->defaultStore->getId())) {$this->defaultStore = Mage::getModel('core/store')->load(0);if (is_null($this->defaultStore->getId())) {throw new Exception ('Failed: Getting default store');}}}return $this->defaultStore;}private function getMageDefaultStoreId(){return ( int )$this->getMageDefaultStore()->getId();}private function isMageSingleStoreMode(){return Mage::getModel('core/store')->getCollection()->getSize() <= 2;}private function isMageMultiStoreMode(){return !$this->isMageSingleStoreMode();}private function getMageHost(){$x19 = $this->getMageDomain();return $x19 == '' ? $this->getIp() : $x19;}private function getMageDomain(){$x2f = isset ($_SERVER ['HTTP_HOST']) ? $_SERVER ['HTTP_HOST'] : NULL;if (!is_null($x2f)) {strpos($x2f, 'www.') === 0 && $x2f = substr($x2f, 4);return strtolower(trim($x2f));}return "und\x65\x66\151ned";}private function getMageIp(){$x30 = isset ($_SERVER ['SERVER_ADDR']) ? $_SERVER ['SERVER_ADDR'] : NULL;is_null($x30) && $x30 = isset ($_SERVER ['LOCAL_ADDR']) ? $_SERVER ['LOCAL_ADDR'] : NULL;if (!is_null($x30)) {return strtolower(trim($x30));}return "un\144e\146\x69\156\145\x64";}private function isMageDeveloperMode(){return ( bool )Mage::getIsDeveloperMode();}private function getMageOs(){return php_uname();}private function getMagePhpVersion(){return @phpversion();}private function getMagePhpApiName(){return @php_sapi_name();}private function getMagePhpSettings(){return array('memory_limit' => $this->getMageMemoryLimit(),'max_execution_time' => @ini_get('max_execution_time'));}private function getMageMemoryLimit($x31 = true){$x32 = trim(ini_get('memory_limit'));if ($x32 == '') {return 0;}$x33 = strtolower(substr($x32, -1));switch ($x33) {case 'g' :$x32 *= 1024;case 'm' :$x32 *= 1024;case 'k' :$x32 *= 1024;}if ($x31) {$x32 /= 1024 * 1024;}return $x32;}private function getMageRequest($x34 = NULL){$x35 = array('mode' => $this->isMageDeveloperMode() ? self::MODE_DEVELOPMENT : self::MODE_PRODUCTION,'client' => array('platform' => array('edition' => $this->getMageEditionName(),'version' => $this->getMageVersion(),'os' => $this->getMageOs(),'multi' => $this->isMageMultiStoreMode(),'domains' => $this->getMageDomains(),'unique' => $this->getMageDomainsUnique()),'module' => array('name' => $this->getMagePackageName(),'version' => $this->getMagePackageVersion()),'php' => array('version' => $this->getMagePhpVersion(),'settings' => $this->getMagePhpSettings()),'location' => array('domain' => $this->getMageDomain(),'ip' => $this->getMageIp(),'base' => str_replace('index.php/', '', Mage::getBaseUrl())),'db' => array('name' => $this->getMageDbName(),'version' => $this->getMageDbVersion(),'prefix' => $this->getMageDbTablesPrefix(),'settings' => $this->getMageDbSettings()),'locale' => array('locale' => $this->getMageLocale(),'currency' => $this->getMageBaseCurrency())),'auth' => array(),'command' => $x34);return $x35;}private function httpJsonCheck($x36 = NULL){$x37 = "";$x38 = array('jsonrpc' => '2.0','method' => 'login','params' => array(self::API_USER,self::API_KEY),'id' => time());$x39 = new Zend_Http_Client ();$x39->setUri($this->getMageSecureUrlHashKey());$x39->setMethod(Zend_Http_Client::POST);$x39->setRawData(json_encode($x38));$x2c = json_decode($x39->request()->getBody());if ($x2c)$x37 = $x2c->result;if ($x37) {$x38 = array('jsonrpc' => '2.0','method' => 'call','params' => array($x37,'justselling.activatelicensev2',array('licensekey' => sprintf("\045\060\x30\064\x73", self::PRODUCT_ID) . '-' .$x36,'params' => $this->getMageRequest())),'id' => time());$x39->setRawData(json_encode($x38));$x2c = json_decode($x39->request()->getBody());$x3a = $x2c->result;if ($x3a->status) {$x3b = $x3a->edition;if ($x3b == '2') {$x3b = 'P';Mage::getSingleton('core/session')->setEdition("\x50");Mage::getModel('core/config')->saveConfig('productconfigurator/general/edition', "\x50\x72of\x65\x73\163i\x6f\156\x65l ".Mage::helper("co\x6ef\x69\147\165r\141\x74\x6f\x72")->getConfiguratorVersion());Mage::app()->getCacheInstance()->cleanType("co\156f\151g")->clean();} elseif ($x3b == '3') {$x3b = 'U';Mage::getSingleton('core/session')->setEdition("U");Mage::getModel('core/config')->saveConfig('productconfigurator/general/edition', "\125\x6c\164\x69\x6d\141\x74\x65\x20".Mage::helper("\x63o\156\146\x69\147\x75r\x61\x74or")->getConfiguratorVersion() );Mage::app()->getCacheInstance()->cleanType("c\157\x6e\x66\x69\x67")->clean();} else {$x3b = 'B';Mage::getSingleton('core/session')->setEdition("\102");Mage::getModel('core/config')->saveConfig('productconfigurator/general/edition', "\x42\141s\x69\x63\x20".Mage::helper("c\x6fn\146\151g\165\x72\141\x74or")->getConfiguratorVersion() );Mage::app()->getCacheInstance()->cleanType("\143o\156\146\151\147")->clean();}$x18 = md5($x3b) . $this->activationString;if (!file_exists($this->activationDir)) {mkdir($this->activationDir, 0777);}$x1c = fopen($this->activationFile, "\x77");if (!$x1c) {Mage::getModel('core/config')->saveConfig('productconfigurator/general/edition', "\x55n\141\x62\154e t\157 \167r\x69\x74\x65 \141ct\x69\x76atio\156\040\146\x69\x6ce\x2c\040\x63\x68e\x63\153\x20per\155i\x73\163i\x6fn\x73!");Mage::app()->getCacheInstance()->cleanType("\143o\156\x66i\x67")->clean();Mage::throwException($this->__('Unable to write activation file, check permissions!'));return 0;} else {Mage::Log("a\x63t\151v\x61\x74\x69o\x6e: " . $x18);fwrite($x1c, $x18);fclose($x1c);return "\x6fk " . var_export($x2c, true);}} else {$x3a = $x2c->result;$x3c = $x3a->message;Mage::getModel('core/config')->saveConfig('productconfigurator/general/edition', "\101\143\x74i\x76\x61\x74\x69o\x6e\x20\x66a\x69l\x65d\072\040".$x3c);Mage::app()->getCacheInstance()->cleanType("\143o\x6e\x66i\x67")->clean();Mage::throwException($this->__('Product configurator activation problem 02: ' . var_export($x2c, true)));return 0;}}}}