Advertisement
Guest User

Untitled

a guest
Apr 28th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.16 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for Zend Guard Encoder)
  6. *
  7. * @ Version : 3.0.4.0
  8. * @ Author : DeZender
  9. * @ Release on : 02.04.2017
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. defined('_ASTEXE_') || exit('No access');
  15. $DP_Module_array = array();
  16. $DP_Config = new DP_Config();
  17. try {
  18. $db_link = new PDO('mysql:host=' . $DP_Config->host . ';dbname=' . $DP_Config->db, $DP_Config->user, $DP_Config->password);
  19. }
  20. catch (PDOException $e) {
  21. exit('No DB connect');
  22. }
  23.  
  24. ('SET NAMES utf8;');
  25. $check_file_name = md5(md5(time() . rand() . 'Колодец lalala') . md5('Проверочка'));
  26. $file_content = md5(rand() . time() . 'additional_check');
  27. $check_file = fopen($_SERVER['DOCUMENT_ROOT'] . '/license/' . $check_file_name, 'w');
  28. fwrite($check_file, $file_content);
  29. fclose($check_file);
  30. $check_curl = curl_init();
  31. curl_setopt($check_curl, CURLOPT_URL, $DP_Config->domain_path . 'license/' . $check_file_name);
  32. curl_setopt($check_curl, CURLOPT_HEADER, 0);
  33. curl_setopt($check_curl, CURLOPT_RETURNTRANSFER, true);
  34. curl_setopt($check_curl, CURLOPT_SSL_VERIFYHOST, 0);
  35. curl_setopt($check_curl, CURLOPT_SSL_VERIFYPEER, 0);
  36. if (isset($DP_Config->http_login) && isset($DP_Config->http_password)) {
  37. if (($DP_Config->http_login != '') && ($DP_Config->http_password != NULL)) {
  38. curl_setopt($check_curl, CURLOPT_USERPWD, $DP_Config->http_login . ':' . $DP_Config->http_password);
  39. }
  40. }
  41.  
  42. $file_content_by_url = curl_exec($check_curl);
  43. if (curl_errno($check_curl)) {
  44. while (!@(unlink($_SERVER['DOCUMENT_ROOT'] . '/license/' . $check_file_name))) {
  45.  
  46. }
  47.  
  48. exit('License error 1.1: Wrong exec');
  49. }
  50. else if (curl_getinfo($check_curl, CURLINFO_HTTP_CODE) != 200) {
  51. while (!@(unlink($_SERVER['DOCUMENT_ROOT'] . '/license/' . $check_file_name))) {
  52.  
  53. }
  54.  
  55. exit('License error 1.2: Wrong code');
  56. }
  57.  
  58. curl_close($check_curl);
  59. if (($file_content_by_url === $file_content) && !empty($file_content) && ($file_content_by_url != false)) {
  60. while (!@(unlink($_SERVER['DOCUMENT_ROOT'] . '/license/' . $check_file_name))) {
  61.  
  62. }
  63. }
  64. else {
  65. while (!@(unlink($_SERVER['DOCUMENT_ROOT'] . '/license/' . $check_file_name))) {
  66.  
  67. }
  68.  
  69. exit('License error 1.3: Wrong value of domain_path field');
  70. }
  71.  
  72. $license_file = @(fopen($_SERVER['DOCUMENT_ROOT'] . '/license/license.lic', 'r'));
  73. if ($license_file == false) {
  74. exit('License error 2: License not found');
  75. }
  76.  
  77. $license_id = '';
  78. $lisense_key = '';
  79. $lisense_expired = '';
  80. while (!feof($license_file)) {
  81. $record = fgets($license_file, 4096);
  82. $record = str_replace("\n", '', $record);
  83. $record = explode(':', $record);
  84.  
  85. switch ($record[0]) {
  86. case 'license':
  87. $license_id = $record[1];
  88. break;
  89.  
  90. case 'key':
  91. $lisense_key = $record[1];
  92. break;
  93.  
  94. case 'expired':
  95. $lisense_expired = $record[1];
  96. }
  97. }
  98.  
  99. if (($license_id == '') || ($lisense_key == '') || ($lisense_expired == '')) {
  100. exit('License error 3: License has incorrect structure');
  101. }
  102.  
  103. $domain_to_check = parse_url($DP_Config->domain_path, PHP_URL_HOST);
  104. if ($DP_Config->products_table_mode != NULL) {
  105. $key1 = md5(strlen($domain_to_check) . $license_id . $lisense_expired . 'последовательность ast random Ltd');
  106. $key2 = md5($domain_to_check . 'другая последовательность' . $domain_to_check . strlen($domain_to_check));
  107. $key3 = md5(strlen($domain_to_check) . $domain_to_check);
  108. }
  109. else {
  110. $key1 = md5(strlen($domain_to_check) . $license_id . $lisense_expired . 'последовательность ast cms random Ltd');
  111. $key2 = md5($domain_to_check . 'для cms' . $domain_to_check . strlen($domain_to_check));
  112. $key3 = md5(strlen($domain_to_check) . $domain_to_check . $lisense_expired . $license_id . $license_id);
  113. }
  114.  
  115. if ($key1 . $key2 . $key3 != $lisense_key) {
  116. exit('License error 4: License key not valid');
  117. }
  118.  
  119. if ((int) $lisense_expired != 0) {
  120. if ($lisense_expired < time()) {
  121. exit('License error 5: License expired');
  122. }
  123. }
  124.  
  125. $current_template_query = $db_link->prepare('SELECT * FROM `templates` WHERE `current` = ? AND `is_frontend` = ?;');
  126. $current_template_query->execute(array(1, $isFrontMode));
  127. $current_template_record = $current_template_query->fetch();
  128. $DP_Template = new DP_Template();
  129. $DP_Template->id = (int) $current_template_record['id'];
  130. $DP_Template->name = $current_template_record['name'];
  131. $DP_Template->positions = json_decode($current_template_record['positions'], true);
  132. $DP_Template->html = '';
  133. $DP_Template->phone_support = $current_template_record['phone_support'];
  134. $DP_Template->tablet_support = $current_template_record['tablet_support'];
  135. $DP_Template->data_value = json_decode($current_template_record['data_value']);
  136. $tpl_file_path = 'templates/' . $DP_Template->name . '/desktop.php';
  137. $tpl_file = fopen($tpl_file_path, 'r');
  138. $tpl_file_string = fread($tpl_file, filesize($tpl_file_path));
  139. fclose($tpl_file);
  140. $DP_Template->html = $tpl_file_string;
  141. $url_route = urldecode(getPageRoute());
  142. if ($isFrontMode == 0) {
  143. $url_route = str_replace($DP_Config->backend_dir, '', $url_route);
  144. ...............................................................................
  145. ........................................
  146. ....................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement