diff options
author | Luiz Otavio O Souza <luiz@netgate.com> | 2015-11-22 09:27:55 -0600 |
---|---|---|
committer | Luiz Otavio O Souza <luiz@netgate.com> | 2015-11-22 09:27:55 -0600 |
commit | 1a2de6d640e720773e5701d53e25ed5bd728da65 (patch) | |
tree | 4db880b995d94871778da5cb2ca913b1fe28c145 /src | |
parent | aa4c2db3d985dc632e08953cf82df9a81f024f29 (diff) | |
download | pfsense-1a2de6d640e720773e5701d53e25ed5bd728da65.zip pfsense-1a2de6d640e720773e5701d53e25ed5bd728da65.tar.gz |
Remove the last usage cases of $config['ipsec']['enable'].
IPSEC is always on in 2.3, where necessary (IPSEC rules, IPSEC daemon), we check the existence of phase 1 entries.
Diffstat (limited to 'src')
-rw-r--r-- | src/etc/inc/vpn.inc | 2 | ||||
-rw-r--r-- | src/usr/local/www/vpn_ipsec.php | 16 | ||||
-rw-r--r-- | src/usr/local/www/vpn_ipsec_mobile.php | 2 | ||||
-rwxr-xr-x | src/usr/local/www/xmlrpc.php | 3 |
4 files changed, 5 insertions, 18 deletions
diff --git a/src/etc/inc/vpn.inc b/src/etc/inc/vpn.inc index 0f9689f..c1b67c2 100644 --- a/src/etc/inc/vpn.inc +++ b/src/etc/inc/vpn.inc @@ -144,7 +144,7 @@ function vpn_ipsec_configure($restart = false) { $syscfg = $config['system']; $ipseccfg = $config['ipsec']; - if (!isset($ipseccfg['enable'])) { + if (!ipsec_enabled()) { /* try to stop charon */ mwexec("/usr/local/sbin/ipsec stop"); /* Stop dynamic monitoring */ diff --git a/src/usr/local/www/vpn_ipsec.php b/src/usr/local/www/vpn_ipsec.php index e243859..3062ffa 100644 --- a/src/usr/local/www/vpn_ipsec.php +++ b/src/usr/local/www/vpn_ipsec.php @@ -81,12 +81,9 @@ if (!is_array($config['ipsec']['phase2'])) { $a_phase1 = &$config['ipsec']['phase1']; $a_phase2 = &$config['ipsec']['phase2']; -$pconfig['enable'] = isset($config['ipsec']['enable']); - if ($_POST) { if ($_POST['apply']) { - $retval = 0; $retval = vpn_ipsec_configure(); /* reload the filter in the background */ filter_configure(); @@ -96,14 +93,6 @@ if ($_POST) { clear_subsystem_dirty('ipsec'); } } - } else if ($_POST['submit'] == 'Save') { - $pconfig = $_POST; - - $config['ipsec']['enable'] = $_POST['enable'] ? true : false; - - write_config(); - - $retval = vpn_ipsec_configure(); } else if (isset($_POST['del'])) { /* delete selected p1 entries */ if (is_array($_POST['p1entry']) && count($_POST['p1entry'])) { @@ -281,15 +270,12 @@ display_top_tabs($tab_array); print_info_box($savemsg, 'success'); } - if ($pconfig['enable'] && is_subsystem_dirty('ipsec')) { + if (is_subsystem_dirty('ipsec')) { print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect.")); } ?> <form name="mainform" method="post"> - <input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\"";?> /> <?=gettext("Enable IPsec")?><br /><br /> - <input name="submit" type="submit" class="btn btn-sm btn-primary" value="<?=gettext("Save"); ?>" /><br /><br /> - <div class="panel panel-default"> <div class="panel-heading"><h2 class="panel-title"><?=gettext('IPSec tunnels')?></h2></div> <div class="panel-body table-responsive"> diff --git a/src/usr/local/www/vpn_ipsec_mobile.php b/src/usr/local/www/vpn_ipsec_mobile.php index a806573..9905c88 100644 --- a/src/usr/local/www/vpn_ipsec_mobile.php +++ b/src/usr/local/www/vpn_ipsec_mobile.php @@ -431,7 +431,7 @@ include("head.inc"); <?php if ($savemsg) print_info_box($savemsg); -if (isset($config['ipsec']['enable']) && is_subsystem_dirty('ipsec')) +if (is_subsystem_dirty('ipsec')) print_info_box_np(gettext("The IPsec tunnel configuration has been changed") . ".<br />" . gettext("You must apply the changes in order for them to take effect.")); foreach ($a_phase1 as $ph1ent) if (isset($ph1ent['mobile'])) diff --git a/src/usr/local/www/xmlrpc.php b/src/usr/local/www/xmlrpc.php index 82f67f9..ac0ea82 100755 --- a/src/usr/local/www/xmlrpc.php +++ b/src/usr/local/www/xmlrpc.php @@ -198,6 +198,7 @@ function restore_config_section_xmlrpc($raw_params) { global $config, $xmlrpc_g; $old_config = $config; + $old_ipsec_enabled = ipsec_enabled(); if (xmlrpc_loop_detect()) { log_error("Disallowing CARP sync loop"); @@ -333,7 +334,7 @@ function restore_config_section_xmlrpc($raw_params) { } } - if (isset($old_config['ipsec']['enable']) !== isset($config['ipsec']['enable'])) { + if ($old_ipsec_enabled !== ipsec_enabled()) { vpn_ipsec_configure(); } |