/* Decoded by unphp.net */ ?>call('login', array('username' => self::WEBSERVICE_USER, 'password' => self::WEBSERVICE_PASS)); $result = $xmlRpc->call('call', array('sessionId' => $session, 'apiPath' => 'licensemanager.active', 'args' => array($licensekey,$extensionName,$domain))); $dataObject = new Varien_Object($result); return (int)$dataObject->getResponseCode(); } catch(Exception $e){ $decrypted = $this->_decrypt($licensekey); if(!$decrypted){ return self::GENERAL_ERROR; } return self::NEW_DOMAIN_SUCCESS; } return self::GENERAL_ERROR;; } public function getLicenseInfo($licensekey,$extensionName,$domain) { try{ $xmlRpc = new Zend_XmlRpc_Client(self::SERVER_URL.'api/xmlrpc/'); $session = $xmlRpc->call('login', array('username' => self::WEBSERVICE_USER, 'password' => self::WEBSERVICE_PASS)); $result = $xmlRpc->call('call', array('sessionId' => $session, 'apiPath' => 'licensemanager.active', 'args' => array($licensekey,$extensionName,$domain))); $dataObject = new Varien_Object($result); return $dataObject; } catch(Exception $e){ $dataObject = new Varien_Object(); return $dataObject->setResponseCode(101); } } protected function _decrypt($key) { $decrypted = base64_decode($key); $decrypted = explode('****',$decrypted); if(!isset($decrypted[0]) || !isset($decrypted[1]) || !isset($decrypted[2])) return null; return $decrypted; } static function getLicenseTitle($licensetype) { $helper = Mage::helper('magenotification'); switch($licensetype){ case self::DOMAIN1: return $helper->__('1 Domain License'); case self::DOMAIN2: return $helper->__('2 Domain License'); case self::DOMAIN5: return $helper->__('5 Domain License'); case self::DOMAIN10: return $helper->__('10 Domain License'); case self::UNLIMITED: return $helper->__('Unlimited License'); case self::DEVELOPER: return $helper->__('Developer License'); case self::TRIAL_VERSION: return $helper->__('Trial License'); } return $helper->__('1 Domain License'); } }