diff options
author | Vinicius Coque <vinicius.coque@bluepex.com> | 2011-03-31 13:34:36 -0300 |
---|---|---|
committer | Vinicius Coque <vinicius.coque@bluepex.com> | 2011-03-31 13:34:36 -0300 |
commit | 9158988035a48f77a83d81fc31fc649d2fade3e7 (patch) | |
tree | 4381f25e92a64e208d70e997fea25be881313220 /usr/local/www | |
parent | bca0472d5589beefe197858dfe10739108196c62 (diff) | |
parent | 78544d4a99c90f3c19b3cd53c2f1873b625c21bf (diff) | |
download | pfsense-9158988035a48f77a83d81fc31fc649d2fade3e7.zip pfsense-9158988035a48f77a83d81fc31fc649d2fade3e7.tar.gz |
Merge remote-tracking branch 'mainline/master' into inc
Diffstat (limited to 'usr/local/www')
-rw-r--r-- | usr/local/www/system_advanced_admin.php | 2 | ||||
-rw-r--r-- | usr/local/www/system_camanager.php | 79 | ||||
-rw-r--r-- | usr/local/www/system_crlmanager.php | 18 | ||||
-rw-r--r-- | usr/local/www/themes/the_wall/rrdcolors.inc.php | 1 |
4 files changed, 75 insertions, 25 deletions
diff --git a/usr/local/www/system_advanced_admin.php b/usr/local/www/system_advanced_admin.php index e23ceb0..9f8b2d7 100644 --- a/usr/local/www/system_advanced_admin.php +++ b/usr/local/www/system_advanced_admin.php @@ -331,7 +331,7 @@ function prot_change() { <td width="22%" valign="top" class="vncell"><?=gettext("WebGUI login messages"); ?></td> <td width="78%" class="vtable"> <input name="quietlogin" type="checkbox" id="quietlogin" value="yes" <?php if ($pconfig['quietlogin']) echo "checked"; ?> /> - <strong><?=gettext("Disable webConfigurator successful logins"); ?></strong> + <strong><?=gettext("Disable logging of webConfigurator successful logins"); ?></strong> <br/> <?php echo gettext("When this is checked, successful logins to the webConfigurator " . "will not be logged."); diff --git a/usr/local/www/system_camanager.php b/usr/local/www/system_camanager.php index 6eddd39..3bf1165 100644 --- a/usr/local/www/system_camanager.php +++ b/usr/local/www/system_camanager.php @@ -84,6 +84,19 @@ if ($act == "del") { $savemsg = sprintf(gettext("Certificate Authority %s successfully deleted"), $name) . "<br/>"; } +if ($act == "edit") { + if (!$a_ca[$id]) { + pfSenseHeader("system_camanager.php"); + exit; + } + $pconfig['descr'] = $a_ca[$id]['descr']; + $pconfig['refid'] = $a_ca[$id]['refid']; + $pconfig['cert'] = base64_decode($a_ca[$id]['crt']); + $pconfig['serial'] = $a_ca[$id]['serial']; + if (!empty($a_ca[$id]['prv'])) + $pconfig['key'] = base64_decode($a_ca[$id]['prv']); +} + if ($act == "new") { $pconfig['method'] = $_GET['method']; $pconfig['keylen'] = "2048"; @@ -169,26 +182,37 @@ if ($_POST) { if (!$input_errors) { $ca = array(); - $ca['refid'] = uniqid(); + if (!isset($pconfig['refid']) || empty($pconfig['refid'])) + $ca['refid'] = uniqid(); + else + $ca['refid'] = $pconfig['refid']; + if (isset($id) && $a_ca[$id]) $ca = $a_ca[$id]; - $ca['descr'] = $pconfig['descr']; - - if ($pconfig['method'] == "existing") - ca_import($ca, $pconfig['cert'], $pconfig['key']); - - if ($pconfig['method'] == "internal") - { - $dn = array( - 'countryName' => $pconfig['dn_country'], - 'stateOrProvinceName' => $pconfig['dn_state'], - 'localityName' => $pconfig['dn_city'], - 'organizationName' => $pconfig['dn_organization'], - 'emailAddress' => $pconfig['dn_email'], - 'commonName' => $pconfig['dn_commonname']); - - ca_create($ca, $pconfig['keylen'], $pconfig['lifetime'], $dn); + $ca['descr'] = $pconfig['descr']; + + if ($_POST['edit'] == "edit") { + $ca['descr'] = $pconfig['descr']; + $ca['refid'] = $pconfig['refid']; + $ca['serial'] = $pconfig['serial']; + $ca['crt'] = base64_encode($pconfig['cert']); + if (!empty($pconfig['key'])) + $ca['prv'] = base64_encode($pconfig['key']); + } else { + if ($pconfig['method'] == "existing") + ca_import($ca, $pconfig['cert'], $pconfig['key'], $pconfig['serial']); + + if ($pconfig['method'] == "internal") { + $dn = array( + 'countryName' => $pconfig['dn_country'], + 'stateOrProvinceName' => $pconfig['dn_state'], + 'localityName' => $pconfig['dn_city'], + 'organizationName' => $pconfig['dn_organization'], + 'emailAddress' => $pconfig['dn_email'], + 'commonName' => $pconfig['dn_commonname']); + ca_create($ca, $pconfig['keylen'], $pconfig['lifetime'], $dn); + } } if (isset($id) && $a_ca[$id]) @@ -250,9 +274,14 @@ function method_change() { <td id="mainarea"> <div class="tabcont"> - <?php if ($act == "new" || $act == gettext("Save") || $input_errors): ?> + <?php if ($act == "new" || $act == "edit" || $act == gettext("Save") || $input_errors): ?> <form action="system_camanager.php" method="post" name="iform" id="iform"> + <?php if ($act == "edit"): ?> + <input type="hidden" name="edit" value="edit" id="edit"> + <input type="hidden" name="id" value="<?php echo $id; ?>" id="id"> + <input type="hidden" name="refid" value="<?php echo $pconfig['refid']; ?>" id="refid"> + <?php endif; ?> <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Descriptive name");?></td> @@ -260,7 +289,7 @@ function method_change() { <input name="descr" type="text" class="formfld unknown" id="descr" size="20" value="<?=htmlspecialchars($pconfig['descr']);?>"/> </td> </tr> - <?php if (!isset($id)): ?> + <?php if (!isset($id) || $act == "edit"): ?> <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Method");?></td> <td width="78%" class="vtable"> @@ -303,6 +332,15 @@ function method_change() { <?=gettext("Paste the private key for the above certificate here. This is optional in most cases, but required if you need to generate a Certificate Revocation List (CRL).");?></td> </td> </tr> + + <?php if (!isset($id) || $act == "edit"): ?> + <tr> + <td width="22%" valign="top" class="vncellreq"><?=gettext("Serial");?></td> + <td width="78%" class="vtable"> + <input name="serial" type="text" class="formfld unknown" id="serial" size="20" value="<?=htmlspecialchars($pconfig['serial']);?>"/> + </td> + </tr> + <?php endif; ?> </table> <table width="100%" border="0" cellpadding="6" cellspacing="0" id="internal"> @@ -482,6 +520,9 @@ function method_change() { <td class="listr"><?=$certcount;?> </td> <td class="listr"><?=$subj;?> </td> <td valign="middle" nowrap class="list"> + <a href="system_camanager.php?act=edit&id=<?=$i;?>")"> + <img src="/themes/<?= $g['theme'];?>/images/icons/icon_e.gif" title="<?=gettext("export ca");?>" alt="<?=gettext("edit ca");?>" width="17" height="17" border="0" /> + </a> <a href="system_camanager.php?act=exp&id=<?=$i;?>")"> <img src="/themes/<?= $g['theme'];?>/images/icons/icon_down.gif" title="<?=gettext("export ca");?>" alt="<?=gettext("export ca");?>" width="17" height="17" border="0" /> </a> diff --git a/usr/local/www/system_crlmanager.php b/usr/local/www/system_crlmanager.php index 90b61d6..67e4b2f 100644 --- a/usr/local/www/system_crlmanager.php +++ b/usr/local/www/system_crlmanager.php @@ -253,14 +253,14 @@ include("head.inc"); function method_change() { - method = document.iform.method.selectedIndex; + method = document.iform.method.value; switch (method) { - case 0: + case "internal": document.getElementById("existing").style.display="none"; document.getElementById("internal").style.display=""; break; - case 1: + case "existing": document.getElementById("existing").style.display=""; document.getElementById("internal").style.display="none"; break; @@ -302,6 +302,8 @@ function method_change() { <select name='method' id='method' class="formselect" onchange='method_change()'> <?php foreach($crl_methods as $method => $desc): + if (($_GET['importonly'] == "yes") && ($method != "existing")) + continue; $selected = ""; if ($pconfig['method'] == $method) $selected = "selected"; @@ -502,9 +504,9 @@ function method_change() { if($ca['prv']) { $caimg = "/themes/{$g['theme']}/images/icons/icon_frmfld_cert.png"; - $internal = "YES"; + $cainternal = "YES"; } else - continue; + $cainternal = "NO"; ?> <tr> <td class="listlr" colspan="4"> @@ -520,9 +522,15 @@ function method_change() { </table> </td> <td class="list"> + <?php if ($cainternal == "YES"): ?> <a href="system_crlmanager.php?act=new&caref=<?php echo $ca['refid']; ?>"> <img src="/themes/<?= $g['theme'];?>/images/icons/icon_plus.gif" title="<?=gettext("Add or Import CRL for ") . $ca['descr'];?>" alt="<?=gettext("add crl");?>" width="17" height="17" border="0" /> </a> + <?php else: ?> + <a href="system_crlmanager.php?act=new&caref=<?php echo $ca['refid']; ?>&importonly=yes"> + <img src="/themes/<?= $g['theme'];?>/images/icons/icon_plus.gif" title="<?=gettext("Import CRL for ") . $ca['descr'];?>" alt="<?=gettext("add crl");?>" width="17" height="17" border="0" /> + </a> + <?php endif; ?> </td> </tr> diff --git a/usr/local/www/themes/the_wall/rrdcolors.inc.php b/usr/local/www/themes/the_wall/rrdcolors.inc.php index c2bc613..09956cc 100644 --- a/usr/local/www/themes/the_wall/rrdcolors.inc.php +++ b/usr/local/www/themes/the_wall/rrdcolors.inc.php @@ -32,6 +32,7 @@ $colortrafficup = array("666666", "CCCCCC"); $colortrafficdown = array("990000", "CC0000"); +$colortraffic95 = array("660000", "FF0000"); $colorpacketsup = array("666666", "CCCCCC"); $colorpacketsdown = array("990000", "CC0000"); $colorstates = array('990000','a83c3c','b36666','bd9090','cccccc','000000'); |