Guest User

Untitled

a guest
Oct 16th, 2020
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.74 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. if (count(get_included_files()) == 1) {
  15. exit('No direct script access allowed');
  16. }
  17.  
  18. class HaLimCore_API extends HaLimCore_Init
  19. {
  20. public $api_url;
  21. public $lic_path;
  22. public $root_path;
  23. public $asset_path;
  24. public $current_path;
  25. public $license_file;
  26. public $api_key;
  27. public $product_id;
  28. public $verify_type;
  29. public $current_version;
  30. public $verification_period;
  31.  
  32. public function __construct()
  33. {
  34. $this->product_id = 'E156F9B3';
  35. $this->api_url = 'https://license.hoangha.net/';
  36. $this->api_key = '6AC1BB1EA98A86A4FE23';
  37. $this->api_language = 'english';
  38. $this->current_version = 'v' . wp_get_theme('halimmovies')->get('Version');
  39. $this->verify_type = 'non_envato';
  40. $this->verification_period = 90;
  41. $this->current_path = realpath(__DIR__);
  42. $this->root_path = realpath($this->current_path . '/..');
  43. $this->lic_path = ABSPATH . 'wp-admin/user';
  44. $this->license_file = $this->lic_path . '/user.config';
  45. $this->asset_path = realpath($this->current_path . '/../../assets/files');
  46. }
  47.  
  48. public function check_local_license_exist()
  49. {
  50. return is_file($this->license_file);
  51. }
  52.  
  53. public function get_current_version()
  54. {
  55. return $this->current_version;
  56. }
  57.  
  58. public function init_wp_fs()
  59. {
  60. global $obf_DRgfBysGGRgBBhcOA0QPy4wHjwFDAE;
  61.  
  62. if (false === $credentials = request_filesystem_credentials('')) {
  63. return false;
  64. }
  65.  
  66. if (!WP_Filesystem($credentials)) {
  67. request_filesystem_credentials('');
  68. return false;
  69. }
  70.  
  71. return true;
  72. }
  73.  
  74. public function write_wp_fs($file_path, $content)
  75. {
  76. global $obf_DRgfBysGGRgBBhcOA0QPy4wHjwFDAE;
  77. $obf_DSkrNwkpGVwyHBAQEhwWAi4NBCsdFRE = $file_path;
  78.  
  79. if ($this->init_wp_fs()) {
  80. if ($obf_DRgfBysGGRgBBhcOA0QPy4wHjwFDAE->put_contents($obf_DSkrNwkpGVwyHBAQEhwWAi4NBCsdFRE, $content, FS_CHMOD_FILE)) {
  81. return true;
  82. }
  83. else {
  84. return false;
  85. }
  86. }
  87. }
  88.  
  89. public function read_wp_fs($file_path)
  90. {
  91. global $obf_DRgfBysGGRgBBhcOA0QPy4wHjwFDAE;
  92.  
  93. if ($this->init_wp_fs()) {
  94. return $obf_DRgfBysGGRgBBhcOA0QPy4wHjwFDAE->get_contents($file_path);
  95. }
  96. }
  97.  
  98. public function call_api($method, $url, $data)
  99. {
  100. $obf_DTUmNjgNOB4pAw4SLykkDgsKFzIuNDI = ['body' => $data];
  101. $obf_DTUmNjgNOB4pAw4SLykkDgsKFzIuNDI['method'] = $method;
  102. $this_url = site_url();
  103. $obf_DQxcKAk0HQ4fAR4GBw0DC8vCSEpWwE = getenv('SERVER_ADDR') ?: $this->get_ip_from_third_party() ?: gethostbyname(gethostname());
  104. $obf_DTUmNjgNOB4pAw4SLykkDgsKFzIuNDI['headers'] = ['Content-Type' => 'application/json', 'LB-API-KEY' => $this->api_key, 'LB-URL' => $this_url, 'LB-IP' => $obf_DQxcKAk0HQ4fAR4GBw0DC8vCSEpWwE, 'LB-LANG' => $this->api_language];
  105. $obf_DTUmNjgNOB4pAw4SLykkDgsKFzIuNDI['timeout'] = 30;
  106. $result = wp_remote_request($url, $obf_DTUmNjgNOB4pAw4SLykkDgsKFzIuNDI);
  107.  
  108. if (!isset($result->errors['http_request_failed'])) {
  109. if (!$result['body'] && !LB_API_DEBUG) {
  110. $rs = ['status' => false, 'message' => LB_TEXT_CONNECTION_FAILED];
  111. return json_encode($rs);
  112. }
  113.  
  114. $http_status = $result['response']['code'];
  115.  
  116. if ($http_status != 200) {
  117. if (LB_API_DEBUG) {
  118. $obf_DQM1Nz0tLg8BITACDB4cDxoyCTgnOCI = json_decode($result['body'], true);
  119. $rs = ['status' => false, 'message' => !empty($obf_DQM1Nz0tLg8BITACDB4cDxoyCTgnOCI['error']) ? $obf_DQM1Nz0tLg8BITACDB4cDxoyCTgnOCI['error'] : $obf_DQM1Nz0tLg8BITACDB4cDxoyCTgnOCI['message']];
  120. return json_encode($rs);
  121. }
  122. else {
  123. $rs = ['status' => false, 'message' => LB_TEXT_INVALID_RESPONSE];
  124. return json_encode($rs);
  125. }
  126. }
  127.  
  128. return $result['body'];
  129. }
  130. }
  131.  
  132. public function check_connection()
  133. {
  134. $data_array = [];
  135. $get_data = $this->call_api('POST', $this->api_url . 'api/check_connection_ext', json_encode($data_array));
  136. $response = json_decode($get_data, true);
  137. return $response;
  138. }
  139.  
  140. public function get_latest_version()
  141. {
  142. $data_array = ['product_id' => $this->product_id];
  143. $get_data = $this->call_api('POST', $this->api_url . 'api/latest_version', json_encode($data_array));
  144. $response = json_decode($get_data, true);
  145. return $response;
  146. }
  147.  
  148. public function activate_license($license, $client, $create_lic = true)
  149. {
  150. $data_array = ['product_id' => $this->product_id, 'license_code' => $license, 'client_name' => $client, 'verify_type' => $this->verify_type];
  151. $get_data = $this->call_api('POST', $this->api_url . 'api/activate_license', json_encode($data_array));
  152. $response = json_decode($get_data, true);
  153.  
  154. if (!empty($create_lic)) {
  155. if ($response['status']) {
  156. $licfile = trim($response['lic_response']);
  157. $this->write_wp_fs($this->license_file, $licfile);
  158. }
  159. else if (is_writeable($this->license_file)) {
  160. unlink($this->license_file);
  161. }
  162. }
  163.  
  164. return $response;
  165. }
  166.  
  167. public function verify_license($time_based_check = false, $license = false, $client = false)
  168. {
  169. if (!empty($license) && !empty($client)) {
  170. $data_array = ['product_id' => $this->product_id, 'license_file' => NULL, 'license_code' => $license, 'client_name' => $client];
  171. }
  172. else if (is_file($this->license_file)) {
  173. $data_array = ['product_id' => $this->product_id, 'license_file' => $this->read_wp_fs($this->license_file), 'license_code' => NULL, 'client_name' => NULL];
  174. }
  175. else {
  176. $data_array = [];
  177. }
  178.  
  179. $res = ['status' => true, 'message' => LB_TEXT_VERIFIED_RESPONSE];
  180. .................................................................................................................
  181. .....................................................................
  182. .............................
Add Comment
Please, Sign In to add comment