aboutsummaryrefslogtreecommitdiffstats
path: root/en/downloads
diff options
context:
space:
mode:
authorManuel Hiebel <leuhmanu@mageia.org>2021-11-09 19:34:20 +0100
committerManuel Hiebel <leuhmanu@mageia.org>2021-11-09 19:34:20 +0100
commitb33d2044731da96e6c737ba404d339fc2a7a355e (patch)
tree91ecc0dfb9e05467b820dc40ef9f026429f682de /en/downloads
parentba92c8890e27a502e795380246fddfe98dfb4b06 (diff)
downloadwww-b33d2044731da96e6c737ba404d339fc2a7a355e.tar
www-b33d2044731da96e6c737ba404d339fc2a7a355e.tar.gz
www-b33d2044731da96e6c737ba404d339fc2a7a355e.tar.bz2
www-b33d2044731da96e6c737ba404d339fc2a7a355e.tar.xz
www-b33d2044731da96e6c737ba404d339fc2a7a355e.zip
check if release is in archives, if yes redirect to the only mirror (distrib-coffee and remove alternative mirrors
Diffstat (limited to 'en/downloads')
-rw-r--r--en/downloads/get/index.php14
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 />