]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 12 Apr 2013 21:23:36 +0000 (23:23 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 12 Apr 2013 21:23:36 +0000 (23:23 +0200)
Conflicts:
lib/log.php
website/reverse.php
website/search.php

1  2 
lib/log.php
settings/settings.php
website/reverse.php
website/search.php

diff --cc lib/log.php
Simple merge
index 159c24ac27544f2c86e289f3b07801c53384b8e3,f2cdf9187d7a373ce6262d07229e73a17941915a..31dc8eac48636c0b2e7f9ecc44fe3f4f4aff8e78
  
        // Website settings
        @define('CONST_NoAccessControl', true);
 -      @define('CONST_ClosedForIndexing', false);
 -      @define('CONST_ClosedForIndexingExceptionIPs', '');
        @define('CONST_BlockedIPs', '');
 +      @define('CONST_IPBanFile', CONST_BasePath.'/settings/ip_blocks');
 +      @define('CONST_WhitelistedIPs', '');
 +      @define('CONST_BlockedUserAgents', '');
 +      @define('CONST_BlockReverseMaxLoad', 15);
        @define('CONST_BulkUserIPs', '');
  
 -      @define('CONST_Website_BaseURL', 'http://'.php_uname('n').'/');
 +      @define('CONST_Website_BaseURL', 'http://nominatim.openstreetmap.org/');
        @define('CONST_Tile_Default', 'Mapnik');
  
-       @define('CONST_Default_Language', 'xx');
+       @define('CONST_Default_Language', false);
        @define('CONST_Default_Lat', 20.0);
        @define('CONST_Default_Lon', 0.0);
        @define('CONST_Default_Zoom', 2);
index c348659e25d02fd7cdc136d223ad9b877bd20cd8,fda11582b23abe2ed30a2ac29dcf0447467d9d77..a1c39d9d49e72c1824f43de6bc2bd3a9cb1bc1e9
@@@ -4,43 -4,27 +4,15 @@@
        require_once(dirname(dirname(__FILE__)).'/lib/init-website.php');
        require_once(CONST_BasePath.'/lib/log.php');
  
-     if (preg_match(CONST_BlockedUserAgents, $_SERVER["HTTP_USER_AGENT"]) > 0)
-     {
-         $fLoadAvg = getLoadAverage();
-         if ($fLoadAvg >= CONST_BlockReverseMaxLoad) {
-             header('HTTP/1.0 403 Forbidden');
-             header('Content-type: text/html; charset=utf-8');
-               echo "<html><body><h1>App temporarily blocked</h1>";
-             echo "Your application has been temporarily blocked from the OpenStreetMap Nominatim ";
-             echo "geolocation service due to high server load.";
-             echo "\n</body></html>\n";
-             exit;
-         }
-     }
-         if (strpos(CONST_BulkUserIPs, ','.$_SERVER["REMOTE_ADDR"].',') !== false)
-         {
-                 $fLoadAvg = getLoadAverage();
-                 if ($fLoadAvg > 2) sleep(60);
-                 if ($fLoadAvg > 4) sleep(120);
-                 if ($fLoadAvg > 6)
-                 {
-                         echo "Bulk User: Temporary block due to high server load\n";
-                         exit;
-                 }
-         }
-         $oDB =& getDB();
-         ini_set('memory_limit', '200M');
 -      if (strpos(CONST_BulkUserIPs, ','.$_SERVER["REMOTE_ADDR"].',') !== false)
 -      {
 -              $fLoadAvg = getLoadAverage();
 -              if ($fLoadAvg > 2) sleep(60);
 -              if ($fLoadAvg > 4) sleep(120);
 -              if ($fLoadAvg > 6)
 -              {
 -                      echo "Bulk User: Temporary block due to high server load\n";
 -                      exit;
 -              }
 -      }
--
-         // Format for output
-         $sOutputFormat = 'xml';
-         if (isset($_GET['format']) && ($_GET['format'] == 'xml' || $_GET['format'] == 'json' || $_GET['format'] == 'jsonv2'))
-         {
-                 $sOutputFormat = $_GET['format'];
-         }
+       $oDB =& getDB();
+       ini_set('memory_limit', '200M');
+       // Format for output
+       $sOutputFormat = 'xml';
+       if (isset($_GET['format']) && ($_GET['format'] == 'xml' || $_GET['format'] == 'json' || $_GET['format'] == 'jsonv2'))
+       {
+               $sOutputFormat = $_GET['format'];
+       }
  
        // Show address breakdown
        $bShowAddressDetails = true;
Simple merge