Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP5 Decoder for Zend Guard Encoder)
- *
- * @ Version : 3.0.4.0
- * @ Author : DeZender
- * @ Release on : 02.04.2017
- * @ Official site : http://DeZender.Net
- *
- */
- defined('_ASTEXE_') || exit('No access');
- $DP_Module_array = array();
- $DP_Config = new DP_Config();
- try {
- $db_link = new PDO('mysql:host=' . $DP_Config->host . ';dbname=' . $DP_Config->db, $DP_Config->user, $DP_Config->password);
- }
- catch (PDOException $e) {
- exit('No DB connect');
- }
- ('SET NAMES utf8;');
- $check_file_name = md5(md5(time() . rand() . 'Колодец lalala') . md5('Проверочка'));
- $file_content = md5(rand() . time() . 'additional_check');
- $check_file = fopen($_SERVER['DOCUMENT_ROOT'] . '/license/' . $check_file_name, 'w');
- fwrite($check_file, $file_content);
- fclose($check_file);
- $check_curl = curl_init();
- curl_setopt($check_curl, CURLOPT_URL, $DP_Config->domain_path . 'license/' . $check_file_name);
- curl_setopt($check_curl, CURLOPT_HEADER, 0);
- curl_setopt($check_curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($check_curl, CURLOPT_SSL_VERIFYHOST, 0);
- curl_setopt($check_curl, CURLOPT_SSL_VERIFYPEER, 0);
- if (isset($DP_Config->http_login) && isset($DP_Config->http_password)) {
- if (($DP_Config->http_login != '') && ($DP_Config->http_password != NULL)) {
- curl_setopt($check_curl, CURLOPT_USERPWD, $DP_Config->http_login . ':' . $DP_Config->http_password);
- }
- }
- $file_content_by_url = curl_exec($check_curl);
- if (curl_errno($check_curl)) {
- while (!@(unlink($_SERVER['DOCUMENT_ROOT'] . '/license/' . $check_file_name))) {
- }
- exit('License error 1.1: Wrong exec');
- }
- else if (curl_getinfo($check_curl, CURLINFO_HTTP_CODE) != 200) {
- while (!@(unlink($_SERVER['DOCUMENT_ROOT'] . '/license/' . $check_file_name))) {
- }
- exit('License error 1.2: Wrong code');
- }
- curl_close($check_curl);
- if (($file_content_by_url === $file_content) && !empty($file_content) && ($file_content_by_url != false)) {
- while (!@(unlink($_SERVER['DOCUMENT_ROOT'] . '/license/' . $check_file_name))) {
- }
- }
- else {
- while (!@(unlink($_SERVER['DOCUMENT_ROOT'] . '/license/' . $check_file_name))) {
- }
- exit('License error 1.3: Wrong value of domain_path field');
- }
- $license_file = @(fopen($_SERVER['DOCUMENT_ROOT'] . '/license/license.lic', 'r'));
- if ($license_file == false) {
- exit('License error 2: License not found');
- }
- $license_id = '';
- $lisense_key = '';
- $lisense_expired = '';
- while (!feof($license_file)) {
- $record = fgets($license_file, 4096);
- $record = str_replace("\n", '', $record);
- $record = explode(':', $record);
- switch ($record[0]) {
- case 'license':
- $license_id = $record[1];
- break;
- case 'key':
- $lisense_key = $record[1];
- break;
- case 'expired':
- $lisense_expired = $record[1];
- }
- }
- if (($license_id == '') || ($lisense_key == '') || ($lisense_expired == '')) {
- exit('License error 3: License has incorrect structure');
- }
- $domain_to_check = parse_url($DP_Config->domain_path, PHP_URL_HOST);
- if ($DP_Config->products_table_mode != NULL) {
- $key1 = md5(strlen($domain_to_check) . $license_id . $lisense_expired . 'последовательность ast random Ltd');
- $key2 = md5($domain_to_check . 'другая последовательность' . $domain_to_check . strlen($domain_to_check));
- $key3 = md5(strlen($domain_to_check) . $domain_to_check);
- }
- else {
- $key1 = md5(strlen($domain_to_check) . $license_id . $lisense_expired . 'последовательность ast cms random Ltd');
- $key2 = md5($domain_to_check . 'для cms' . $domain_to_check . strlen($domain_to_check));
- $key3 = md5(strlen($domain_to_check) . $domain_to_check . $lisense_expired . $license_id . $license_id);
- }
- if ($key1 . $key2 . $key3 != $lisense_key) {
- exit('License error 4: License key not valid');
- }
- if ((int) $lisense_expired != 0) {
- if ($lisense_expired < time()) {
- exit('License error 5: License expired');
- }
- }
- $current_template_query = $db_link->prepare('SELECT * FROM `templates` WHERE `current` = ? AND `is_frontend` = ?;');
- $current_template_query->execute(array(1, $isFrontMode));
- $current_template_record = $current_template_query->fetch();
- $DP_Template = new DP_Template();
- $DP_Template->id = (int) $current_template_record['id'];
- $DP_Template->name = $current_template_record['name'];
- $DP_Template->positions = json_decode($current_template_record['positions'], true);
- $DP_Template->html = '';
- $DP_Template->phone_support = $current_template_record['phone_support'];
- $DP_Template->tablet_support = $current_template_record['tablet_support'];
- $DP_Template->data_value = json_decode($current_template_record['data_value']);
- $tpl_file_path = 'templates/' . $DP_Template->name . '/desktop.php';
- $tpl_file = fopen($tpl_file_path, 'r');
- $tpl_file_string = fread($tpl_file, filesize($tpl_file_path));
- fclose($tpl_file);
- $DP_Template->html = $tpl_file_string;
- $url_route = urldecode(getPageRoute());
- if ($isFrontMode == 0) {
- $url_route = str_replace($DP_Config->backend_dir, '', $url_route);
- ...............................................................................
- ........................................
- ....................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement