DENISSISS2
Пользователь
- Регист
- 13 Апр 2021
- Сообщения
- 6
- Реакции
- 8
В файле "engine/inc/include/init.php"
удаляем код:
Код:
$lic_tr = true;
$auto_detect_config = false;
$domen_md5 = md5( get_domen_hash() . DINITVERSION );
if( $domen_md5 == $config['key'] ) $lic_tr = false;
В файле "engine/inc/include/init.php"
удаляем код:
Код:
if( isset($_REQUEST['activation']) AND $_REQUEST['activation'] == "yes" AND $lic_tr) {
if( $member_id['user_group'] != 1 ) die();
if ( $_REQUEST['dle_key'] ) dle_activation( $_REQUEST['dle_key'], get_domen_hash(), $config );
elseif($_REQUEST['site_code']) dle_activation( $_REQUEST['site_code'], get_domen_hash(), $config, true );
else echo $lang['trial_act6']." ".$lang['key_format']." <b>XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</b>";
exit();
}
В файле "engine/inc/include/init.php"
удаляем код:
Код:
if( $lic_tr AND $is_loged_in AND $mod != "editnews" AND $mod != "main" AND $mod != "upgrade" AND $mod != "") {
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_post" );
$stats_news = $row['count'];
$row = $db->super_query( "SELECT COUNT(*) as count FROM " . PREFIX . "_comments" );
$count_comments = $row['count'];
if( $stats_news > 100 ) msg( "error", "error", $lang['trial_limit'].'<br /><br />'.$activation_field );
if( $count_comments > 200 ) msg( "error", "error", $lang['trial_limit'].'<br /><br />'.$activation_field );
}
В файле "engine/inc/include/functions.inc.php"
удаляем код:
Код:
function send_activation( $query ) {
$data = http_get_contents("https://dle-news.ru/extras/activate2009.php?".$query);
if( $data !== false ) {
if( stripos( $data, "antw:activated" ) !== false ) return "1";
elseif( stripos( $data, "antw:denied;expires" ) !== false ) return "-4";
elseif( stripos( $data, "antw:denied" ) !== false ) return "0";
}
return "-1";
}
function get_domen_hash() {
$domen_md5 = explode( '.', $_SERVER['HTTP_HOST'] );
$count_key = count( $domen_md5 ) - 1;
unset( $domen_md5[$count_key] );
if( end( $domen_md5 ) == "com" OR end( $domen_md5 ) == "net" ) $count_key --;
$domen_md5 = $domen_md5[$count_key - 1];
$domen_md5 = md5( md5( $domen_md5 . "780918" ) );
return $domen_md5;
}
function dle_activation($key, $domen_md5, $config, $offline = false) {
global $lang;
$domain = urlencode( strip_tags( $_SERVER['HTTP_HOST'] ) );
$key = trim( strip_tags( $key ) );
@header( "Content-type: text/html; charset=utf-8" );
if ( $offline ) {
if( $key == md5( $domen_md5 . DINITVERSION ) ) {
$buffer = "1";
} else {
$buffer = "-2";
}
} else {
if( strlen( $key ) == 32 ) {
$buffer = "-3";
} else {
$buffer = send_activation( "domain={$domain}&key={$key}&site_key={$domen_md5}&c_id=" . VERSIONID );
}
}
switch ($buffer) {
case "-4" :
$buffer = $lang['trial_act7'];
break;
case "-3" :
$buffer = $lang['trial_act6']." ".$lang['key_format']." <b>XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</b>";
break;
case "-2" :
$buffer = $lang['trial_act5'];
break;
case "-1" :
$buffer = $lang['trial_act1'] . $lang['get_offline_key'] . " <a href=\"https://dle-news.ru/index.php?do=offlinekey&domain={$domain}&key={$key}&site_key={$domen_md5}&c_id=" . VERSIONID . "\" class=\"status-error\" target=\"_blank\">" . $lang['get_key'] . "</a> " . $lang['key_activation'];
$buffer .= "<br /><br /><b>$lang[site_code]</b><span class=\"sitecodefield\"><input class=\"classic width-400 mr-10 ml-10\" type=\"text\" name=\"sitecode\" id=\"sitecode\"> <button onclick=\"dle_activation( 'code' ); return false;\" class=\"btn bg-teal btn-raised btn-sm\">{$lang['trial_act']}</button></span><div id=\"result_info\" style=\"color:red;\"></div>";
break;
case "0" :
$buffer = $lang['trial_act2'];
break;
case "1" :
$config['key'] = md5( $domen_md5 . DINITVERSION );
$handler = fopen( ENGINE_DIR . '/data/config.php', "w" );
fwrite( $handler, "<?PHP \n\n//System Configurations\n\n\$config = array (\n\n" );
foreach ( $config as $name => $value ) {
fwrite( $handler, "'{$name}' => \"{$value}\",\n\n" );
}
fwrite( $handler, ");\n\n?>" );
fclose( $handler );
if (function_exists('opcache_reset')) {
opcache_reset();
}
$buffer = $lang['trial_act3'];
break;
default :
$buffer = $lang['trial_act4'] . $lang['get_offline_key'] . " <a href=\"https://dle-news.ru/index.php?do=offlinekey&domain={$domain}&key={$key}&site_key={$domen_md5}&c_id=" . VERSIONID . "\" >" . $lang['get_key'] . "</a> " . $lang['key_activation'];
}
echo $buffer;
die();
}
В файле upload/engine/ajax/updates.php
Удаляем:
Код:
$data = @file_get_contents("http://dle-news.ru/extras/updates.php?version_id=".$_REQUEST['versionid']."&build=".$_REQUEST['build']."&key=".$config['key']."&lang=".$lang['wysiwyg_language']);
В файле upload/engine/ajax/updates.php
Находим возле $_REQUEST['action'] == "checklicense":
Код:
if( $_REQUEST['user_hash'] == "" OR $_REQUEST['user_hash'] != $dle_login_hash ) {
die( "Hacking attempt! User not found" );
}
if( strlen(trim((string)$_REQUEST['dle_key'])) != 29 ){
echo "{\"error\": \"{$lang['upgr_f_error_5']}\"}";
die();
}
$params = array(
'action' => 'info',
'domain' => $_SERVER['HTTP_HOST'],
'key' => (string)$_REQUEST['dle_key'],
'version' => VERSIONID,
'build' => BUILDID,
'site_key' => get_domen_hash()
);
$data = http_get_contents("https://dle-news.ru/extras/upgrade/index.php?".http_build_query($params, '', '&') );
if( $data !== false ) {
$data = json_decode ($data, true);
if(is_array($data) ) {
if( $data['error']) {
if( $data['error'] == "-3" ) $data['error'] = $lang['upgr_f_error_2'];
if( $data['error'] == "-2" ) $data['error'] = $lang['upgr_f_error_3'];
if( $data['error'] == "-1" ) $data['error'] = $lang['upgr_f_error_4'];
echo "{\"error\": \"{$data['error']}\"}";
die();
}
if( $data['distr']['version'] ) {
if( version_compare(VERSIONID, $data['distr']['version'], '>') ) {
echo "{\"error\": \"{$lang['upgr_f_error_6']}\"}";
die();
}
if( version_compare(VERSIONID, $data['distr']['version'], '==') AND version_compare(BUILDID, $data['distr']['build'], '>=') AND !defined('DEMOVERSION') ) {
echo "{\"error\": \"{$lang['upgr_f_error_6']}\"}";
die();
}
$_SESSION['distr'] = $data['distr'];
echo "{\"status\": \"ok\"}";
die();
}
}
}
echo "{\"error\": \"{$lang['upgr_f_error_1']}\"}";
die();
заменяем на:
Код:
if( $_REQUEST['user_hash'] == "" OR $_REQUEST['user_hash'] != $dle_login_hash ) {
die( "Hacking attempt! User not found" );
}
if( strlen(trim((string)$_REQUEST['dle_key'])) != 29 ){
echo "{\"error\": \"{$lang['upgr_f_error_5']}\"}";
die();
}
echo "{\"status\": \"ok\"}";
die();