PageRenderTime 38ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 1ms

/contrib/other/po-checker/modules/log.php

http://tortoisesvn.googlecode.com/
PHP | 50 lines | 31 code | 7 blank | 12 comment | 5 complexity | a4284a4182b30658d40b294e7b2aaf10 MD5 | raw file
Possible License(s): CC-BY-SA-3.0, GPL-3.0, MPL-2.0-no-copyleft-exception, GPL-2.0, LGPL-2.0, LGPL-2.1, BSD-3-Clause, Apache-2.0, LGPL-3.0
  1. <?php
  2. //define("MODULE_PATH", "../modules/");
  3. //define("EXT_PATH", MODULE_PATH."ext/");
  4. #include("../scripts/session.php");
  5. #include("mysql.php");
  6. // common modules
  7. include_once (EXT_PATH."Html.php");
  8. include_once (EXT_PATH."tools.php");
  9. #include_once (EXT_PATH."Table.php");
  10. #include_once (MODULE_PATH."csv.php");
  11. #require_once (MODULE_PATH."lib/parsecsv/parsecsv.lib.php");
  12. // LOG USER
  13. $log['AppName']="SVN";
  14. //Log_MailAccess($log);
  15. // get host
  16. $ip=$_SERVER["REMOTE_ADDR"];
  17. $agent=$_SERVER["HTTP_USER_AGENT"];
  18. $host=exec("host $ip");
  19. $host=substr($host, strrpos($host, " "));
  20. $host=trim($host);
  21. if ($host=="3(NXDOMAIN)") {
  22. $host="unknown";
  23. } else {
  24. $_SERVER["REMOTE_NAME"]="$host";
  25. }
  26. ob_start();
  27. echo "<html>";
  28. ksort($_SERVER);
  29. PrintArray($_SERVER);
  30. $dumpServer=ob_get_contents();
  31. echo "</html>";
  32. ob_end_clean();
  33. $to="otik@printflow.eu";
  34. $sub="SVN:$lang $ip $host";
  35. $msg="";
  36. $msg=$msg."\n\n\n".$dumpServer;
  37. $ahead="";
  38. $ahead.="MIME-Version: 1.0\r\n";
  39. $ahead.="Content-type: text/html; charset=UTF-8\r\n";
  40. $crawler=preg_match("/(crawl|msnbot|yandex\.ru)/", $host) || preg_match("/(msnbot|spider)/", $agent);
  41. if (!preg_match("/192\.168\.10\.2|217\.75\.82\.141/", $_SERVER["REMOTE_ADDR"]) && !$crawler) {
  42. //mail($to, $sub, $msg, $ahead);
  43. }