Commit 71f7d3c2 authored by Franco Fichtner's avatar Franco Fichtner

firwall: output nat logging GUI part for #916

parent 2641694a
...@@ -105,7 +105,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -105,7 +105,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if (isset($configId)) { if (isset($configId)) {
// load data from config // load data from config
foreach (array('protocol','sourceport','dstport','natport','target','targetip' foreach (array('protocol','sourceport','dstport','natport','target','targetip'
,'targetip_subnet','poolopts','interface','descr','nonat' ,'targetip_subnet','poolopts','interface','descr','nonat','log'
,'disabled','staticnatport','nosync','ipprotocol') as $fieldname) { ,'disabled','staticnatport','nosync','ipprotocol') as $fieldname) {
if (isset($a_out[$configId][$fieldname])) { if (isset($a_out[$configId][$fieldname])) {
$pconfig[$fieldname] = $a_out[$configId][$fieldname]; $pconfig[$fieldname] = $a_out[$configId][$fieldname];
...@@ -211,7 +211,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -211,7 +211,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$natent['poolopts'] = $pconfig['poolopts']; $natent['poolopts'] = $pconfig['poolopts'];
$natent['ipprotocol'] = $pconfig['ipprotocol']; $natent['ipprotocol'] = $pconfig['ipprotocol'];
if ( isset($a_out[$id]['created']) && is_array($a_out[$id]['created']) ){ if (isset($a_out[$id]['created']) && is_array($a_out[$id]['created']) ){
$natent['created'] = $a_out[$id]['created']; $natent['created'] = $a_out[$id]['created'];
} }
...@@ -287,6 +287,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -287,6 +287,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
if(!empty($pconfig['nonat'])) { if(!empty($pconfig['nonat'])) {
$natent['nonat'] = true; $natent['nonat'] = true;
} }
if (!empty($pconfig['log'])) {
$natent['log'] = true;
}
if(isset($pconfig['nosync'] ) && $pconfig['nosync'] == "yes") { if(isset($pconfig['nosync'] ) && $pconfig['nosync'] == "yes") {
$natent['nosync'] = true; $natent['nosync'] = true;
...@@ -395,8 +398,8 @@ include("head.inc"); ...@@ -395,8 +398,8 @@ include("head.inc");
<td><a id="help_for_disabled" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Disabled"); ?></td> <td><a id="help_for_disabled" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Disabled"); ?></td>
<td> <td>
<input name="disabled" type="checkbox" id="disabled" value="yes" <?= !empty($pconfig['disabled']) ? "checked=\"checked\"" : ""; ?> /> <input name="disabled" type="checkbox" id="disabled" value="yes" <?= !empty($pconfig['disabled']) ? "checked=\"checked\"" : ""; ?> />
<strong><?=gettext("Disable this rule"); ?></strong>
<div class="hidden" for="help_for_disabled"> <div class="hidden" for="help_for_disabled">
<strong><?=gettext("Disable this rule"); ?></strong><br />
<?=gettext("Set this option to disable this rule without removing it from the list."); ?> <?=gettext("Set this option to disable this rule without removing it from the list."); ?>
</div> </div>
</td> </td>
...@@ -604,6 +607,16 @@ include("head.inc"); ...@@ -604,6 +607,16 @@ include("head.inc");
</div> </div>
</td> </td>
</tr> </tr>
<tr>
<td><a id="help_for_log" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Log");?></td>
<td>
<input name="log" type="checkbox" id="log" value="yes" <?= !empty($pconfig['log']) ? "checked=\"checked\"" : ""; ?> />
<strong><?=gettext("Log packets that are handled by this rule");?></strong>
<div class="hidden" for="help_for_log">
<?=sprintf(gettext("Hint: the firewall has limited local log space. Don't turn on logging for everything. If you want to do a lot of logging, consider using a %sremote syslog server%s."),'<a href="diag_logs_settings.php">','</a>') ?>
</div>
</td>
</tr>
<tr> <tr>
<td><a id="help_for_poolopts" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Pool Options:");?></td> <td><a id="help_for_poolopts" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Pool Options:");?></td>
<td> <td>
......
...@@ -650,8 +650,8 @@ include("head.inc"); ...@@ -650,8 +650,8 @@ include("head.inc");
<td><a id="help_for_disabled" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Disabled"); ?></td> <td><a id="help_for_disabled" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Disabled"); ?></td>
<td> <td>
<input name="disabled" type="checkbox" id="disabled" value="yes" <?= !empty($pconfig['disabled']) ? "checked=\"checked\"" : ""; ?> /> <input name="disabled" type="checkbox" id="disabled" value="yes" <?= !empty($pconfig['disabled']) ? "checked=\"checked\"" : ""; ?> />
<strong><?=gettext("Disable this rule"); ?></strong>
<div class="hidden" for="help_for_disabled"> <div class="hidden" for="help_for_disabled">
<strong><?=gettext("Disable this rule"); ?></strong><br />
<?=gettext("Set this option to disable this rule without removing it from the list."); ?> <?=gettext("Set this option to disable this rule without removing it from the list."); ?>
</div> </div>
</td> </td>
...@@ -663,8 +663,8 @@ include("head.inc"); ...@@ -663,8 +663,8 @@ include("head.inc");
</td> </td>
<td> <td>
<input name="quick" type="checkbox" id="quick" value="yes" <?php if ($pconfig['quick']) echo "checked=\"checked\""; ?> /> <input name="quick" type="checkbox" id="quick" value="yes" <?php if ($pconfig['quick']) echo "checked=\"checked\""; ?> />
<strong><?=gettext("Apply the action immediately on match.");?></strong>
<div class="hidden" for="help_for_quick"> <div class="hidden" for="help_for_quick">
<strong><?=gettext("Apply the action immediately on match.");?></strong><br />
<?=gettext("Set this option if you need to apply this action to traffic that matches this rule immediately.");?> <?=gettext("Set this option if you need to apply this action to traffic that matches this rule immediately.");?>
</div> </div>
</td> </td>
...@@ -1069,9 +1069,8 @@ include("head.inc"); ...@@ -1069,9 +1069,8 @@ include("head.inc");
<td><a id="help_for_log" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Log");?></td> <td><a id="help_for_log" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Log");?></td>
<td> <td>
<input name="log" type="checkbox" id="log" value="yes" <?= !empty($pconfig['log']) ? "checked=\"checked\"" : ""; ?> /> <input name="log" type="checkbox" id="log" value="yes" <?= !empty($pconfig['log']) ? "checked=\"checked\"" : ""; ?> />
<div class="hidden" for="help_for_log">
<strong><?=gettext("Log packets that are handled by this rule");?></strong> <strong><?=gettext("Log packets that are handled by this rule");?></strong>
<br /> <div class="hidden" for="help_for_log">
<?=sprintf(gettext("Hint: the firewall has limited local log space. Don't turn on logging for everything. If you want to do a lot of logging, consider using a %sremote syslog server%s."),'<a href="diag_logs_settings.php">','</a>') ?> <?=sprintf(gettext("Hint: the firewall has limited local log space. Don't turn on logging for everything. If you want to do a lot of logging, consider using a %sremote syslog server%s."),'<a href="diag_logs_settings.php">','</a>') ?>
</div> </div>
</td> </td>
......
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