Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
ca8bc61b
Commit
ca8bc61b
authored
Aug 27, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
whitespace firewall_nat_1to1.php
parent
ed236810
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
56 deletions
+56
-56
firewall_nat_1to1.php
src/www/firewall_nat_1to1.php
+56
-56
No files found.
src/www/firewall_nat_1to1.php
View file @
ca8bc61b
...
...
@@ -36,63 +36,63 @@ if (!isset($config['nat']['onetoone'])) {
$a_1to1
=
&
$config
[
'nat'
][
'onetoone'
];
if
(
$_SERVER
[
'REQUEST_METHOD'
]
===
'POST'
)
{
$pconfig
=
$_POST
;
if
(
isset
(
$pconfig
[
'id'
])
&&
isset
(
$a_1to1
[
$pconfig
[
'id'
]]))
{
// id found and valid
$id
=
$pconfig
[
'id'
];
}
$pconfig
=
$_POST
;
if
(
isset
(
$pconfig
[
'id'
])
&&
isset
(
$a_1to1
[
$pconfig
[
'id'
]]))
{
// id found and valid
$id
=
$pconfig
[
'id'
];
}
if
(
isset
(
$pconfig
[
'apply'
]))
{
filter_configure
();
$savemsg
=
get_std_save_message
();
clear_subsystem_dirty
(
'natconf'
);
clear_subsystem_dirty
(
'filter'
);
}
elseif
(
isset
(
$pconfig
[
'action'
])
&&
$pconfig
[
'action'
]
==
'del'
&&
isset
(
$id
))
{
// delete single entry
unset
(
$a_1to1
[
$id
]);
if
(
write_config
())
{
mark_subsystem_dirty
(
'natconf'
);
}
header
(
"Location: firewall_nat_1to1.php"
);
exit
;
}
elseif
(
isset
(
$pconfig
[
'action'
])
&&
$pconfig
[
'action'
]
==
'del_x'
&&
isset
(
$pconfig
[
'rule'
])
&&
count
(
$pconfig
[
'rule'
])
>
0
)
{
// delete selected
foreach
(
$pconfig
[
'rule'
]
as
$rulei
)
{
unset
(
$a_1to1
[
$rulei
]);
}
if
(
write_config
())
{
mark_subsystem_dirty
(
'natconf'
);
}
header
(
"Location: firewall_nat_1to1.php"
);
exit
;
}
elseif
(
isset
(
$pconfig
[
'action'
])
&&
$pconfig
[
'action'
]
==
'move'
)
{
// move selected
if
(
isset
(
$pconfig
[
'rule'
])
&&
count
(
$pconfig
[
'rule'
])
>
0
)
{
// if rule not set/found, move to end
if
(
!
isset
(
$id
))
{
$id
=
count
(
$a_1to1
);
}
$a_1to1
=
legacy_move_config_list_items
(
$a_1to1
,
$id
,
$pconfig
[
'rule'
]);
if
(
isset
(
$pconfig
[
'apply'
]))
{
filter_configure
();
$savemsg
=
get_std_save_message
();
clear_subsystem_dirty
(
'natconf'
);
clear_subsystem_dirty
(
'filter'
);
}
elseif
(
isset
(
$pconfig
[
'action'
])
&&
$pconfig
[
'action'
]
==
'del'
&&
isset
(
$id
))
{
// delete single entry
unset
(
$a_1to1
[
$id
]);
if
(
write_config
())
{
mark_subsystem_dirty
(
'natconf'
);
}
header
(
"Location: firewall_nat_1to1.php"
);
exit
;
}
elseif
(
isset
(
$pconfig
[
'action'
])
&&
$pconfig
[
'action'
]
==
'del_x'
&&
isset
(
$pconfig
[
'rule'
])
&&
count
(
$pconfig
[
'rule'
])
>
0
)
{
// delete selected
foreach
(
$pconfig
[
'rule'
]
as
$rulei
)
{
unset
(
$a_1to1
[
$rulei
]);
}
if
(
write_config
())
{
mark_subsystem_dirty
(
'natconf'
);
}
header
(
"Location: firewall_nat_1to1.php"
);
exit
;
}
elseif
(
isset
(
$pconfig
[
'action'
])
&&
$pconfig
[
'action'
]
==
'move'
)
{
// move selected
if
(
isset
(
$pconfig
[
'rule'
])
&&
count
(
$pconfig
[
'rule'
])
>
0
)
{
// if rule not set/found, move to end
if
(
!
isset
(
$id
))
{
$id
=
count
(
$a_1to1
);
}
$a_1to1
=
legacy_move_config_list_items
(
$a_1to1
,
$id
,
$pconfig
[
'rule'
]);
if
(
write_config
())
{
mark_subsystem_dirty
(
'natconf'
);
}
header
(
"Location: firewall_nat_1to1.php"
);
exit
;
}
}
elseif
(
isset
(
$pconfig
[
'action'
])
&&
$pconfig
[
'action'
]
==
'toggle'
&&
isset
(
$id
))
{
// toggle item
if
(
isset
(
$a_1to1
[
$id
][
'disabled'
]))
{
unset
(
$a_1to1
[
$id
][
'disabled'
]);
}
else
{
$a_1to1
[
$id
][
'disabled'
]
=
true
;
}
if
(
write_config
(
"Firewall: NAT: Outbound, enable/disable NAT rule"
))
{
mark_subsystem_dirty
(
'natconf'
);
}
header
(
"Location: firewall_nat_1to1.php"
);
exit
;
}
if
(
write_config
())
{
mark_subsystem_dirty
(
'natconf'
);
}
header
(
"Location: firewall_nat_1to1.php"
);
exit
;
}
}
elseif
(
isset
(
$pconfig
[
'action'
])
&&
$pconfig
[
'action'
]
==
'toggle'
&&
isset
(
$id
))
{
// toggle item
if
(
isset
(
$a_1to1
[
$id
][
'disabled'
]))
{
unset
(
$a_1to1
[
$id
][
'disabled'
]);
}
else
{
$a_1to1
[
$id
][
'disabled'
]
=
true
;
}
if
(
write_config
(
"Firewall: NAT: Outbound, enable/disable NAT rule"
))
{
mark_subsystem_dirty
(
'natconf'
);
}
header
(
"Location: firewall_nat_1to1.php"
);
exit
;
}
}
legacy_html_escape_form_data
(
$a_1to1
);
...
...
@@ -100,7 +100,7 @@ $pgtitle = array(gettext("Firewall"),gettext("NAT"),gettext("1:1"));
include
(
"head.inc"
);
$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'
),
);
?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment