Commit ca8bc61b authored by Ad Schellevis's avatar Ad Schellevis

whitespace firewall_nat_1to1.php

parent ed236810
...@@ -36,63 +36,63 @@ if (!isset($config['nat']['onetoone'])) { ...@@ -36,63 +36,63 @@ if (!isset($config['nat']['onetoone'])) {
$a_1to1 = &$config['nat']['onetoone']; $a_1to1 = &$config['nat']['onetoone'];
if ($_SERVER['REQUEST_METHOD'] === 'POST') { if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$pconfig = $_POST; $pconfig = $_POST;
if (isset($pconfig['id']) && isset($a_1to1[$pconfig['id']])) { if (isset($pconfig['id']) && isset($a_1to1[$pconfig['id']])) {
// id found and valid // id found and valid
$id = $pconfig['id']; $id = $pconfig['id'];
} }
if (isset($pconfig['apply'])) { if (isset($pconfig['apply'])) {
filter_configure(); filter_configure();
$savemsg = get_std_save_message(); $savemsg = get_std_save_message();
clear_subsystem_dirty('natconf'); clear_subsystem_dirty('natconf');
clear_subsystem_dirty('filter'); clear_subsystem_dirty('filter');
} elseif (isset($pconfig['action']) && $pconfig['action'] == 'del' && isset($id)) { } elseif (isset($pconfig['action']) && $pconfig['action'] == 'del' && isset($id)) {
// delete single entry // delete single entry
unset($a_1to1[$id]); unset($a_1to1[$id]);
if (write_config()) { if (write_config()) {
mark_subsystem_dirty('natconf'); mark_subsystem_dirty('natconf');
} }
header("Location: firewall_nat_1to1.php"); header("Location: firewall_nat_1to1.php");
exit; exit;
} elseif (isset($pconfig['action']) && $pconfig['action'] == 'del_x' && isset($pconfig['rule']) && count($pconfig['rule']) > 0) { } elseif (isset($pconfig['action']) && $pconfig['action'] == 'del_x' && isset($pconfig['rule']) && count($pconfig['rule']) > 0) {
// delete selected // delete selected
foreach ($pconfig['rule'] as $rulei) { foreach ($pconfig['rule'] as $rulei) {
unset($a_1to1[$rulei]); unset($a_1to1[$rulei]);
} }
if (write_config()) { if (write_config()) {
mark_subsystem_dirty('natconf'); mark_subsystem_dirty('natconf');
} }
header("Location: firewall_nat_1to1.php"); header("Location: firewall_nat_1to1.php");
exit; exit;
} elseif (isset($pconfig['action']) && $pconfig['action'] == 'move') { } elseif (isset($pconfig['action']) && $pconfig['action'] == 'move') {
// move selected // move selected
if (isset($pconfig['rule']) && count($pconfig['rule']) > 0) { if (isset($pconfig['rule']) && count($pconfig['rule']) > 0) {
// if rule not set/found, move to end // if rule not set/found, move to end
if (!isset($id)) { if (!isset($id)) {
$id = count($a_1to1); $id = count($a_1to1);
} }
$a_1to1 = legacy_move_config_list_items($a_1to1, $id, $pconfig['rule']); $a_1to1 = legacy_move_config_list_items($a_1to1, $id, $pconfig['rule']);
if (write_config()) { if (write_config()) {
mark_subsystem_dirty('natconf'); mark_subsystem_dirty('natconf');
} }
header("Location: firewall_nat_1to1.php"); header("Location: firewall_nat_1to1.php");
exit; exit;
} }
} elseif (isset($pconfig['action']) && $pconfig['action'] == 'toggle' && isset($id)) { } elseif (isset($pconfig['action']) && $pconfig['action'] == 'toggle' && isset($id)) {
// toggle item // toggle item
if(isset($a_1to1[$id]['disabled'])) { if(isset($a_1to1[$id]['disabled'])) {
unset($a_1to1[$id]['disabled']); unset($a_1to1[$id]['disabled']);
} else { } else {
$a_1to1[$id]['disabled'] = true; $a_1to1[$id]['disabled'] = true;
} }
if (write_config("Firewall: NAT: Outbound, enable/disable NAT rule")) { if (write_config("Firewall: NAT: Outbound, enable/disable NAT rule")) {
mark_subsystem_dirty('natconf'); mark_subsystem_dirty('natconf');
} }
header("Location: firewall_nat_1to1.php"); header("Location: firewall_nat_1to1.php");
exit; exit;
} }
} }
legacy_html_escape_form_data($a_1to1); legacy_html_escape_form_data($a_1to1);
...@@ -100,7 +100,7 @@ $pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("1:1")); ...@@ -100,7 +100,7 @@ $pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("1:1"));
include("head.inc"); include("head.inc");
$main_buttons = array( $main_buttons = array(
array('label'=>gettext("add rule"), 'href'=>'firewall_nat_1to1_edit.php'), array('label'=>gettext("add rule"), 'href'=>'firewall_nat_1to1_edit.php'),
); );
?> ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment