From e3947e772a9caa00403001ddeda9270d1f821547 Mon Sep 17 00:00:00 2001 From: Steve Beaver Date: Fri, 10 Feb 2017 15:34:58 -0500 Subject: GET/POST conversion firewall_rules guiconfig.php display_top_tabs supports "usepost" as an optional 4th argument --- src/usr/local/www/firewall_rules_edit.php | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'src/usr/local/www/firewall_rules_edit.php') diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index dd87533..d4d6e29 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -139,23 +139,17 @@ if (!is_array($config['filter']['rule'])) { filter_rules_sort(); $a_filter = &$config['filter']['rule']; -if (is_numericint($_GET['id'])) { - $id = $_GET['id']; -} if (isset($_POST['id']) && is_numericint($_POST['id'])) { $id = $_POST['id']; } -if (is_numericint($_GET['after']) || $_GET['after'] == "-1") { - $after = $_GET['after']; -} if (isset($_POST['after']) && (is_numericint($_POST['after']) || $_POST['after'] == "-1")) { $after = $_POST['after']; } -if (isset($_GET['dup']) && is_numericint($_GET['dup'])) { - $id = $_GET['dup']; - $after = $_GET['dup']; +if (isset($_POST['dup']) && is_numericint($_POST['dup'])) { + $id = $_POST['dup']; + $after = $_POST['dup']; } if (isset($id) && $a_filter[$id]) { @@ -284,7 +278,7 @@ if (isset($id) && $a_filter[$id]) { $pconfig['sched'] = (($a_filter[$id]['sched'] == "none") ? '' : $a_filter[$id]['sched']); $pconfig['vlanprio'] = (($a_filter[$id]['vlanprio'] == "none") ? '' : $a_filter[$id]['vlanprio']); $pconfig['vlanprioset'] = (($a_filter[$id]['vlanprioset'] == "none") ? '' : $a_filter[$id]['vlanprioset']); - if (!isset($_GET['dup']) || !is_numericint($_GET['dup'])) { + if (!isset($_POST['dup']) || !is_numericint($_POST['dup'])) { $pconfig['associated-rule-id'] = $a_filter[$id]['associated-rule-id']; } @@ -292,8 +286,8 @@ if (isset($id) && $a_filter[$id]) { } else { /* defaults */ - if ($_GET['if']) { - $pconfig['interface'] = $_GET['if']; + if ($_POST['if']) { + $pconfig['interface'] = $_POST['if']; } $pconfig['type'] = "pass"; $pconfig['proto'] = "tcp"; // for new blank rules, default=tcp, also ensures ports fields are visible @@ -303,7 +297,7 @@ if (isset($id) && $a_filter[$id]) { /* Allow the FloatingRules to work */ $if = $pconfig['interface']; -if (isset($_GET['dup']) && is_numericint($_GET['dup'])) { +if (isset($_POST['dup']) && is_numericint($_POST['dup'])) { unset($id); } @@ -313,7 +307,7 @@ read_dummynet_config(); /* XXX: */ $dnqlist =& get_unique_dnqueue_list(); $a_gatewaygroups = return_gateway_groups_array(); -if ($_POST) { +if ($_POST['save']) { unset($input_errors); @@ -1195,7 +1189,7 @@ if ($edit_disabled) { $extra = ''; foreach ($config['nat']['rule'] as $index => $nat_rule) { if ($nat_rule['associated-rule-id'] === $pconfig['associated-rule-id']) { - $extra = '
'. gettext('View the NAT rule') .''; + $extra = '
'. gettext('View the NAT rule') .''; } } -- cgit v1.1