diff options
Diffstat (limited to 'en/downloads/get')
-rw-r--r-- | en/downloads/get/index.php | 14 |
1 files changed, 13 insertions, 1 deletions
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'])) { ?></p> <div class="dlinfo"> - <p><?php echo $dl2_mirror_alt; ?></p> + <p><?php if($show_alternate_mirrors) { echo $dl2_mirror_alt; }?></p> <?php $checksum_specifics = array( 'md5' => 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. <?php } // checksums check end ?> </div> + <?php if($show_alternate_mirrors) { ?> <!-- alternative mirrors table --> <table class="dlt2 dlinfo table table-sm table-bordered table-striped" id="om" style="display: none;"> <thead class="thead-inverse"><tr><th><?php _g('Country'); ?></th> @@ -335,6 +346,7 @@ gpg: There is no indication that the signature belongs to the owner. <th><?php _g('Download mirrors'); ?></th></tr></thead> <tbody><?php echo $alternative_mirrors; ?></tbody> </table> + <?php } ?> <hr /> |