Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (!defined('DATALIFEENGINE')) {
- die("Hacking attempt!");
- }
- include_once ROOT_DIR .'/language/'.$config['langs'] .'/referer.lng';
- include (ENGINE_DIR .'/data/referer.perf.php');
- include (ENGINE_DIR .'/data/referer.conf.php');
- function check_group_r ($groups,$block,$action = true) {
- global $member_id;
- $groups = explode( ',',$groups );
- if( $action ) {
- if( !in_array( $member_id['user_group'],$groups ) ) return "";
- }else {
- if( in_array( $member_id['user_group'],$groups ) ) return "";
- }
- $block = str_replace( '\"','"',$block );
- return $block;
- }
- function referer_get_contents($file) {
- $data = false;
- if( function_exists( 'curl_init') ) {
- $ch = curl_init();
- curl_setopt( $ch,CURLOPT_URL,$file );
- curl_setopt( $ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT'] );
- @curl_setopt( $ch,CURLOPT_FOLLOWLOCATION,1 );
- curl_setopt( $ch,CURLOPT_RETURNTRANSFER,1 );
- curl_setopt( $ch,CURLOPT_CONNECTTIMEOUT,10 );
- $data = curl_exec( $ch );
- curl_close( $ch );
- }
- if( $data ) {
- return $data;
- }else {
- $data = @file_get_contents( $file );
- if( $data ) return $data;
- else return false;
- }
- }
- function cref($prefix,$rlog = false)
- {
- $cache_id = md5(__FILE__);
- if ($rlog == "log") {
- $filename = ENGINE_DIR ."/data/".$prefix ."_".$cache_id .".tmp";
- }elseif ($rlog == "hidden") {
- $filename = ENGINE_DIR ."/cache/".$prefix ."_".$cache_id .".tmp";
- }else {
- $filename = ENGINE_DIR .'/cache/'.$prefix .'.tmp';
- }
- $referer_cache = @file_get_contents($filename);
- if (strpos ( $referer_cache,"[group=") !== false) {
- $referer_cache = preg_replace ( "#\\[group=(.+?)\\](.*?)\\[/group\\]#ies","check_group_r('\\1', '\\2')",$referer_cache );
- }
- if (strpos ( $referer_cache,"[not-group=") !== false) {
- $referer_cache = preg_replace ( "#\\[not-group=(.+?)\\](.*?)\\[/not-group\\]#ies","check_group_r('\\1', '\\2', false)",$referer_cache );
- }
- return $referer_cache;
- }
- function create_cref($prefix,$cache_text,$rlog = false)
- {
- $cache_id = md5(__FILE__);
- if ($rlog == "log") {
- $filename = ENGINE_DIR ."/data/".$prefix ."_".$cache_id .".tmp";
- }elseif ($rlog == "hidden") {
- $filename = ENGINE_DIR ."/cache/".$prefix ."_".$cache_id .".tmp";
- }else {
- $filename = ENGINE_DIR .'/cache/'.$prefix .'.tmp';
- }
- $fp = fopen($filename,'wb+');
- fwrite($fp,$cache_text);
- fclose($fp);
- @chmod($filename,0666);
- }
- function clear_cref($prefix,$rlog = false,$cache_id = false)
- {
- $cache_id = md5(__FILE__);
- if ($rlog == "log") {
- $filename = ENGINE_DIR ."/data/".$prefix ."_".$cache_id .".tmp";
- }elseif ($rlog == "hidden") {
- $filename = ENGINE_DIR ."/cache/".$prefix ."_".$cache_id .".tmp";
- }else {
- $filename = ENGINE_DIR .'/cache/'.$prefix .'.tmp';
- }
- @unlink($filename);
- }
- function chektime_cref($prefix,$timer,$rlog = false)
- {
- $cache_id = md5(__FILE__);
- if($timer) {
- $real_time = time();
- if ($rlog == "hidden") {
- $date_file = filemtime(ENGINE_DIR ."/cache/".$prefix ."_".$cache_id .".tmp");
- }else {
- $date_file = filemtime(ENGINE_DIR .'/cache/'.$prefix .'.tmp');
- }
- if($real_time >$date_file +($timer * 60)) {
- if ($rlog == "hidden") {
- clear_cref($prefix,"hidden");
- }else {
- clear_cref($prefix);
- }
- }
- }else {
- if ($rlog == "hidden") {
- clear_cref($prefix,"hidden");
- }else {
- clear_cref($prefix);
- }
- }
- }
- function time_cref($prefix,$rlog = false)
- {
- $cache_id = md5(__FILE__);
- if ($rlog == "hidden") {
- return filemtime(ENGINE_DIR ."/cache/".$prefix ."_".$cache_id .".tmp");
- }else {
- return filemtime(ENGINE_DIR .'/cache/'.$prefix .'.tmp');
- }
- }
- $file_patch = __FILE__;
- if ($config['http_home_url'] == "") {
- $config['http_home_url'] = explode("engine/inc/include/referer.init.php",$_SERVER['PHP_SELF']);
- $config['http_home_url'] = reset($config['http_home_url']);
- $config['http_home_url'] = "http://".$_SERVER['HTTP_HOST'] .$config['http_home_url'];
- }
- $lic_tr = false;
- $site_key = str_replace("www.","",strtolower($config['http_home_url']));
- $site_key = md5(md5(base64_encode(md5($file_patch .$site_key ."[9911]"))));
- if ($site_key == $confms['key']) $lic_tr = true;
- if (!$lic_tr) $confms['func_copyright'] = "yes";
- function referer_block_end ($referer)
- {
- global $confms,$langms;
- if (!$referer) $referer = $langms['no_seatrans'];
- $autor_site = array('http://getdle.org.ru/'=>"1",'http://dle-solutions.ru/'=>"2");
- $site = array_rand($autor_site,1);
- if ($confms['func_copyright'] == "yes") {
- $copyright .= "<div align=\"right\" style=\"font-size: 9px; padding-right: 3px;\">© <a href=\"{$site}\" target=\"_blank\" style=\"text-decoration: none; font-size: 9px;\">DLE Solutions</a></div>";
- }else $copyright = "";
- $referer = $referer .$copyright;
- create_cref ('referer_block',$referer,"hidden");
- if (strpos ( $referer,"[group=") !== false) {
- $referer = preg_replace ( "#\\[group=(.+?)\\](.*?)\\[/group\\]#ies","check_group_r('\\1', '\\2')",$referer );
- }
- if (strpos ( $referer,"[not-group=") !== false) {
- $referer = preg_replace ( "#\\[not-group=(.+?)\\](.*?)\\[/not-group\\]#ies","check_group_r('\\1', '\\2', false)",$referer );
- }
- return $referer;
- }
- if ($_REQUEST['ractivation'] == "yes") {
- $domain = strtolower($_SERVER['HTTP_HOST']);
- $key = trim($_REQUEST['key']);
- if (!@referer_get_contents("http://dle-solutions.ru/extras/referer/connect.txt")) {
- @header("Content-type: text/css; charset=".$config['charset']);
- die("<div style=\"background: lightyellow;border:1px dotted rgb(190,190,190); padding: 5px; color:#FF6666;\" class=\"navigation\">Активация модуля не была произведена, не удалось установить подключение к удаленному серверу. Попробуйте повторить активацию немного позднее.</div>");
- }
- if (!$key) {
- @header("Content-type: text/css; charset=".$config['charset']);
- die("<div style=\"background: lightyellow;border:1px dotted rgb(190,190,190); padding: 5px; color:#FF6666;\" class=\"navigation\">Форма не была заполнена, повторите ввод ключа!</div>");
- }else {
- $host = 'www.dle-solutions.ru';
- $path = '/extras/referer/activate.php';
- $query = "domain={$domain}&key={$key}";
- if (@referer_get_contents("http://".$host .$path ."?".$query) == "yes") {
- include_once (ENGINE_DIR .'/data/referer.conf.php');
- $site_key = str_replace("www.","",strtolower($config['http_home_url']));
- $site_key = md5(md5(base64_encode(md5($file_patch .$site_key ."[9911]"))));
- $confms['key'] = $site_key;
- $handler = fopen(ENGINE_DIR .'/data/referer.conf.php',"w");
- fwrite($handler,"<?PHP\r\n\$confms = array (\r\n");
- foreach($confms as $name =>$value) {
- $value = addslashes($value);
- fwrite($handler,"'{$name}' => \"{$value}\",\r\n");
- }
- fwrite($handler,");\r\n?>");
- fclose($handler);
- $referer_logs = cref ('referer_logs',"log");
- $datetime = time() +($config['date_adjust'] * 60);
- $date = date("d.m.Y H:i:s",$datetime);
- if (!$referer_logs) {
- $reflog = "{$date} – Выполнена успешная активация модуля;";
- }else {
- $reflog = "{$date} – Выполнена успешная активация модуля;|{$referer_logs}";
- }
- create_cref ('referer_logs',$reflog,"log");
- @header("Content-type: text/css; charset=".$config['charset']);
- die("<div style=\"background: lightyellow;border:1px dotted rgb(190,190,190); padding: 5px; color:#64c245;\" class=\"navigation\">Благодарим Вас за покупку нашего модуля. Надеемся что работа с ним доставит Вам только удовольствие! Обновите страницу, чтобы добавился новый пункт отключения копирайта!</div>");
- }else {
- @header("Content-type: text/css; charset=".$config['charset']);
- die("<div style=\"background: lightyellow;border:1px dotted rgb(190,190,190); padding: 5px; color:#FF6666;\" class=\"navigation\">Активация модуля не была произведена, введенные данные не соответствуют необходимым, либо данная копия была уже активирована на другом сервере.</div>");
- }
- };
- };
- ?>
Advertisement
Add Comment
Please, Sign In to add comment