diff options
Diffstat (limited to 'en/downloads/get/index.php')
-rw-r--r-- | en/downloads/get/index.php | 55 |
1 files changed, 40 insertions, 15 deletions
diff --git a/en/downloads/get/index.php b/en/downloads/get/index.php index add253c0f..f20c3dea6 100644 --- a/en/downloads/get/index.php +++ b/en/downloads/get/index.php @@ -40,6 +40,7 @@ define('ALIGNMENT', 'Center'); require '../../../langs.php'; $dictionary = read_translation_file($locale, array('downloads/get', 'common_footer')); require 'lib.php'; +$rtl = is_locale_rtl($locale); // request $product = get('q'); @@ -83,13 +84,23 @@ try { $product['file'] = $release . '-' . $type . '-' . $lang . '.' . $extension; $product['name'] = $product['file']; } - $all_mirrors = get_mirrors_for($product['file'], 'en', get('country'), true, $documentation); + $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); - + //check if release is in archives, if yes redirect to the only mirror + $archives = range(1,8); + $release = explode(' ', $product['name']); + if (in_array($release[1][0], $archives)){ + $alt_mirrors = array(); + $mirror_link = 'https://distrib-coffee.ipsl.jussieu.fr/pub/linux/Mageia-archive'; + $show_alternate_mirrors = false; + } else { + $alt_mirrors = $all_mirrors[1]; + $mirror_link = $one_mirror['mirror_url']; + $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); + $download = str_replace('$MIRROR', $mirror_link, $download_tmpl); // TODO do not redirect if it's a bot! $js_redirect = sprintf( @@ -214,7 +225,7 @@ if ($debug) $js_redirect = null; ?><!DOCTYPE html> -<html lang="<?php echo $locale; ?>"> +<html <?php echo $rtl ? 'dir="rtl"' : 'dir="ltr"'?> lang="<?php echo $locale; ?>"> <head> <meta charset="utf-8"> <title><?php echo $title; ?> | <?php _g('Mageia Downloads') ?></title> @@ -227,7 +238,7 @@ if (!isset($_SERVER['APP_MODE']) || $_SERVER['APP_MODE'] == 'prod') { } ?> </head> -<body class="downloads"> +<body <?php echo $rtl ? 'style="text-align: right;"' : ''?> class="downloads"> <?php echo $hsnav; ?> <h1 id="mgnavt"><?php echo sprintf(_r('Download %s'), '<em class="tag">' . $title . '</em>')?></h1> <div id="doc4" class="yui-t7" style="margin-bottom: 0px;"> @@ -250,17 +261,29 @@ 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 -$checksums = array('md5', 'sha1', 'sha512'); +$checksum_specifics = array( + 'md5' => array('md5sum', _r('md5 hash of the contents of the iso image')), + 'sha1' => array('sha1sum', _r('sha1 512 bit hash')), + 'sha512'=> array('sha512sum', _r('sha2 512 bit hash')), + 'sha3' => array('sha3-512sum', _r('sha3 512 bit hash')) +); $sum_links = array(); $chksm_cmd = ''; +$chksm_cmd_2 = ''; $sig_links = array(); -foreach ($checksums as $checksum) { +foreach (array_keys($checksum_specifics) as $checksum) { if (isset($product[$checksum])) { - $sum_links[] = "<a href=\"$download.$checksum\">" . basename($download) . '.' . $checksum .'</a><span class="copy-icon" data-toggle="tooltip" title="' . _r("Copy"). '" data-clip="'. $product[$checksum]. '"></span>'; - $chksm_cmd .= '$ ' . $checksum . 'sum -c ' . basename($download) . '.' . $checksum . ' # ' . _r('You need both iso and checksum file in the same folder'); + $each_checksum = "<a href=\"$download.$checksum\">" . basename($download) . '.' . $checksum . '</a><span class="copy-icon" data-toggle="tooltip" title="'; + $each_checksum .= _r("Copy") . '" data-clip="' . $product[$checksum] . '"></span> (' . $checksum_specifics[$checksum][1] . ')'; + $sum_links[] = $each_checksum; + $chksm_cmd_pre_text = "$ # " . _r('You need both iso and checksum file in the same folder') . "\n"; + $chksm_cmd .= "$ " . $checksum_specifics[$checksum][0] . ' -c ' . basename($download) . '.' . $checksum; $chksm_cmd .= "\n<strong>" . basename($download) . ": " . _r("OK") . " </strong>\n" . PHP_EOL; + $chksm_cmd_mid_text = "$ # " . _r('You can also compare checksum directly from this web page without checksum file') . "\n"; + $chksm_cmd_2 .= "$ " . $checksum_specifics[$checksum][0] . ' ' . basename($download); + $chksm_cmd_2 .= "\n<strong>" . $product[$checksum] . ' ' . basename($download) . " </strong>\n" . PHP_EOL; if (isset($product["$checksum.gpg"])) { $sig_links[] = "<a href=\"$download.$checksum.gpg\">" . basename($download) . ".$checksum.gpg</a>"; } @@ -277,7 +300,7 @@ if ($num_checksums > 0 && !$torrent) { echo "$checksum_links.</p>"; echo PHP_EOL . '<div id="check-signs">' . PHP_EOL; echo '<pre class="term pre-scrollable">' . PHP_EOL; - echo $chksm_cmd; + echo $chksm_cmd_pre_text . $chksm_cmd . $chksm_cmd_mid_text . $chksm_cmd_2; echo '</pre>' . PHP_EOL . '<p>'; _g('If checksums do not match, <strong>DO NOT use this ISO</strong>. Double-check and try to download again.', null, ' '); $signature_links = array_to_list($sig_links, ' ' . _r('and', ' '), _r(',', ' ')); @@ -286,9 +309,9 @@ if ($num_checksums > 0 && !$torrent) { <p><?php _g('You can also verify the signature of an ISO.', null, ' '); _g('They are also available for download as files:', null, ' '); echo "$signature_links. "; -echo sprintf(_r('First you need to import the "Mageia Release" key from a <a href="%s">MIT PGP Public Key Server</a>:'), 'https://sks-keyservers.net/'); ?></p> +echo sprintf(_r('First you need to import the "Mageia Release" key from a <a href="%s">PGP Public Key Server</a>:'), 'https://keyserver.ubuntu.com/'); ?></p> <pre class="term pre-scrollable"> -$ gpg --keyserver pool.sks-keyservers.net --recv-keys EDCA7A90 +$ gpg --keyserver keyserver.ubuntu.com --recv-keys EDCA7A90 </pre> <p><?php _g('In response there should be one of the following lines:'); ?></p> <pre class="term pre-scrollable"> @@ -315,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> @@ -322,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 /> @@ -341,7 +366,7 @@ gpg: There is no indication that the signature belongs to the owner. <p><?php echo sprintf(_r('If you still encounter this error and think IT SHOULD NOT HAPPEN – please tell us:')); ?></p> <ul> - <li><?php _g('directly on <a href="irc://irc.freenode.net/#mageia-atelier">#mageia-atelier on Freenode IRC</a>,'); ?></li> + <li><?php _g('directly on <a href="ircs://irc.libera.chat:6697/#mageia-atelier">#mageia-atelier on Libera.Chat IRC</a>,'); ?></li> <li><?php _g('or <a href="https://twitter.com/mageia_org">via our Twitter account</a>,'); ?></li> <li><?php _g('or with a <a href="https://ml.mageia.org/l/info/atelier-discuss">notice on the Atelier team mailing-list</a>,'); ?></li> <li><?php _g('or a <a href="https://bugs.mageia.org/enter_bug.cgi?product=Websites&format=guided&component=www.mageia.org">bug report</a>.'); ?></li> |