Guest User

Untitled

a guest
Jan 15th, 2021
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.1
  8. * @ Author : DeZender
  9. * @ Release on : 29.08.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. try {
  15. function dummy_handler($errno, $errstr, $errfile, $errline)
  16. {
  17. }
  18. }
  19. catch (Exception $e) {
  20. }
  21.  
  22. class ModelExtensionThemeFrame extends Model
  23. {
  24. public function getLicense()
  25. {
  26. $this->session->data['lic_err'] = '';
  27. $valid = false;
  28. set_error_handler('dummy_handler');
  29.  
  30. try {
  31. $valid = $this->_getLicense();
  32. }
  33. catch (Exception $e) {
  34. }
  35.  
  36. restore_error_handler();
  37. return $valid;
  38. }
  39.  
  40. private function _getLicense($force_download = false)
  41. {
  42. $this->load->language('extension/theme/frame');
  43. $domain_check = parse_url(HTTP_SERVER);
  44. if (($domain_check['host'] != $_SERVER['HTTP_HOST']) || ($_SERVER['HTTP_HOST'] != getenv('HTTP_HOST'))) {
  45. $this->session->data['lic_err'] = sprintf($this->language->get('l_err_config'), $_SERVER['HTTP_HOST']);
  46. return false;
  47. }
  48.  
  49. $files = glob(DIR_SYSTEM . 'license/frame.*.lic');
  50. $count_files = count($files);
  51.  
  52. if (1 < $count_files) {
  53. $this->session->data['lic_err'] = sprintf($this->language->get('l_err_file_count'), DIR_SYSTEM);
  54. return false;
  55. }
  56. if (($files === false) || ($count_files == 0) || (strlen(file_get_contents($files[0])) == 0) || $force_download) {
  57. if (isset($files[0])) {
  58. $filename = $this->downloadLicense($files[0]);
  59. }
  60. else {
  61. $filename = $this->downloadLicense();
  62. }
  63.  
  64. if (!$filename) {
  65. return false;
  66. }
  67. }
  68. else {
  69. $filename = $files[0];
  70. }
  71.  
  72. $licence = file_get_contents($filename);
  73. $md5 = md5_file(DIR_SYSTEM . '../config.php');
  74. $host = preg_replace('#^www\\.(.+)#i', '$1', $_SERVER['HTTP_HOST']);
  75. $priv_key = 'fa1a7b1fa1825378299b3141cdea3a4a';
  76. $valid = hash('sha256', $host . '.' . $md5 . '.' . $priv_key) === $licence;
  77.  
  78. if (!$valid) {
  79. if ($force_download === false) {
  80. $this->session->data['lic_err'] = '';
  81. $valid = $this->_getLicense(true);
  82. }
  83. else {
  84. $this->session->data['lic_err'] = sprintf($this->language->get('l_err_domain'), $_SERVER['HTTP_HOST']);
  85. }
  86. }
  87.  
  88. return $valid;
  89. }
  90.  
  91. private function downloadLicense($filename = false)
  92. {
  93. $this->load->language('extension/theme/frame');
  94. .................................................................................
  95. ....................................................
  96. ............................
Add Comment
Please, Sign In to add comment