Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 3.0.8.0
- * @ Author : DeZender
- * @ Release on : 25.09.2017
- * @ Official site : http://DeZender.Net
- *
- */
- namespace WHMCS;
- class License
- {
- const LICENSE_API_VERSION = '1.1';
- const LICENSE_API_HOSTS = array(
- 'a.licensing.whmcs.com',
- 'b.licensing.whmcs.com',
- 'c.licensing.whmcs.com',
- 'd.licensing.whmcs.com',
- 'e.licensing.whmcs.com',
- 'f.licensing.whmcs.com'
- );
- private $licensekey = '';
- private $localkey = '';
- private $keydata = array( );
- private $salt = '';
- private $date = '';
- private $localkeydecoded = false;
- private $responsedata = '';
- private $postmd5hash = '';
- private $localkeydays = '10';
- private $allowcheckfaildays = '5';
- /**
- * @var array
- */
- private $debuglog = array( );
- private $version = '5cc7720f613926993107a6123a28eeaad706fc6a42324b40a3764748a28322280f5c373047bb2efad6f350a3bf070ad7ea0814abc720a6fb284fa6df4abea02e';
- public function __construct(Application $whmcs)
- {
- $this->licensekey = $whmcs->get_license_key( );
- $this->localkey = $whmcs->get_config( 'License' );
- $this->salt = sha1( 'WHMCS' . $whmcs->get_config( 'Version' ) . 'TFB' . $whmcs->get_hash( ) );
- $this->date = date( 'Ymd' );
- $this->decodeLocalOnce( );
- if (isset( $_GET['forceremote'] )) {
- $this->forceRemoteCheck( );
- Terminus::getInstance( )->doExit( );
- }
- }
- /**
- * Retrieve a WHMCS\License object via singleton.
- *
- * @deprecated 6.0 Instance should be retrieved from DI [DI::make('license');]
- *
- * @return License
- */
- public static function getInstance()
- {
- return DI::make( 'license' );
- }
- public function useInternalLicensingValidation()
- {
- $config = App::getApplicationConfig( );
- return (bool) $config['use_internal_licensing_validation'];
- }
- /**
- * Retrieve a list of licensing server IPs
- *
- * @return array
- */
- private function getHosts()
- {
- if ($this->useInternalLicensingValidation( )) {
- return array( 'hou-1.licensing.web.staging.whmcs.com' );
- }
- return self::LICENSE_API_HOSTS;
- }
- public function getLicenseKey()
- {
- return $this->licensekey;
- }
- private function getHostIP()
- {
- return WHMCS_LICENSE_IP;
- }
- private function getHostDomain()
- {
- return WHMCS_LICENSE_DOMAIN;
- }
- private function getHostDir()
- {
- return WHMCS_LICENSE_DIR;
- }
- public function getSalt()
- {
- return $this->salt;
- }
- public function getDate()
- {
- return $this->date;
- }
- public function checkLocalKeyExpiry()
- {
- $originalcheckdate = $this->getKeyData( 'checkdate' );
- $localexpirymax = date( 'Ymd', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) - $this->localkeydays, date( 'Y' ) ) );
- if ($originalcheckdate < $localexpirymax) {
- return false;
- }
- $localmax = date( 'Ymd', mktime( 0, 0, 0, date( 'm' ), date( 'd' ) + 2, date( 'Y' ) ) );
- if ($localmax < $originalcheckdate) {
- return false;
- }
- return true;
- }
- /**
- * Build post data for license check.
- *
- * @return string[]
- */
- protected function buildPostData()
- {
- $postfields = array( );
- $postfields['licensekey'] = $this->getLicenseKey( );
- $postfields['domain'] = $this->getHostDomain( );
- $postfields['ip'] = $this->getHostIP( );
- $postfields['dir'] = $this->getHostDir( );
- $postfields['check_token'] = sha1( time( ) . $this->getLicenseKey( ) . mt_rand( 1000000000, 9999999999 ) );
- $whmcs = DI::make( 'app' );
- $postfields['version'] = $whmcs->getVersion( )->getCanonical( );
- $postfields['phpversion'] = PHP_VERSION;
- $stats = json_decode( $whmcs->get_config( 'SystemStatsCache' ), true );
- if (!(is_array( $stats ))) {
- $stats = array( );
- }
- $stats = array_merge( $stats, Environment\Environment::toArray( ) );
- $postfields['anondata'] = $this->encryptMemberData( $stats );
- .............................................................
- ..........................
- ........
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement