Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2025
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.34 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP8 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 8.2.0.1
  8. * @ Author : DeZender
  9. * @ Release on : 27.10.2023
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. namespace RSThemes\Template;
  15.  
  16. /**
  17. * Class License
  18. * @package RSThemes\Template
  19. */
  20. class License
  21. {
  22. /** @var string $licenseServerUrl */
  23. public static $licenseServerUrl = 'https://rsstudio.net/my-account/';
  24. /** @var string $licenseKey */
  25. public $licenseKey = '';
  26. /** @var int $licenseFailDays */
  27. public $licenseFailDays = 30;
  28. /** @var int $licenseFailWarningDays */
  29. public $licenseFailWarningDays = 3;
  30. /** @var Template $template */
  31. public $template = null;
  32. /** @var string $templateName */
  33. public $templateName = null;
  34. /** @var bool $forceRemoteCheck */
  35. public $forceRemoteCheck = false;
  36. /** @var string $licenseKeyName */
  37. private $licenseKeyName = null;
  38. /** @var string $licenseSecretKey */
  39. private $licenseSecretKey = null;
  40. /** @var string $licenseConfigKey */
  41. private $licenseConfigKey = null;
  42. /** @var array $lastRemoteCheck */
  43. private $activationCache = [];
  44. /** @var array $licenseDetails */
  45. private $licenseDetails = ['status' => '', 'service_status' => '', 'license_status' => '', 'nextduedate' => '', 'version' => '1.0.0', 'fullversion' => '1.0.0', 'lastRemoteChecked' => '', 'lastRemoteCheckedFail' => '', 'lastRemoteCheckedSuccess' => '', 'regdate' => '', 'first_payment_amount' => '', 'recuring_amount' => '', 'payment_method' => '', 'warningShowDate' => '', 'deactivationDate' => '', 'license' => ''];
  46. private $validateDetails = ['status', 'service_status', 'license_status', 'nextduedate', 'version', 'regdate', 'first_payment_amount', 'recuring_amount', 'payment_method'];
  47. /** @var array $rawLicenseDetails */
  48. private $rawLicenseDetails = null;
  49. /** @var string $licenseEncoded */
  50. private $licenseEncoded = null;
  51. /** @var string $licenseWarningKey */
  52. private $licenseWarningKey = null;
  53. /** @var string $licenseWarningMessage */
  54. private $licenseWarningMessage = null;
  55. /** @var bool $debug */
  56. private $debug = false;
  57. /**
  58. * @var string
  59. */
  60. private $checkLicenseHour = null;
  61. private $certificate = '-----BEGIN CERTIFICATE-----' . "\n" . 'MIIFazCCA1OgAwIBAgIUHHVhX4JcvXn15Mrbmp51n2ebIlkwDQYJKoZIhvcNAQEL' . "\n" . 'BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM' . "\n" . 'GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA2MTEyMDQwNTRaFw0zNDA2' . "\n" . 'MDkyMDQwNTRaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw' . "\n" . 'HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggIiMA0GCSqGSIb3DQEB' . "\n" . 'AQUAA4ICDwAwggIKAoICAQCoWvNiGWc/yHHVuhruZTI3zcmqDFrSJhKtr83Zwmx7' . "\n" . 'YeZmP6jcjs125fcFdHaRN9CigaMS/RwMMQAGygdE+hSszMLctlXDHFfXNCyhKW7Q' . "\n" . 'NZ8Z3bqwpbU/CtaLz4SH2jHAkmFVGqcdtXoLTYtYLF1cdRbX7ta9+GyOP5mILH9a' . "\n" . 'hDVUZhG4kyH+gmgwU4sEKBqITJkxaBGa6F5WQYxFgj19xL6wya529bspF2cegCmx' . "\n" . 'Oz+nU4+HVcwcXoiHnWTns/Q8mYrz3dM8ui7IZFpLLHjHgFaqQAo3lnBaodk0oWcf' . "\n" . 'bzCHAmwiNKvwZ3lAlX/V0D+REd+rXfJOf2g0wrtfsQTTckWcZiiB4q/noY6p/o69' . "\n" . 'jPUQKMufAhNZHBAtF34KWQYjLq0nTH3ELGO1pU5PF4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FnI6zBma34s1GfAnbmjOi1mpNtMu7J8DfgfIhak80w/EKLgMEEmFCNDEHl' . "\n" . 'BYLGdWNZPk2lVcuUqMmDcOSK/Ye3hFISrjraV28rbPnrNltdpjv4h1LkMMY/RDgO' . "\n" . 'a3DLITXYvofZYdeqN7xt34FL5dHXb20yh28XS33//Oj9C+FpnI5HxoGNsaEG4/4=' . "\n" . '-----END CERTIFICATE-----';
  62.  
  63. /**
  64. * License constructor.
  65. * @param string $licenseKeyName
  66. * @param string $licenseSecretKey
  67. * @param Template $template
  68. */
  69. public function __construct($licenseKeyName, $licenseSecretKey, $template)
  70. {
  71. $this->loadLicenseHour($licenseKeyName);
  72. $this->licenseKeyName = $licenseKeyName;
  73. $this->licenseSecretKey = $licenseSecretKey;
  74. $this->template = $template;
  75. $this->licenseConfigKey = sprintf('%s-data', $licenseKeyName);
  76. $this->licenseKey = (new \RSThemes\Models\Configuration())->getConfig($licenseKeyName);
  77. $this->licenseWarningKey = sprintf('%s-warning', $licenseKeyName);
  78. $this->licenseWarningMessage = (new \RSThemes\Models\Configuration())->getConfig($this->licenseWarningKey);
  79. $this->templateName = $this->template->getMainName();
  80. $this->licenseEncoded = (new \RSThemes\Models\Configuration())->getConfig($this->licenseConfigKey);
  81. $this->rawLicenseDetails = $this->licenseDetails;
  82. $this->prepareLicense();
  83. }
  84.  
  85. /**
  86. * @param $licenseKeyName
  87. */
  88. private function loadLicenseHour($licenseKeyName)
  89. {
  90. $keyName = sprintf('%s-hour', $licenseKeyName);
  91. $hour = (new \RSThemes\Models\Configuration())->getConfig($keyName);
  92.  
  93. if (strlen($hour) == 0) {
  94. $hour = rand(4, 23) . ':' . str_pad(rand(2, 59), 2, '0', STR_PAD_LEFT);
  95. (new \RSThemes\Models\Configuration())->saveConfig($keyName, $hour);
  96. }
  97.  
  98. $this->checkLicenseHour = $hour;
  99. }
  100.  
  101. /**
  102. *
  103. */
  104. private function prepareLicense()
  105. {
  106. if (0 < strlen($this->licenseEncoded)) {
  107. $this->loadLicense();
  108. }
  109. if (($this->licenseDetails['service_status'] == 'Active') && isset($this->licenseDetails['deactivationDate']) && strlen($this->licenseDetails['deactivationDate'])) {
  110. if ($this->licenseDetails['deactivationDate'] < date('Y-m-d')) {
  111. $this->deactivateTemplate();
  112. }
  113. ........................................................
  114. ...............................
  115. ..............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement