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.1.0.0
- * @ Author : DeZender
- * @ Release on : 15.05.2020
- * @ Official site : http://DeZender.Net
- *
- */
- class HetznerCloudLicense
- {
- public function __construct($UWSKey = NULL)
- {
- $LRemKey = WHMCS\Database\Capsule::table('tbladdonmodules')->select('value')->where(['setting' => 'whmcsmodule_key', 'module' => 'HetznerCloud'])->first();
- $this->LicenseKey = $LRemKey->value;
- }
- public function __destruct()
- {
- }
- public function HetznerCloud_LicenseCheck()
- {
- $status = self::Get_HetznerCloudLicenseCheck();
- return $status['results']['status'];
- }
- public function get_HetznerCloudLicenseInfo_config()
- {
- $HetznerCloudLicenseInfo_config = [];
- $llkey = WHMCS\Database\Capsule::table('tblconfiguration')->select('value')->where(['setting' => 'hetznercloud_localkey'])->first();
- $HetznerCloudLicenseInfo_config['RemoteKey'] = $this->LicenseKey;
- $HetznerCloudLicenseInfo_config['LocalKey'] = $llkey->value;
- return $HetznerCloudLicenseInfo_config;
- }
- public function get_HetznerCloud_prekey()
- {
- return ['HetznerCloud-Owned', 'HetznerCloud-Yearly'];
- }
- public function Get_HetznerCloudLicenseCheck()
- {
- $LicenseConfig = self::get_HetznerCloudLicenseInfo_config();
- $zlk = explode('-', $LicenseConfig['RemoteKey'], -1);
- $zlk = implode('-', $zlk);
- $HetznerCloudprekey = self::get_HetznerCloud_prekey();
- $RemoteKey = $LicenseConfig['RemoteKey'];
- $LocalKey = $LicenseConfig['LocalKey'];
- $name = 'HetznerCloud';
- if (!preg_match('/^' . $name . '\\-(Yearly|Owned)\\-[a-zA-Z0-9]{10}$/', $RemoteKey)) {
- $License['results']['status'] = 'Invalid';
- $License['results']['message'] = 'Invalid License Key';
- }
- else if (in_array($zlk, $HetznerCloudprekey)) {
- $results = self::HetznerCloud_Lcheck($RemoteKey, $LocalKey);
- switch ($results['status']) {
- case 'Active':
- if ($results['localkey']) {
- WHMCS\Database\Capsule::table('tblconfiguration')->where('setting', 'hetznercloud_localkey')->update(['value' => $results['localkey']]);
- }
- }
- $License['results'] = $results;
- }
- else {
- $License['results']['status'] = 'Invalid';
- $License['results']['message'] = 'Invalid License Key';
- }
- return $License;
- }
- static public function HetznerCloud_Lcheck($licensekey, $localkey = '')
- {
- $whmcsurl = 'https://secure.whmcsmodule.net/';
- $licensing_secret_key = 'WHMCSBpWKwHvIm3iKDagpt6iPHetznerCloud';
- $check_token = time() . md5(mt_rand(1000000000, 9999999999.0) . $licensekey);
- $checkdate = date('Ymd');
- $usersip = (isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR'] : $_SERVER['LOCAL_ADDR']);
- $localkeydays = 15;
- $allowcheckfaildays = 5;
- $localkeyvalid = false;
- $lkey = WHMCS\Database\Capsule::table('tblconfiguration')->select('value')->where(['setting' => 'hetznercloud_localkey'])->first();
- if ($lkey) {
- $localkey = $lkey->value;
- }
- if ($localkey) {
- $localkey = str_replace('', '', $localkey);
- $localdata = substr($localkey, 0, strlen($localkey) - 32);
- $md5hash = substr($localkey, strlen($localkey) - 32);
- if ($md5hash == md5($localdata . $licensing_secret_key)) {
- $localdata = strrev($localdata);
- $md5hash = substr($localdata, 0, 32);
- $localdata = substr($localdata, 32);
- $localdata = base64_decode($localdata);
- $localkeyresults = unserialize($localdata);
- $originalcheckdate = $localkeyresults['checkdate'];
- if ($md5hash == md5($originalcheckdate . $licensing_secret_key)) {
- .........................................................................
- .............................................
- .....................
Add Comment
Please, Sign In to add comment