summaryrefslogtreecommitdiffstats
path: root/usr/local/www/system_camanager.php
diff options
context:
space:
mode:
authorMatthew Grooms <mgrooms@pfsense.org>2008-09-03 03:53:11 +0000
committerMatthew Grooms <mgrooms@pfsense.org>2008-09-03 03:53:11 +0000
commit93823b10147aa446945ed4b8ddef40cb56c96479 (patch)
tree8cf1074d7721e6f66ed9f72bb740b49f9f46cb0a /usr/local/www/system_camanager.php
parent7da118047ac7a450227b25f2b5cb467b647585ea (diff)
downloadpfsense-93823b10147aa446945ed4b8ddef40cb56c96479.zip
pfsense-93823b10147aa446945ed4b8ddef40cb56c96479.tar.gz
Add options to export ca, certificate and user certificate data from the
webui.
Diffstat (limited to 'usr/local/www/system_camanager.php')
-rw-r--r--usr/local/www/system_camanager.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/usr/local/www/system_camanager.php b/usr/local/www/system_camanager.php
index dff286d..68b05ef 100644
--- a/usr/local/www/system_camanager.php
+++ b/usr/local/www/system_camanager.php
@@ -88,6 +88,24 @@ if ($act == "new") {
$pconfig['dn_commonname'] = "internal-ca";
}
+if ($act == "exp") {
+
+ if (!$a_ca[$id]) {
+ pfSenseHeader("system_camanager.php");
+ exit;
+ }
+
+ $exp_name = urlencode("{$a_ca[$id]['name']}.crt");
+ $exp_data = base64_decode($a_ca[$id]['crt']);
+ $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 ($_POST) {
unset($input_errors);
@@ -412,6 +430,9 @@ function method_change() {
<td class="listr"><?=$certcount;?>&nbsp;</td>
<td class="listr"><?=$subj;?>&nbsp;</td>
<td valign="middle" nowrap class="list">
+ <a href="system_camanager.php?act=exp&id=<?=$i;?>")">
+ <img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="export ca" alt="export ca" width="17" height="17" border="0" />
+ </a>
<a href="system_camanager.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this Certificate Authority and all associated Certificates?");?>')">
<img src="/themes/<?= $g['theme'];?>/images/icons/icon_x.gif" title="delete ca" alt="delete ca" width="17" height="17" border="0" />
</a>
OpenPOWER on IntegriCloud