[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: www/areas/download
From: Stephan Binner <binner () kde ! org>
Date: 2005-07-27 9:42:03
Message-ID: 1122457323.493507.16919.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 439159 by binner:
also don't redirect for apt
M +8 -8 download.php
--- trunk/www/areas/download/download.php #439158:439159
@@ -8,10 +8,10 @@
$ip = (double) ($dotted[0] * 16777216) + ($dotted[1] * 65536) + ($dotted[2] * \
256) + ($dotted[3]); return $ip;
}
-
+
$uri = htmlspecialchars(($HTTP_GET_VARS["url"]));
$requested_unstable = strpos($uri, 'nstable');
- $redirectme = (strpos($HTTP_SERVER_VARS['HTTP_USER_AGENT'], "Wget") !== false);
+ $redirectme = (strpos($HTTP_SERVER_VARS['HTTP_USER_AGENT'], "Wget") !== false) || \
(strpos($HTTP_SERVER_VARS['HTTP_USER_AGENT'], "APT-HTTP") !== false);
$candidates = Array();
$local_sites = Array();
@@ -26,8 +26,8 @@
?>
<p>The following is a list of KDE FTP mirrors that have recently updated
from our master ftp distribution site. The "hours" display tells you how \
many hours ago
-a mirror has been detected to have synced last time. A sorted list of
-<a href="http://www.kde.org/mirrors/ftp.php">all known KDE FTP mirrors</a> is \
available, as well as +a mirror has been detected to have synced last time. A sorted \
list of +<a href="http://www.kde.org/mirrors/ftp.php">all known KDE FTP mirrors</a> \
is available, as well as <a href="http://download.kde.org/mirrorstatus.html">status \
of all KDE FTP mirrors</a>. </p>
<?php
@@ -57,7 +57,7 @@
$countrymapper = Array( "CA" => "US", "UM" => "US", "CS" => "YU", "GB" => "UK", \
"LV" => "EE", "SK" => "CZ", "DK" => "SE" ); if(array_key_exists($countrycode, \
$countrymapper))
- $countrycode=$countrymapper[$countrycode];
+ $countrycode=$countrymapper[$countrycode];
# 96 hours ago
$deadline = time() - 96*60*60;
@@ -113,12 +113,12 @@
echo count($local_sites) > 1 ? "<h2>Local mirrors</h2>\n" : "<h2>Local \
mirror</h2>"; echo "\n<ul>";
}
-
+
$ra = count($local_sites) > 1 ? array_rand($local_sites, count($local_sites)) : \
array_keys($local_sites);
-
+
#$ra = array_rand($local_sites, count($local_sites));
# just redirect to our first hit
- if($redirectme)
+ if($redirectme)
header("Location: " . $local_sites[$ra[0]] . $uri);
else {
foreach ($ra as $i => $u) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic