Commit 7fe0f4c1 authored by Ad Schellevis's avatar Ad Schellevis

(firewall, nat 1-to-1) fix copy feature

parent 796d3778
...@@ -53,21 +53,21 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -53,21 +53,21 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (isset($configId)) { if (isset($configId)) {
// copy settings from config // copy settings from config
foreach (array('disabled','interface','external','descr','natreflection') as $fieldname) { foreach (array('disabled','interface','external','descr','natreflection') as $fieldname) {
if (isset($a_1to1[$id][$fieldname])) { if (isset($a_1to1[$configId][$fieldname])) {
$pconfig[$fieldname] = $a_1to1[$id][$fieldname]; $pconfig[$fieldname] = $a_1to1[$configId][$fieldname];
} else { } else {
$pconfig[$fieldname] = null; $pconfig[$fieldname] = null;
} }
} }
// read settings with some kind of logic // read settings with some kind of logic
address_to_pconfig( address_to_pconfig(
$a_1to1[$id]['source'], $pconfig['src'], $a_1to1[$configId]['source'], $pconfig['src'],
$pconfig['srcmask'], $pconfig['srcnot'], $pconfig['srcmask'], $pconfig['srcnot'],
$pconfig['__unused__'],$pconfig['__unused__'] $pconfig['__unused__'],$pconfig['__unused__']
); );
address_to_pconfig( address_to_pconfig(
$a_1to1[$id]['destination'], $pconfig['dst'], $a_1to1[$configId]['destination'], $pconfig['dst'],
$pconfig['dstmask'], $pconfig['dstnot'], $pconfig['dstmask'], $pconfig['dstnot'],
$pconfig['__unused__'],$pconfig['__unused__'] $pconfig['__unused__'],$pconfig['__unused__']
); );
......
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