summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/system_certmanager.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2015-12-02 15:23:44 -0500
committerjim-p <jimp@pfsense.org>2015-12-02 15:23:44 -0500
commit53f5b15f375b30eddf9c7970127a853126e2893d (patch)
treed1152b3072728880e5e17f411e776d915c53514a /src/usr/local/www/system_certmanager.php
parent991af0a81cc08f713dd3a1fc65806c02f71453dc (diff)
downloadpfsense-53f5b15f375b30eddf9c7970127a853126e2893d.zip
pfsense-53f5b15f375b30eddf9c7970127a853126e2893d.tar.gz
Some more adjustments to CSR handling for ticket #5561
* Change the order of the actions for CSR so edit is first * Change the edit icon to a pencil to be more obvious * Change the export action for a CSR to export the request data
Diffstat (limited to 'src/usr/local/www/system_certmanager.php')
-rw-r--r--src/usr/local/www/system_certmanager.php33
1 files changed, 26 insertions, 7 deletions
diff --git a/src/usr/local/www/system_certmanager.php b/src/usr/local/www/system_certmanager.php
index 5ea1823..5ee2c25 100644
--- a/src/usr/local/www/system_certmanager.php
+++ b/src/usr/local/www/system_certmanager.php
@@ -174,6 +174,24 @@ if ($act == "exp") {
exit;
}
+if ($act == "req") {
+
+ if (!$a_cert[$id]) {
+ pfSenseHeader("system_certmanager.php");
+ exit;
+ }
+
+ $exp_name = urlencode("{$a_cert[$id]['descr']}.req");
+ $exp_data = base64_decode($a_cert[$id]['csr']);
+ $exp_size = strlen($exp_data);
+
+ header("Content-Type: application/octet-stream");
+ header("Content-Disposition: attachment; filename={$exp_name}");
+ header("Content-Length: $exp_size");
+ echo $exp_data;
+ exit;
+}
+
if ($act == "key") {
if (!$a_cert[$id]) {
@@ -1057,17 +1075,18 @@ foreach($a_cert as $i => $cert):
<?php endif?>
</td>
<td>
- <?php if (! $cert['csr']): ?>
- <a href="system_certmanager.php?act=exp&amp;id=<?=$i?>" class="fa fa-sign-in" title="<?=gettext("Export")?>"></a>
- <a href="system_certmanager.php?act=key&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export key")?>"></a>
- <a href="system_certmanager.php?act=p12&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export P12")?>"> P12</a>
+ <?php if (!$cert['csr']): ?>
+ <a href="system_certmanager.php?act=exp&amp;id=<?=$i?>" class="fa fa-sign-in" title="<?=gettext("Export Certificate")?>"></a>
+ <a href="system_certmanager.php?act=key&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export Key")?>"></a>
+ <a href="system_certmanager.php?act=p12&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export P12")?>"> P12</a>
+ <?php else: ?>
+ <a href="system_certmanager.php?act=csr&amp;id=<?=$i?>" class="fa fa-pencil" title="<?=gettext("Update CSR")?>"></a>
+ <a href="system_certmanager.php?act=req&amp;id=<?=$i?>" class="fa fa-sign-in" title="<?=gettext("Export Request")?>"></a>
+ <a href="system_certmanager.php?act=key&amp;id=<?=$i?>" class="fa fa-key" title="<?=gettext("Export Key")?>"></a>
<?php endif?>
<?php if (!cert_in_use($cert['refid'])): ?>
<a href="system_certmanager.php?act=del&amp;id=<?=$i?>" class="fa fa-trash" title="<?=gettext("Delete")?>"></a>
<?php endif?>
- <?php if ($cert['csr']): ?>
- <a href="system_certmanager.php?act=csr&amp;id=<?=$i?>" class="fa fa-refresh" title="<?=gettext("Update csr")?>"></a>
- <?php endif?>
</td>
</tr>
<?php endforeach; ?>
OpenPOWER on IntegriCloud