From b33d2044731da96e6c737ba404d339fc2a7a355e Mon Sep 17 00:00:00 2001 From: Manuel Hiebel Date: Tue, 9 Nov 2021 19:34:20 +0100 Subject: check if release is in archives, if yes redirect to the only mirror (distrib-coffee and remove alternative mirrors --- en/downloads/get/index.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'en/downloads/get') diff --git a/en/downloads/get/index.php b/en/downloads/get/index.php index b20ee9f9c..ca7e9b4c1 100644 --- a/en/downloads/get/index.php +++ b/en/downloads/get/index.php @@ -84,13 +84,23 @@ try { $product['file'] = $release . '-' . $type . '-' . $lang . '.' . $extension; $product['name'] = $product['file']; } + //check if release is in archives, if yes redirect to the only mirror + $archives = range(1,6); + $release = explode(' ', $product['name']); + if (in_array($release[1][0], $archives)){ + $download_tmpl = get_download_link($product, $torrent); + $download = str_replace('$MIRROR', 'https://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia-archive', $download_tmpl); + $show_alternate_mirrors = false; + } else { $all_mirrors = get_mirrors_for($product['file'], 'en', get('country'), true, $documentation, true); $one_mirror = $all_mirrors[0]; $alt_mirrors = $all_mirrors[1]; $download_tmpl = get_download_link($product, $torrent); + $show_alternate_mirrors = true; // Step 2. Make the actual download link against the preferred mirror returned. $download = str_replace('$MIRROR', $one_mirror['mirror_url'], $download_tmpl); + } // TODO do not redirect if it's a bot! $js_redirect = sprintf( @@ -251,7 +261,7 @@ if(isset($product['obsolete'])) { ?>

-

+

array('md5sum', _r('md5 hash of the contents of the iso image')), @@ -328,6 +338,7 @@ gpg: There is no indication that the signature belongs to the owner.
+ @@ -335,6 +346,7 @@ gpg: There is no indication that the signature belongs to the owner. +
-- cgit v1.2.1