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.1
- * @ Author : DeZender
- * @ Release on : 29.08.2020
- * @ Official site : http://DeZender.Net
- *
- */
- if (count(get_included_files()) == 1) {
- exit('No direct script access allowed');
- }
- class HaLimCore_API extends HaLimCore_Init
- {
- public $api_url;
- public $lic_path;
- public $root_path;
- public $asset_path;
- public $current_path;
- public $license_file;
- public $api_key;
- public $product_id;
- public $verify_type;
- public $current_version;
- public $verification_period;
- public function __construct()
- {
- $this->product_id = 'E156F9B3';
- $this->api_url = 'https://license.hoangha.net/';
- $this->api_key = '6AC1BB1EA98A86A4FE23';
- $this->api_language = 'english';
- $this->current_version = 'v' . wp_get_theme('halimmovies')->get('Version');
- $this->verify_type = 'non_envato';
- $this->verification_period = 90;
- $this->current_path = realpath(__DIR__);
- $this->root_path = realpath($this->current_path . '/..');
- $this->lic_path = ABSPATH . 'wp-admin/user';
- $this->license_file = $this->lic_path . '/user.config';
- $this->asset_path = realpath($this->current_path . '/../../assets/files');
- }
- public function check_local_license_exist()
- {
- return is_file($this->license_file);
- }
- public function get_current_version()
- {
- return $this->current_version;
- }
- public function init_wp_fs()
- {
- global $obf_DRgfBysGGRgBBhcOA0QPy4wHjwFDAE;
- if (false === $credentials = request_filesystem_credentials('')) {
- return false;
- }
- if (!WP_Filesystem($credentials)) {
- request_filesystem_credentials('');
- return false;
- }
- return true;
- }
- public function write_wp_fs($file_path, $content)
- {
- global $obf_DRgfBysGGRgBBhcOA0QPy4wHjwFDAE;
- $obf_DSkrNwkpGVwyHBAQEhwWAi4NBCsdFRE = $file_path;
- if ($this->init_wp_fs()) {
- if ($obf_DRgfBysGGRgBBhcOA0QPy4wHjwFDAE->put_contents($obf_DSkrNwkpGVwyHBAQEhwWAi4NBCsdFRE, $content, FS_CHMOD_FILE)) {
- return true;
- }
- else {
- return false;
- }
- }
- }
- public function read_wp_fs($file_path)
- {
- global $obf_DRgfBysGGRgBBhcOA0QPy4wHjwFDAE;
- if ($this->init_wp_fs()) {
- return $obf_DRgfBysGGRgBBhcOA0QPy4wHjwFDAE->get_contents($file_path);
- }
- }
- public function call_api($method, $url, $data)
- {
- $obf_DTUmNjgNOB4pAw4SLykkDgsKFzIuNDI = ['body' => $data];
- $obf_DTUmNjgNOB4pAw4SLykkDgsKFzIuNDI['method'] = $method;
- $this_url = site_url();
- $obf_DQxcKAk0HQ4fAR4GBw0DC8vCSEpWwE = getenv('SERVER_ADDR') ?: $this->get_ip_from_third_party() ?: gethostbyname(gethostname());
- $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];
- $obf_DTUmNjgNOB4pAw4SLykkDgsKFzIuNDI['timeout'] = 30;
- $result = wp_remote_request($url, $obf_DTUmNjgNOB4pAw4SLykkDgsKFzIuNDI);
- if (!isset($result->errors['http_request_failed'])) {
- if (!$result['body'] && !LB_API_DEBUG) {
- $rs = ['status' => false, 'message' => LB_TEXT_CONNECTION_FAILED];
- return json_encode($rs);
- }
- $http_status = $result['response']['code'];
- if ($http_status != 200) {
- if (LB_API_DEBUG) {
- $obf_DQM1Nz0tLg8BITACDB4cDxoyCTgnOCI = json_decode($result['body'], true);
- $rs = ['status' => false, 'message' => !empty($obf_DQM1Nz0tLg8BITACDB4cDxoyCTgnOCI['error']) ? $obf_DQM1Nz0tLg8BITACDB4cDxoyCTgnOCI['error'] : $obf_DQM1Nz0tLg8BITACDB4cDxoyCTgnOCI['message']];
- return json_encode($rs);
- }
- else {
- $rs = ['status' => false, 'message' => LB_TEXT_INVALID_RESPONSE];
- return json_encode($rs);
- }
- }
- return $result['body'];
- }
- }
- public function check_connection()
- {
- $data_array = [];
- $get_data = $this->call_api('POST', $this->api_url . 'api/check_connection_ext', json_encode($data_array));
- $response = json_decode($get_data, true);
- return $response;
- }
- public function get_latest_version()
- {
- $data_array = ['product_id' => $this->product_id];
- $get_data = $this->call_api('POST', $this->api_url . 'api/latest_version', json_encode($data_array));
- $response = json_decode($get_data, true);
- return $response;
- }
- public function activate_license($license, $client, $create_lic = true)
- {
- $data_array = ['product_id' => $this->product_id, 'license_code' => $license, 'client_name' => $client, 'verify_type' => $this->verify_type];
- $get_data = $this->call_api('POST', $this->api_url . 'api/activate_license', json_encode($data_array));
- $response = json_decode($get_data, true);
- if (!empty($create_lic)) {
- if ($response['status']) {
- $licfile = trim($response['lic_response']);
- $this->write_wp_fs($this->license_file, $licfile);
- }
- else if (is_writeable($this->license_file)) {
- unlink($this->license_file);
- }
- }
- return $response;
- }
- public function verify_license($time_based_check = false, $license = false, $client = false)
- {
- if (!empty($license) && !empty($client)) {
- $data_array = ['product_id' => $this->product_id, 'license_file' => NULL, 'license_code' => $license, 'client_name' => $client];
- }
- else if (is_file($this->license_file)) {
- $data_array = ['product_id' => $this->product_id, 'license_file' => $this->read_wp_fs($this->license_file), 'license_code' => NULL, 'client_name' => NULL];
- }
- else {
- $data_array = [];
- }
- $res = ['status' => true, 'message' => LB_TEXT_VERIFIED_RESPONSE];
- .................................................................................................................
- .....................................................................
- .............................
Add Comment
Please, Sign In to add comment