Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.0.2.0
- * @ Author : DeZender
- * @ Release on : 06.04.2018
- * @ Official site : http://DeZender.Net
- *
- */
- class Am_LicenseChecker
- {
- const OK = 'ok';
- const CONNECTION_ERROR = 'connection_error';
- const LICENSE_EMPTY = 'license_empty';
- const LICENSE_NOT_FOUND = 'license_not_found';
- const LICENSE_DISABLED = 'license_disabled';
- const LICENSE_EXPIRED = 'license_expired';
- const LICENSE_SERVER_ERROR = 'license_server_error';
- const ACTIVATION_SERVER_ERROR = 'activation_server_error';
- const ERROR_INVALID_INPUT = 'invalid_input';
- const ERROR_NO_SPARE_ACTIVATIONS = 'no_spare_activations';
- const ERROR_NO_ACTIVATION_FOUND = 'no_activation_found';
- const ERROR_NO_REACTIVATION_ALLOWED = 'no_reactivation_allowed';
- const ERROR_NO_RESPONSE = 'no_response';
- const ERROR_OTHER = 'other_error';
- /** that is how activation cache will be encrypted - CHANGE IT! */
- private $_local_encryption_key = 'dd2b31f68b870fc54ee5b8b342fc720e05374574';
- public $messages = ['ok' => 'License OK', 'connection_error' => 'Could not connect to licensing server - please try again later', 'license_empty' => 'Empty or invalid license key submitted', 'license_not_found' => 'License key not found on licensing server', 'license_disabled' => 'License key has been disabled', 'license_expired' => 'License key expired', 'license_server_error' => 'License server is not available - please try again later', 'activation_server_error' => 'Activation server error', 'invalid_input' => 'Activation failed: invalid input', 'no_spare_activations' => 'No more activations allowed', 'no_activation_found' => 'No activation found for this installation', 'no_reactivation_allowed' => 'Re-activation is not allowed', 'no_response' => 'Internal problem on activation server', 'other_error' => 'Error returned from activation server'];
- protected $api_version = 1;
- /** @var int last code returned from */
- protected $code = 'ok';
- /** @var string last error message */
- protected $message;
- /** @var string license key */
- protected $key;
- /** @var string activation url */
- protected $url;
- /** @var int call home every .. days, 0 - disabled */
- protected $call_home_days = 2;
- /** @var int grace period .. hours, 24 - default. if "call home" failed, allow to continue */
- protected $grace_period = 24;
- /** @var array request_vars: set of
- * 'ip' : 'Server IP' : detected automatically by getServerIp() method
- * 'url' : 'Installation URL' : you must override getRootUrl() method to return it
- * 'domain' : 'Domain' : detected automatically by getDomain() method
- * 'sdomain' : 'Secure Domain (if application can use 2 domains)': override getSdomain() method to return
- * 'hardware-id' : Hardware ID - it can be any info on your choice that identifies the installation - override getHardwareId() method to return
- * */
- protected $request_vars = ['domain'];
- /** @var array() */
- public $openurl_callbacks = [
- ['this', 'openUrlFsockopen'],
- ['this', 'openUrlCurl'],
- ['this', 'openUrlFopen']
- ];
- /** @var stdclass */
- public $license_response;
- /** @var Am_LicenseChecker_ActivationResponse */
- public $activation_response;
- /** @var array cache */
- protected $_request;
- /**
- * Constructor
- * @param string $key license key value
- * @param string $url activation url
- * @param string|array $hash verification hash
- */
- public function __construct($key, $url, $hash = NULL)
- {
- $this->key = $key;
- $this->url = $url;
- $this->hash = $hash;
- }
- public function setError($code, $message = NULL)
- {
- $this->code = $code;
- $this->message = ($message !== NULL ? $message : $this->messages[$code]);
- return $this;
- }
- /**
- * Check license key against remote server
- * @return bool true of success
- * @see getCode()
- * @see getMessage()
- */
- public function checkLicenseKey()
- {
- $body = $this->makeRequest('GET', 'check-license', ['key' => $this->key], 'license_server_error');
- ..............................................................................
- ........................................
- ................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement