]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/init-website.php
Merge pull request #469 from lonvia/refactor-php
[nominatim.git] / lib / init-website.php
index e47b73fb4bfa0d29b53f19c0c481e70d460a061c..04bc518ca9d3ec044dee0aa16e23ac5e064b016d 100644 (file)
@@ -1,5 +1,6 @@
 <?php
        require_once('init.php');
 <?php
        require_once('init.php');
+       require_once('website.php');
 
        if (CONST_NoAccessControl)
        {
 
        if (CONST_NoAccessControl)
        {
        }
        if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') exit;
 
        }
        if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') exit;
 
-       if (CONST_ClosedForIndexing && strpos(CONST_ClosedForIndexingExceptionIPs, ','.$_SERVER["REMOTE_ADDR"].',') === false)
-       {
-               echo "Closed for re-indexing...";
-               exit;
-       }
-
        $aBucketKeys = array();
 
        if (isset($_SERVER["HTTP_REFERER"])) $aBucketKeys[] = str_replace('www.','',strtolower(parse_url($_SERVER["HTTP_REFERER"], PHP_URL_HOST)));
        $aBucketKeys = array();
 
        if (isset($_SERVER["HTTP_REFERER"])) $aBucketKeys[] = str_replace('www.','',strtolower(parse_url($_SERVER["HTTP_REFERER"], PHP_URL_HOST)));
@@ -54,6 +49,7 @@
 
        if (strpos(CONST_BlockedIPs, ','.$_SERVER["REMOTE_ADDR"].',') !== false || $fBucketVal >= CONST_ConnectionBucket_BlockLimit)
        {
 
        if (strpos(CONST_BlockedIPs, ','.$_SERVER["REMOTE_ADDR"].',') !== false || $fBucketVal >= CONST_ConnectionBucket_BlockLimit)
        {
+               header("HTTP/1.0 429 Too Many Requests");
                echo "Your IP has been blocked. \n";
                echo CONST_BlockMessage;
                exit;
                echo "Your IP has been blocked. \n";
                echo CONST_BlockMessage;
                exit;