diff options
Diffstat (limited to 'en/downloads/get')
-rw-r--r-- | en/downloads/get/index.php | 68 |
1 files changed, 41 insertions, 27 deletions
diff --git a/en/downloads/get/index.php b/en/downloads/get/index.php index 1e1a286fe..28579316a 100644 --- a/en/downloads/get/index.php +++ b/en/downloads/get/index.php @@ -111,7 +111,7 @@ try { ksort($g_mirs2); - $alternative_mirrors = ''; + $alternative_mirrors = PHP_EOL; foreach ($g_mirs2 as $country => $cities) { $s = array(); foreach ($cities as $city => $mirrors2) { @@ -127,7 +127,7 @@ try { } $s[] = sprintf('<td>%s</td><td>%s</td>', rewrite_city($city), implode(', ', $mirs)); } - $alternative_mirrors .= sprintf('<tr><td rowspan="%d">%s</td>%s</tr>', count($cities), $country, implode('</tr><tr>', $s)); + $alternative_mirrors .= sprintf('<tr><td rowspan="%d">%s</td>%s</tr>' . PHP_EOL, count($cities), $country, implode('</tr><tr>', $s)); } // Feedback about current mirror location + trigger for alt mirrors. @@ -213,41 +213,55 @@ if (!isset($_SERVER['APP_MODE']) || $_SERVER['APP_MODE'] == 'prod') { <div class="dlinfo"> <p><?php echo $dl2_mirror_alt; ?></p> - <?php - if (((isset($product['md5']) && strlen($product['md5']) > 0) - || (isset($product['sha512'])) && strlen($product['sha512']) > 0) - && !$torrent - ): ?> - <p><?php _g('As soon as your download is complete, you should check that the checksums match:') ?></p> - <div id="check-signs"> - <pre class="term"> -<?php if (strlen($product['md5'])): ?>$ md5sum <?php echo basename($download), "\n<strong>", $product['md5'], "</strong>\n"; endif; ?> - <?php -if (array_key_exists('sha1', $product)) { - if (strlen($product['sha1'])): ?>$ sha1sum <?php echo basename($download), "\n<strong>", $product['sha1'], "</strong>\n"; endif; +$checksums = array('md5', 'sha1', 'sha512'); +$sum_links = array(); +$chksm_cmd = ''; +foreach ($checksums as $checksum) { + if (array_key_exists($checksum, $product)) { + $sum_links[] = '<a href="' . $download . '.' . $checksum . '">' . basename($download) . '.' . $checksum . '</a>'; + $chksm_cmd .= '$ ' . $checksum . 'sum ' . basename($download) . "\n<strong>" . $product[$checksum] . "</strong>\n" . PHP_EOL; + } } ?> - <?php -if (array_key_exists('sha512', $product)) { - if (strlen($product['sha512'])): ?>$ sha512sum <?php echo basename($download), "\n<strong>", $product['sha512'], "</strong>\n"; endif; -} +$num_checksums = count($sum_links); +if ($num_checksums > 0 && !$torrent) { + _g('As soon as your download is complete, you should check that the checksums match:', null, 'p'); + echo PHP_EOL . '<div id="check-signs">' . PHP_EOL; + echo '<pre class="term">' . PHP_EOL; + echo $chksm_cmd; + 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, ' '); + $checksum_links = ''; + $list_sign = _r(',', ' '); + foreach ($sum_links as $checksum_link) { + $checksum_links .= $checksum_link; + if ($num_checksums == 2) { + $list_sign = ' ' . _r('and', ' '); + } else if ($num_checksums == 1) { + $list_sign = ''; + } + $checksum_links .= $list_sign; + $num_checksums--; + } + _g('Checksums are available for download as files', null, ' '); + echo "$checksum_links.</p>"; +// } + ?> -</pre> -<p><?php _g('If checksums do not match, <strong>DO NOT use this ISO</strong>. Double-check and try to download again.'); ?></p> <p><?php _g('You can also verify the signature of an ISO.', null, ' '); -_g('First you need to import the key from a MIT PGP Public Key Server:'); ?></p> +echo sprintf(_r('First you need to import the key from a <a href="%s">MIT PGP Public Key Server</a>:'), 'https://pgp.mit.edu/'); ?></p> <pre class="term"> $ gpg --keyserver pgp.mit.edu --recv-keys EDCA7A90 </pre> <p><?php _g('In response there should be one of the following lines:'); ?></p> <pre class="term"> -gpg: key EDCA7A90: public key "Mageia Release <release@mageia.org>" imported +<strong>gpg: key EDCA7A90: public key "Mageia Release <release@mageia.org>" imported</strong> <?php _g('or if you already imported the key before:'); echo PHP_EOL; ?> -gpg: key EDCA7A90: "Mageia Release <release@mageia.org>" not changed +<strong>gpg: key EDCA7A90: "Mageia Release <release@mageia.org>" not changed</strong> </pre> <p><?php _g('Then you need to verify the signature for the ISO.'); ?></p> <pre class="term"> @@ -255,15 +269,14 @@ $ gpg --verify /your/download/location/<?php echo basename($download); ?>.md5.gp </pre> <p><?php _g('In response there should be a lines like:'); ?></p> <pre class="term"> -gpg: Good signature from "Mageia Release <release@mageia.org>" +<strong>gpg: Good signature from "Mageia Release <release@mageia.org>"</strong> gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. -Primary key fingerprint: B210 76A0 CBE4 D93D 66A9 D08D 835E 41F4 EDCA 7A90 +<strong>Primary key fingerprint: B210 76A0 CBE4 D93D 66A9 D08D 835E 41F4 EDCA 7A90</strong> </pre> <p><?php _g('The warning about uncertified signature is expected.'); ?></p> -<!-- TODO (rda): add direct download links to checksum and signature files as a backup. --> </div> - <?php endif; ?> +<?php } ?> <p><?php if (array_key_exists($_SESSION['country'], $countries)) { $country_name = $countries[$_SESSION['country']]; @@ -343,5 +356,6 @@ document.getElementById("other_mirrors_btn").onclick = function () { <script type="text/javascript" src="https://apis.google.com/js/plusone.js"> {lang: '<?php echo $locale; ?>'} </script> +</div> </body> </html> |