aboutsummaryrefslogtreecommitdiffstats
path: root/en/downloads/get/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'en/downloads/get/index.php')
-rw-r--r--en/downloads/get/index.php37
1 files changed, 17 insertions, 20 deletions
diff --git a/en/downloads/get/index.php b/en/downloads/get/index.php
index 2b7cfed17..43c415c21 100644
--- a/en/downloads/get/index.php
+++ b/en/downloads/get/index.php
@@ -234,15 +234,20 @@ if (!isset($_SERVER['APP_MODE']) || $_SERVER['APP_MODE'] == 'prod') {
$checksums = array('md5', 'sha1', 'sha512');
$sum_links = array();
$chksm_cmd = '';
+$sig_links = array();
foreach ($checksums as $checksum) {
- if (array_key_exists($checksum, $product)) {
- $sum_links[] = '<a href="' . $download . '.' . $checksum . '">' . basename($download) . '.' . $checksum . '</a>';
+ if (isset($product[$checksum])) {
+ $sum_links[] = "<a href=\"$download.$checksum\">" . basename($download) . ".$checksum</a>";
$chksm_cmd .= '$ ' . $checksum . 'sum ' . basename($download) . "\n<strong>" . $product[$checksum] . "</strong>\n" . PHP_EOL;
+ if (isset($product["$checksum.gpg"])) {
+ $sig_links[] = "<a href=\"$download.$checksum.gpg\">" . basename($download) . ".$checksum.gpg</a>";
+ }
}
}
?>
<?php
-$num_checksums = count($sum_links);
+$num_checksums = count($sum_links);
+// only output for nontorrent DL and if there are any checksums files present
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;
@@ -250,25 +255,16 @@ if ($num_checksums > 0 && !$torrent) {
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, ' ');
+ $checksum_links = array_to_list($sum_links, ' ' . _r('and', ' '), _r(',', ' '));
+ $signature_links = array_to_list($sig_links, ' ' . _r('and', ' '), _r(',', ' '));
+ _g('Checksums are available for download as files:', null, ' ');
echo "$checksum_links.</p>";
-// }
-
?>
+<?php if (count($sig_links) > 0) { // only output if there are any signatures files present ?>
<p><?php _g('You can also verify the signature of an ISO.', null, ' ');
-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>
+_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://pgp.mit.edu/'); ?></p>
<pre class="term">
$ gpg --keyserver pgp.mit.edu --recv-keys EDCA7A90
</pre>
@@ -292,8 +288,9 @@ gpg: There is no indication that the signature belongs to the owner.
<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>
+<?php } // signatures check end ?>
</div>
-<?php } ?>
+<?php } // checksums check end ?>
</div>
<!-- alternative mirrors table -->