diff options
author | Renato Botelho <garga@pfSense.org> | 2013-07-22 07:29:53 -0700 |
---|---|---|
committer | Renato Botelho <garga@pfSense.org> | 2013-07-22 07:29:53 -0700 |
commit | 174e627cadce3d317c51fd81bb2588c5d5357e18 (patch) | |
tree | 718e2b753a7956a1ff6811709f63a3c891cddc21 | |
parent | eac9f72b9d5b48542114740f59c3577bc5012945 (diff) | |
parent | 69364ab81230d1b37feb39d7f6d7ddd0aeb2169f (diff) | |
download | pfsense-174e627cadce3d317c51fd81bb2588c5d5357e18.zip pfsense-174e627cadce3d317c51fd81bb2588c5d5357e18.tar.gz |
Merge pull request #721 from phil-davis/RELENG_2_1
Validate firewall rule advanced options requirements (2.1 branch)
-rwxr-xr-x | usr/local/www/firewall_rules_edit.php | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php index a2a7e0e..ae80660 100755 --- a/usr/local/www/firewall_rules_edit.php +++ b/usr/local/www/firewall_rules_edit.php @@ -472,6 +472,51 @@ if ($_POST) { $input_errors[] = gettext("You can only select a layer7 container for Pass type rules."); } + if ($_POST['proto'] <> "tcp") { + if (!empty($_POST['max'])) + $input_errors[] = gettext("You can only specify the maximum state entries (advanced option) for TCP protocol."); + if (!empty($_POST['max-src-nodes'])) + $input_errors[] = gettext("You can only specify the maximum number of unique source hosts (advanced option) for TCP protocol."); + if (!empty($_POST['max-src-conn'])) + $input_errors[] = gettext("You can only specify the maximum number of established connections per host (advanced option) for TCP protocol."); + if (!empty($_POST['max-src-states'])) + $input_errors[] = gettext("You can only specify the maximum state entries per host (advanced option) for TCP protocol."); + if (!empty($_POST['max-src-conn-rate']) || !empty($_POST['max-src-conn-rates'])) + $input_errors[] = gettext("You can only specify the maximum new connections / per second(s) (advanced option) for TCP protocol."); + if (!empty($_POST['statetimeout'])) + $input_errors[] = gettext("You can only specify the state timeout (advanced option) for TCP protocol."); + } + + if ($_POST['type'] <> "pass") { + if (!empty($_POST['max'])) + $input_errors[] = gettext("You can only specify the maximum state entries (advanced option) for Pass type rules."); + if (!empty($_POST['max-src-nodes'])) + $input_errors[] = gettext("You can only specify the maximum number of unique source hosts (advanced option) for Pass type rules."); + if (!empty($_POST['max-src-conn'])) + $input_errors[] = gettext("You can only specify the maximum number of established connections per host (advanced option) for Pass type rules."); + if (!empty($_POST['max-src-states'])) + $input_errors[] = gettext("You can only specify the maximum state entries per host (advanced option) for Pass type rules."); + if (!empty($_POST['max-src-conn-rate']) || !empty($_POST['max-src-conn-rates'])) + $input_errors[] = gettext("You can only specify the maximum new connections / per second(s) (advanced option) for Pass type rules."); + if (!empty($_POST['statetimeout'])) + $input_errors[] = gettext("You can only specify the state timeout (advanced option) for Pass type rules."); + } + + if (($_POST['statetype'] == "none") && (empty($_POST['l7container']))) { + if (!empty($_POST['max'])) + $input_errors[] = gettext("You cannot specify the maximum state entries (advanced option) if statetype is none and no L7 container is selected."); + if (!empty($_POST['max-src-nodes'])) + $input_errors[] = gettext("You cannot specify the maximum number of unique source hosts (advanced option) if statetype is none and no L7 container is selected."); + if (!empty($_POST['max-src-conn'])) + $input_errors[] = gettext("You cannot specify the maximum number of established connections per host (advanced option) if statetype is none and no L7 container is selected."); + if (!empty($_POST['max-src-states'])) + $input_errors[] = gettext("You cannot specify the maximum state entries per host (advanced option) if statetype is none and no L7 container is selected."); + if (!empty($_POST['max-src-conn-rate']) || !empty($_POST['max-src-conn-rates'])) + $input_errors[] = gettext("You cannot specify the maximum new connections / per second(s) (advanced option) if statetype is none and no L7 container is selected."); + if (!empty($_POST['statetimeout'])) + $input_errors[] = gettext("You cannot specify the state timeout (advanced option) if statetype is none and no L7 container is selected."); + } + if (!$_POST['tcpflags_any']) { $settcpflags = array(); $outoftcpflags = array(); |