summaryrefslogtreecommitdiffstats
path: root/usr/local/www/firewall_nat_edit.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-03-20 15:58:13 -0400
committerjim-p <jimp@pfsense.org>2013-03-20 15:58:13 -0400
commit33cc1e867728faeeae0716300fc13c6f2824b53d (patch)
tree47b3ab4ab83b52e1754ba15239fc5f15c6035f81 /usr/local/www/firewall_nat_edit.php
parentdaffbc34a912caeab791d2aa31ee70e1aed5a8e1 (diff)
downloadpfsense-33cc1e867728faeeae0716300fc13c6f2824b53d.zip
pfsense-33cc1e867728faeeae0716300fc13c6f2824b53d.tar.gz
Add the user/time tracking to Port forwards and outbound NAT also.
Diffstat (limited to 'usr/local/www/firewall_nat_edit.php')
-rwxr-xr-xusr/local/www/firewall_nat_edit.php41
1 files changed, 40 insertions, 1 deletions
diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php
index 29ca7a5..6f6d5cf 100755
--- a/usr/local/www/firewall_nat_edit.php
+++ b/usr/local/www/firewall_nat_edit.php
@@ -71,9 +71,14 @@ if (isset($_GET['dup'])) {
}
if (isset($id) && $a_nat[$id]) {
+ if ( isset($a_nat[$id]['created']) && is_array($a_nat[$id]['created']) )
+ $pconfig['created'] = $a_nat[$id]['created'];
+
+ if ( isset($a_nat[$id]['updated']) && is_array($a_nat[$id]['updated']) )
+ $pconfig['updated'] = $a_nat[$id]['updated'];
+
$pconfig['disabled'] = isset($a_nat[$id]['disabled']);
$pconfig['nordr'] = isset($a_nat[$id]['nordr']);
-
address_to_pconfig($a_nat[$id]['source'], $pconfig['src'],
$pconfig['srcmask'], $pconfig['srcnot'],
$pconfig['srcbeginport'], $pconfig['srcendport']);
@@ -416,6 +421,11 @@ if ($_POST) {
mark_subsystem_dirty('filter');
}
+ if ( isset($a_nat[$id]['created']) && is_array($a_nat[$id]['created']) )
+ $natent['created'] = $a_nat[$id]['created'];
+
+ $natent['updated'] = make_config_revision_entry();
+
// Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/pre_write_config");
@@ -423,6 +433,7 @@ if ($_POST) {
if (isset($id) && $a_nat[$id])
$a_nat[$id] = $natent;
else {
+ $natent['created'] = make_config_revision_entry();
if (is_numeric($after))
array_splice($a_nat, $after+1, 0, array($natent));
else
@@ -840,6 +851,34 @@ include("fbegin.inc"); ?>
// Allow extending of the firewall edit page and include custom input validation
pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/htmlphplate");
?>
+<?php
+$has_created_time = (isset($a_nat[$id]['created']) && is_array($a_nat[$id]['created']));
+$has_updated_time = (isset($a_nat[$id]['updated']) && is_array($a_nat[$id]['updated']));
+?>
+ <?php if ($has_created_time || $has_updated_time): ?>
+ <tr>
+ <td>&nbsp;</td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top" class="listtopic"><?=gettext("Rule Information");?></td>
+ </tr>
+ <?php if ($has_created_time): ?>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Created");?></td>
+ <td width="78%" class="vtable">
+ <?= date(gettext("n/j/y H:i:s"), $a_nat[$id]['created']['time']) ?> <?= gettext("by") ?> <strong><?= $a_nat[$id]['created']['username'] ?></strong>
+ </td>
+ </tr>
+ <?php endif; ?>
+ <?php if ($has_updated_time): ?>
+ <tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Updated");?></td>
+ <td width="78%" class="vtable">
+ <?= date(gettext("n/j/y H:i:s"), $a_nat[$id]['updated']['time']) ?> <?= gettext("by") ?> <strong><?= $a_nat[$id]['updated']['username'] ?></strong>
+ </td>
+ </tr>
+ <?php endif; ?>
+ <?php endif; ?>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">&nbsp;</td>
OpenPOWER on IntegriCloud