[GRASS-SVN] r29899 - grass-web/trunk
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jan 30 14:07:48 EST 2008
Author: wolf
Date: 2008-01-30 14:07:47 -0500 (Wed, 30 Jan 2008)
New Revision: 29899
Modified:
grass-web/trunk/index.php
Log:
Fixed case wgen geolocation service is down
Modified: grass-web/trunk/index.php
===================================================================
--- grass-web/trunk/index.php 2008-01-30 12:21:28 UTC (rev 29898)
+++ grass-web/trunk/index.php 2008-01-30 19:07:47 UTC (rev 29899)
@@ -46,31 +46,33 @@
curl_close($ch);
if (!$file_contents) {
echo "[unknown mirror country]\n";
- exit;
}
- // e.g.: "Country: UNITED STATES (US) City: San Diego, CA"
- $MYSTATETMP = explode(":", $file_contents);
- $MYSTATETMP2 = explode(")", $MYSTATETMP[1]);
- $MYSTATE = $MYSTATETMP2[0] . ")";
- if ($MYIP == "198.202.74.219")
- echo "<font size=\"-1\"><i>You are at the official GRASS site in $MYSTATE
+ else {
+ // e.g.: "Country: UNITED STATES (US) City: San Diego, CA"
+ $MYSTATETMP = explode(":", $file_contents);
+ $MYSTATETMP2 = explode(")", $MYSTATETMP[1]);
+ $MYSTATE = $MYSTATETMP2[0] . ")";
+ if ($MYIP == "198.202.74.219")
+ echo "<font size=\"-1\"><i>You are at the official GRASS site in $MYSTATE
(<a href=\"mirrors.php\">mirror sites</a>)<br>";
- else
- echo "<font size=\"-1\"><i>You are at a GRASS mirror site in $MYSTATE (other
+ else
+ echo "<font size=\"-1\"><i>You are at a GRASS mirror site in $MYSTATE (other
<a href=\"mirrors.php\">mirror sites</a>)<br>";
+ }
} elseif (function_exists('fopen') && allow_url_fopen ) {
$MYIP = $_SERVER['SERVER_ADDR'];
$file = fopen ("http://api.hostip.info/get_html.php?ip=$MYIP", "r");
if (!$file) {
echo "[unknown mirror country]\n";
- exit;
}
- $line = fgets ($file, 34);
- $MYSTATETMP = explode(":", $line);
- $MYSTATE = $MYSTATETMP[1];
- echo "<font size=\"-1\"><i>You are a GRASS mirror site in $MYSTATE (other
+ else {
+ $line = fgets ($file, 34);
+ $MYSTATETMP = explode(":", $line);
+ $MYSTATE = $MYSTATETMP[1];
+ echo "<font size=\"-1\"><i>You are a GRASS mirror site in $MYSTATE (other
<a href=\"mirrors.php\">mirror sites</a>)<br>";
- fclose($file);
+ fclose($file);
+ }
} else {
echo "<font size=\"-1\"><i>You are at a GRASS mirror site
(other <a href=\"mirrors.php\">mirror sites</a>)<br>";
More information about the grass-commit
mailing list