Guest User

Untitled

a guest
Sep 5th, 2011
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.97 KB | None | 0 0
  1. <?php
  2. if (!defined('DATALIFEENGINE')) {
  3. die("Hacking attempt!");
  4. }
  5. include_once ROOT_DIR .'/language/'.$config['langs'] .'/referer.lng';
  6. include (ENGINE_DIR .'/data/referer.perf.php');
  7. include (ENGINE_DIR .'/data/referer.conf.php');
  8. function check_group_r ($groups,$block,$action = true) {
  9. global $member_id;
  10. $groups = explode( ',',$groups );
  11. if( $action ) {
  12. if( !in_array( $member_id['user_group'],$groups ) ) return "";
  13. }else {
  14. if( in_array( $member_id['user_group'],$groups ) ) return "";
  15. }
  16. $block = str_replace( '\"','"',$block );
  17. return $block;
  18. }
  19. function referer_get_contents($file) {
  20. $data = false;
  21. if( function_exists( 'curl_init') ) {
  22. $ch = curl_init();
  23. curl_setopt( $ch,CURLOPT_URL,$file );
  24. curl_setopt( $ch,CURLOPT_USERAGENT,$_SERVER['HTTP_USER_AGENT'] );
  25. @curl_setopt( $ch,CURLOPT_FOLLOWLOCATION,1 );
  26. curl_setopt( $ch,CURLOPT_RETURNTRANSFER,1 );
  27. curl_setopt( $ch,CURLOPT_CONNECTTIMEOUT,10 );
  28. $data = curl_exec( $ch );
  29. curl_close( $ch );
  30. }
  31. if( $data ) {
  32. return $data;
  33. }else {
  34. $data = @file_get_contents( $file );
  35. if( $data ) return $data;
  36. else return false;
  37. }
  38. }
  39. function cref($prefix,$rlog = false)
  40. {
  41. $cache_id = md5(__FILE__);
  42. if ($rlog == "log") {
  43. $filename = ENGINE_DIR ."/data/".$prefix ."_".$cache_id .".tmp";
  44. }elseif ($rlog == "hidden") {
  45. $filename = ENGINE_DIR ."/cache/".$prefix ."_".$cache_id .".tmp";
  46. }else {
  47. $filename = ENGINE_DIR .'/cache/'.$prefix .'.tmp';
  48. }
  49. $referer_cache = @file_get_contents($filename);
  50. if (strpos ( $referer_cache,"[group=") !== false) {
  51. $referer_cache = preg_replace ( "#\\[group=(.+?)\\](.*?)\\[/group\\]#ies","check_group_r('\\1', '\\2')",$referer_cache );
  52. }
  53. if (strpos ( $referer_cache,"[not-group=") !== false) {
  54. $referer_cache = preg_replace ( "#\\[not-group=(.+?)\\](.*?)\\[/not-group\\]#ies","check_group_r('\\1', '\\2', false)",$referer_cache );
  55. }
  56. return $referer_cache;
  57. }
  58. function create_cref($prefix,$cache_text,$rlog = false)
  59. {
  60. $cache_id = md5(__FILE__);
  61. if ($rlog == "log") {
  62. $filename = ENGINE_DIR ."/data/".$prefix ."_".$cache_id .".tmp";
  63. }elseif ($rlog == "hidden") {
  64. $filename = ENGINE_DIR ."/cache/".$prefix ."_".$cache_id .".tmp";
  65. }else {
  66. $filename = ENGINE_DIR .'/cache/'.$prefix .'.tmp';
  67. }
  68. $fp = fopen($filename,'wb+');
  69. fwrite($fp,$cache_text);
  70. fclose($fp);
  71. @chmod($filename,0666);
  72. }
  73. function clear_cref($prefix,$rlog = false,$cache_id = false)
  74. {
  75. $cache_id = md5(__FILE__);
  76. if ($rlog == "log") {
  77. $filename = ENGINE_DIR ."/data/".$prefix ."_".$cache_id .".tmp";
  78. }elseif ($rlog == "hidden") {
  79. $filename = ENGINE_DIR ."/cache/".$prefix ."_".$cache_id .".tmp";
  80. }else {
  81. $filename = ENGINE_DIR .'/cache/'.$prefix .'.tmp';
  82. }
  83. @unlink($filename);
  84. }
  85. function chektime_cref($prefix,$timer,$rlog = false)
  86. {
  87. $cache_id = md5(__FILE__);
  88. if($timer) {
  89. $real_time = time();
  90. if ($rlog == "hidden") {
  91. $date_file = filemtime(ENGINE_DIR ."/cache/".$prefix ."_".$cache_id .".tmp");
  92. }else {
  93. $date_file = filemtime(ENGINE_DIR .'/cache/'.$prefix .'.tmp');
  94. }
  95. if($real_time >$date_file +($timer * 60)) {
  96. if ($rlog == "hidden") {
  97. clear_cref($prefix,"hidden");
  98. }else {
  99. clear_cref($prefix);
  100. }
  101. }
  102. }else {
  103. if ($rlog == "hidden") {
  104. clear_cref($prefix,"hidden");
  105. }else {
  106. clear_cref($prefix);
  107. }
  108. }
  109. }
  110. function time_cref($prefix,$rlog = false)
  111. {
  112. $cache_id = md5(__FILE__);
  113. if ($rlog == "hidden") {
  114. return filemtime(ENGINE_DIR ."/cache/".$prefix ."_".$cache_id .".tmp");
  115. }else {
  116. return filemtime(ENGINE_DIR .'/cache/'.$prefix .'.tmp');
  117. }
  118. }
  119. $file_patch = __FILE__;
  120. if ($config['http_home_url'] == "") {
  121. $config['http_home_url'] = explode("engine/inc/include/referer.init.php",$_SERVER['PHP_SELF']);
  122. $config['http_home_url'] = reset($config['http_home_url']);
  123. $config['http_home_url'] = "http://".$_SERVER['HTTP_HOST'] .$config['http_home_url'];
  124. }
  125. $lic_tr = false;
  126. $site_key = str_replace("www.","",strtolower($config['http_home_url']));
  127. $site_key = md5(md5(base64_encode(md5($file_patch .$site_key ."[9911]"))));
  128. if ($site_key == $confms['key']) $lic_tr = true;
  129. if (!$lic_tr) $confms['func_copyright'] = "yes";
  130. function referer_block_end ($referer)
  131. {
  132. global $confms,$langms;
  133. if (!$referer) $referer = $langms['no_seatrans'];
  134. $autor_site = array('http://getdle.org.ru/'=>"1",'http://dle-solutions.ru/'=>"2");
  135. $site = array_rand($autor_site,1);
  136. if ($confms['func_copyright'] == "yes") {
  137. $copyright .= "<div align=\"right\" style=\"font-size: 9px; padding-right: 3px;\">&copy; <a href=\"{$site}\" target=\"_blank\" style=\"text-decoration: none; font-size: 9px;\">DLE Solutions</a></div>";
  138. }else $copyright = "";
  139. $referer = $referer .$copyright;
  140. create_cref ('referer_block',$referer,"hidden");
  141. if (strpos ( $referer,"[group=") !== false) {
  142. $referer = preg_replace ( "#\\[group=(.+?)\\](.*?)\\[/group\\]#ies","check_group_r('\\1', '\\2')",$referer );
  143. }
  144. if (strpos ( $referer,"[not-group=") !== false) {
  145. $referer = preg_replace ( "#\\[not-group=(.+?)\\](.*?)\\[/not-group\\]#ies","check_group_r('\\1', '\\2', false)",$referer );
  146. }
  147. return $referer;
  148. }
  149. if ($_REQUEST['ractivation'] == "yes") {
  150. $domain = strtolower($_SERVER['HTTP_HOST']);
  151. $key = trim($_REQUEST['key']);
  152. if (!@referer_get_contents("http://dle-solutions.ru/extras/referer/connect.txt")) {
  153. @header("Content-type: text/css; charset=".$config['charset']);
  154. die("<div style=\"background: lightyellow;border:1px dotted rgb(190,190,190); padding: 5px; color:#FF6666;\" class=\"navigation\">Активация модуля не была произведена, не удалось установить подключение к удаленному серверу. Попробуйте повторить активацию немного позднее.</div>");
  155. }
  156. if (!$key) {
  157. @header("Content-type: text/css; charset=".$config['charset']);
  158. die("<div style=\"background: lightyellow;border:1px dotted rgb(190,190,190); padding: 5px; color:#FF6666;\" class=\"navigation\">Форма не была заполнена, повторите ввод ключа!</div>");
  159. }else {
  160. $host = 'www.dle-solutions.ru';
  161. $path = '/extras/referer/activate.php';
  162. $query = "domain={$domain}&key={$key}";
  163. if (@referer_get_contents("http://".$host .$path ."?".$query) == "yes") {
  164. include_once (ENGINE_DIR .'/data/referer.conf.php');
  165. $site_key = str_replace("www.","",strtolower($config['http_home_url']));
  166. $site_key = md5(md5(base64_encode(md5($file_patch .$site_key ."[9911]"))));
  167. $confms['key'] = $site_key;
  168. $handler = fopen(ENGINE_DIR .'/data/referer.conf.php',"w");
  169. fwrite($handler,"<?PHP\r\n\$confms = array (\r\n");
  170. foreach($confms as $name =>$value) {
  171. $value = addslashes($value);
  172. fwrite($handler,"'{$name}' => \"{$value}\",\r\n");
  173. }
  174. fwrite($handler,");\r\n?>");
  175. fclose($handler);
  176. $referer_logs = cref ('referer_logs',"log");
  177. $datetime = time() +($config['date_adjust'] * 60);
  178. $date = date("d.m.Y H:i:s",$datetime);
  179. if (!$referer_logs) {
  180. $reflog = "{$date} &ndash; Выполнена успешная активация модуля;";
  181. }else {
  182. $reflog = "{$date} &ndash; Выполнена успешная активация модуля;|{$referer_logs}";
  183. }
  184. create_cref ('referer_logs',$reflog,"log");
  185. @header("Content-type: text/css; charset=".$config['charset']);
  186. die("<div style=\"background: lightyellow;border:1px dotted rgb(190,190,190); padding: 5px; color:#64c245;\" class=\"navigation\">Благодарим Вас за покупку нашего модуля. Надеемся что работа с ним доставит Вам только удовольствие! Обновите страницу, чтобы добавился новый пункт отключения копирайта!</div>");
  187. }else {
  188. @header("Content-type: text/css; charset=".$config['charset']);
  189. die("<div style=\"background: lightyellow;border:1px dotted rgb(190,190,190); padding: 5px; color:#FF6666;\" class=\"navigation\">Активация модуля не была произведена, введенные данные не соответствуют необходимым, либо данная копия была уже активирована на другом сервере.</div>");
  190. }
  191. };
  192. };
  193. ?>
Advertisement
Add Comment
Please, Sign In to add comment