X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/9549bda474c704dc763856924a03e28cd255419c..d76eca32f4c96f5725877aec555c7352a8452ba2:/website/reverse.php?ds=sidebyside diff --git a/website/reverse.php b/website/reverse.php index 70779dd7..95889fc4 100755 --- a/website/reverse.php +++ b/website/reverse.php @@ -1,7 +1,25 @@ 0) + { + $fLoadAvg = getLoadAverage(); + if ($fLoadAvg >= CONST_BlockReverseMaxLoad) { + header('HTTP/1.0 403 Forbidden'); + header('Content-type: text/html; charset=utf-8'); + echo "

App temporarily blocked

"; + echo "Your application has been temporarily blocked from the OpenStreetMap Nominatim "; + echo "geolocation service due to high server load."; + echo "\n\n"; + exit; + } + + } + + if (strpos(CONST_BulkUserIPs, ','.$_SERVER["REMOTE_ADDR"].',') !== false) { $fLoadAvg = getLoadAverage(); @@ -28,8 +46,8 @@ $bShowAddressDetails = true; if (isset($_GET['addressdetails'])) $bShowAddressDetails = (bool)$_GET['addressdetails']; - // Prefered language - $aLangPrefOrder = getPrefferedLangauges(); + // Preferred language + $aLangPrefOrder = getPreferredLanguages(); $sLanguagePrefArraySQL = "ARRAY[".join(',',array_map("getDBQuoted",$aLangPrefOrder))."]"; $hLog = logStart($oDB, 'reverse', $_SERVER['QUERY_STRING'], $aLangPrefOrder); @@ -136,8 +154,9 @@ $sSQL .= " get_name_by_language(name, ARRAY['ref']) as ref,"; $sSQL .= " st_y(st_centroid(geometry)) as lat, st_x(st_centroid(geometry)) as lon"; $sSQL .= " from placex where place_id = $iPlaceID "; -//var_dump($sSQL); + $aPlace = $oDB->getRow($sSQL); +//var_dump($sSQL, $aPlace); exit; if ($bShowAddressDetails) {