Remove email address from file name and add download option

This commit is contained in:
John Crisp
2020-02-21 15:07:29 +01:00
parent 12ab5ac984
commit 6a9bdaf70a

View File

@@ -36,7 +36,12 @@ case display:
case 'download': case 'download':
$rec = CAdb_get_entry($serial); $rec = CAdb_get_entry($serial);
upload("$config[cert_dir]/$serial.der", "$rec[common_name] ($rec[email]).cer", 'application/pkix-cert'); upload("$config[cert_dir]/$serial.der", "$rec[common_name].cer", 'application/pkix-cert');
break;
case 'download_pem':
$rec = CAdb_get_entry($serial);
upload("$config[new_certs_dir]/$serial.pem", "$rec[common_name].pem", 'application/pkix-cert');
break; break;
case search: case search:
@@ -97,6 +102,7 @@ case search:
if ($rec['status'] != 'Revoked') { if ($rec['status'] != 'Revoked') {
?> ?>
<a href="<?php echo $PHP_SELF?>?stage=download&serial=<?php echo htvar($rec['serial'])?>"><img src=images/download.png alt="Download" title="Download the certificate so that you may send encrypted e-mail"></a> <a href="<?php echo $PHP_SELF?>?stage=download&serial=<?php echo htvar($rec['serial'])?>"><img src=images/download.png alt="Download" title="Download the certificate so that you may send encrypted e-mail"></a>
<a href="<?php echo $PHP_SELF?>?stage=download_pem&serial=<?=htvar($rec['serial'])?>"><img src=images/download.png alt="Download (in PEM format)" title="Download in PEM format"></a>
<?php <?php
} }
print '</td></tr>'; print '</td></tr>';