From ee488e5225853b63f1e1aa756f83743b30a1b755 Mon Sep 17 00:00:00 2001 From: filip Date: Tue, 17 May 2016 22:01:02 +0200 Subject: adding checksum links ... + some small html code readabilty improvements + some bolding added to improve emphasize + a div closure fix --- en/downloads/get/index.php | 68 ++++++++++++++++++++++++++++------------------ 1 file changed, 41 insertions(+), 27 deletions(-) (limited to 'en/downloads') 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('%s%s', rewrite_city($city), implode(', ', $mirs)); } - $alternative_mirrors .= sprintf('%s%s', count($cities), $country, implode('', $s)); + $alternative_mirrors .= sprintf('%s%s' . PHP_EOL, count($cities), $country, implode('', $s)); } // Feedback about current mirror location + trigger for alt mirrors. @@ -213,41 +213,55 @@ if (!isset($_SERVER['APP_MODE']) || $_SERVER['APP_MODE'] == 'prod') {

- 0) - || (isset($product['sha512'])) && strlen($product['sha512']) > 0) - && !$torrent - ): ?> -

-
-
-$ md5sum ", $product['md5'], "\n"; endif; ?>
-
 $ sha1sum ", $product['sha1'], "\n"; endif;
+$checksums = array('md5', 'sha1', 'sha512');
+$sum_links = array();
+$chksm_cmd = '';
+foreach ($checksums as $checksum) {
+    if (array_key_exists($checksum, $product)) {
+        $sum_links[] = '' . basename($download) . '.' . $checksum . '';
+        $chksm_cmd .= '$ ' . $checksum . 'sum ' . basename($download) . "\n" . $product[$checksum] . "\n" . PHP_EOL;
+    }
 }
 ?>
-
 $ sha512sum ", $product['sha512'], "\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 . '
' . PHP_EOL; + echo '
' . PHP_EOL;
+    echo $chksm_cmd;
+    echo '
' . PHP_EOL . '

'; + _g('If checksums do not match, DO NOT use this ISO. 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.

"; +// } + ?> -
-

DO NOT use this ISO. Double-check and try to download again.'); ?>

+echo sprintf(_r('First you need to import the key from a MIT PGP Public Key Server:'), 'https://pgp.mit.edu/'); ?>

 $ gpg --keyserver pgp.mit.edu --recv-keys EDCA7A90
 

-gpg: key EDCA7A90: public key "Mageia Release <release@mageia.org>" imported
+gpg: key EDCA7A90: public key "Mageia Release <release@mageia.org>" imported
 
 
 
-gpg: key EDCA7A90: "Mageia Release <release@mageia.org>" not changed
+gpg: key EDCA7A90: "Mageia Release <release@mageia.org>" not changed
 

@@ -255,15 +269,14 @@ $ gpg --verify /your/download/location/.md5.gp
 

-gpg: Good signature from "Mageia Release <release@mageia.org>"
+gpg: Good signature from "Mageia Release <release@mageia.org>"
 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
+Primary key fingerprint: B210 76A0 CBE4 D93D 66A9  D08D 835E 41F4 EDCA 7A90
 

-
- +

{lang: ''} +

-- cgit v1.2.1