summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/pfsense-utils.inc13
-rwxr-xr-xusr/local/www/firewall_nat_edit.php15
-rwxr-xr-xusr/local/www/firewall_rules_edit.php15
3 files changed, 43 insertions, 0 deletions
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index a673685..6241a1e 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -2224,4 +2224,17 @@ function is_ipaddr_configured($ipaddr) {
}
}
+function pfSense_handle_custom_code($src_dir) {
+ // Allow extending of the nat edit page and include custom input validation
+ if(is_dir("$src_dir")) {
+ $cf = glob($src_dir);
+ foreach($cf as $nf) {
+ if($nf == "." || $nf == "..")
+ continue;
+ // Include the extra handler
+ include("$src_dir/$nf");
+ }
+ }
+}
+
?> \ No newline at end of file
diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php
index 3dc1d83..9895312 100755
--- a/usr/local/www/firewall_nat_edit.php
+++ b/usr/local/www/firewall_nat_edit.php
@@ -290,6 +290,9 @@ if ($_POST) {
}
}
+ // Allow extending of the nat edit page and include custom input validation
+ pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/input_validation");
+
if (!$input_errors) {
$natent = array();
@@ -422,6 +425,9 @@ if ($_POST) {
mark_subsystem_dirty('natconf');
+ // Allow extending of the nat edit page and include custom input validation
+ pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/pre_write_config");
+
write_config();
header("Location: firewall_nat.php");
@@ -440,6 +446,11 @@ include("fbegin.inc"); ?>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<form action="firewall_nat_edit.php" method="post" name="iform" id="iform">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
+<?php
+ // Allow extending of the nat edit page and include custom input validation
+ pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/htmlphpearly");
+?>
+
<tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Redirect entry"); ?></td>
</tr>
@@ -817,6 +828,10 @@ include("fbegin.inc"); ?>
</select>
</td>
</tr><?php endif; ?>
+<?php
+ // Allow extending of the nat edit page and include custom input validation
+ pfSense_handle_custom_code("/usr/local/pkg/firewall_nat/htmlphplate");
+?>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">&nbsp;</td>
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php
index c051518..d673df8 100755
--- a/usr/local/www/firewall_rules_edit.php
+++ b/usr/local/www/firewall_rules_edit.php
@@ -401,6 +401,9 @@ if ($_POST) {
$input_errors[] = gettext("If you specify TCP flags that should be set you should specify out of which flags as well.");
}
+ // Allow extending of the firewall edit page and include custom input validation
+ pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/input_validation");
+
if (!$input_errors) {
$filterent = array();
$filterent['id'] = $_POST['ruleid']>0?$_POST['ruleid']:'';
@@ -554,6 +557,10 @@ if ($_POST) {
}
filter_rules_sort();
+
+ // Allow extending of the firewall edit page and include custom input validation
+ pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/pre_write_config");
+
write_config();
mark_subsystem_dirty('filter');
@@ -596,6 +603,10 @@ include("head.inc");
<tr>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Edit Firewall rule");?></td>
</tr>
+<?php
+ // Allow extending of the firewall edit page and include custom input validation
+ pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/htmlphpearly");
+?>
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Action");?></td>
<td width="78%" class="vtable">
@@ -1381,6 +1392,10 @@ include("head.inc");
</div>
</td>
</tr>
+<?php
+ // Allow extending of the firewall edit page and include custom input validation
+ pfSense_handle_custom_code("/usr/local/pkg/firewall_rules/htmlphplate");
+?>
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
OpenPOWER on IntegriCloud