Added auto route disable

This commit is contained in:
Namezero 2018-02-23 20:41:21 +01:00 committed by GitHub
parent 31282787df
commit 050fecd0e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -40,6 +40,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
$pconfig = array();
$pconfig['disablevpnrules'] = isset($config['system']['disablevpnrules']);
$pconfig['preferoldsa_enable'] = isset($config['ipsec']['preferoldsa']);
$pconfig['auto_routes_disable'] = isset($config['ipsec']['auto_routes_disable']);
if (!empty($config['ipsec']['passthrough_networks'])) {
$pconfig['passthrough_networks'] = explode(',', $config['ipsec']['passthrough_networks']);
} else {
@ -95,6 +96,11 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} elseif (isset($config['ipsec']['passthrough_networks'])) {
unset($config['ipsec']['passthrough_networks']);
}
if (isset($pconfig['auto_routes_disable']) && $pconfig['auto_routes_disable'] == "yes") {
$config['ipsec']['auto_routes_disable'] = true;
} elseif (isset($config['ipsec']['auto_routes_disable'])) {
unset($config['ipsec']['auto_routes_disable']);
}
write_config();
$savemsg = get_std_save_message();
@ -181,6 +187,18 @@ if (isset($input_errors) && count($input_errors) > 0) {
</output>
</td>
</tr>
<tr>
<td><a id="help_for_auto_routes_disable" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("Do not install routes"); ?></td>
<td style="width:78%" class="vtable">
<input name="auto_routes_disable" type="checkbox" id="auto_routes_disable" value="yes" <?= !empty($pconfig['auto_routes_disable']) ? "checked=\"checked\" : """;?> />
<strong><?=gettext("Do not automatically install routes"); ?></strong>
<output class="hidden" for="help_for_auto_routes_disable">
<?=gettext("By default, IPsec installs routes when a tunnel becomes active. " .
"Select this option to prevent automatically adding routes" .
" to the system routing table. See charon.install_routes"); ?>
</output>
</td>
</tr>
<tr>
<td><a id="help_for_ipsec_debug" href="#" class="showhelp"><i class="fa fa-info-circle"></i></a> <?=gettext("IPsec Debug"); ?></td>
<td>