diff options
author | Luiz Otavio O Souza <luiz@netgate.com> | 2015-11-10 10:18:21 -0600 |
---|---|---|
committer | Luiz Otavio O Souza <luiz@netgate.com> | 2015-11-10 10:20:07 -0600 |
commit | 179ab6b36448e8bb06a639c303512905c93eb7e5 (patch) | |
tree | 5572c519232cdabe6be012904a655c3cad46b269 | |
parent | 94d494fbc0da7d85b0ef8f04dcd2bd4ab0e0a7c7 (diff) | |
download | pfsense-179ab6b36448e8bb06a639c303512905c93eb7e5.zip pfsense-179ab6b36448e8bb06a639c303512905c93eb7e5.tar.gz |
Eliminate a few more cases of $config['ipsec']['enable'].
Mostly when dealing with enc0 interface.
-rw-r--r-- | src/etc/inc/easyrule.inc | 3 | ||||
-rw-r--r-- | src/etc/inc/filter.inc | 2 | ||||
-rw-r--r-- | src/usr/local/www/diag_logs_filter.php | 2 | ||||
-rw-r--r-- | src/usr/local/www/diag_packet_capture.php | 6 | ||||
-rw-r--r-- | src/usr/local/www/firewall_nat_1to1_edit.php | 5 | ||||
-rw-r--r-- | src/usr/local/www/firewall_nat_edit.php | 5 | ||||
-rw-r--r-- | src/usr/local/www/firewall_nat_npt_edit.php | 6 | ||||
-rw-r--r-- | src/usr/local/www/firewall_nat_out_edit.php | 5 | ||||
-rw-r--r-- | src/usr/local/www/firewall_rules.php | 8 | ||||
-rw-r--r-- | src/usr/local/www/firewall_rules_edit.php | 2 | ||||
-rw-r--r-- | src/usr/local/www/status_graph.php | 7 | ||||
-rw-r--r-- | src/usr/local/www/widgets/widgets/traffic_graphs.widget.php | 3 |
12 files changed, 22 insertions, 32 deletions
diff --git a/src/etc/inc/easyrule.inc b/src/etc/inc/easyrule.inc index dbb8cfc..3c53e92 100644 --- a/src/etc/inc/easyrule.inc +++ b/src/etc/inc/easyrule.inc @@ -52,9 +52,8 @@ function easyrule_find_rule_interface($int) { } /* add ipsec interfaces */ - if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) { + if (ipsec_enabled()) $iflist["enc0"] = "IPSEC"; - } if (isset($iflist[$int])) { return $int; diff --git a/src/etc/inc/filter.inc b/src/etc/inc/filter.inc index d1ce9b5..36ab337 100644 --- a/src/etc/inc/filter.inc +++ b/src/etc/inc/filter.inc @@ -1171,7 +1171,7 @@ function filter_generate_optcfg_array() { } } /* add ipsec interfaces */ - if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) { + if (ipsec_enabled()) { $oic = array(); $oic['if'] = 'enc0'; $oic['descr'] = 'IPsec'; diff --git a/src/usr/local/www/diag_logs_filter.php b/src/usr/local/www/diag_logs_filter.php index ee0ad63..bd8d876 100644 --- a/src/usr/local/www/diag_logs_filter.php +++ b/src/usr/local/www/diag_logs_filter.php @@ -169,7 +169,7 @@ function build_if_list() { $interfaces['pppoe'] = "PPPoE Server"; /* add ipsec interfaces */ - if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) + if (ipsec_enabled()) $interfaces["enc0"] = "IPsec"; /* add openvpn/tun interfaces */ diff --git a/src/usr/local/www/diag_packet_capture.php b/src/usr/local/www/diag_packet_capture.php index 5a6385d..5918754 100644 --- a/src/usr/local/www/diag_packet_capture.php +++ b/src/usr/local/www/diag_packet_capture.php @@ -123,6 +123,7 @@ if ($_POST['downloadbtn'] == gettext("Download Capture")) { $pgtitle = array(gettext("Diagnostics"), gettext("Packet Capture")); require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); +require_once("ipsec.inc"); $fp = "/root/"; $fn = "packetcapture.cap"; @@ -136,9 +137,8 @@ $protos = array('icmp', 'icmp6', 'tcp', 'udp', 'arp', 'carp', 'esp', $input_errors = array(); $interfaces = get_configured_interface_with_descr(); -if (isset($config['ipsec']['enable'])) { - $interfaces['ipsec'] = "IPsec"; -} +if (ipsec_enabled()) + $interfaces['enc0'] = "IPsec"; foreach (array('server', 'client') as $mode) { if (is_array($config['openvpn']["openvpn-{$mode}"])) { foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $setting) { diff --git a/src/usr/local/www/firewall_nat_1to1_edit.php b/src/usr/local/www/firewall_nat_1to1_edit.php index 1f75a65..d1e2cb3 100644 --- a/src/usr/local/www/firewall_nat_1to1_edit.php +++ b/src/usr/local/www/firewall_nat_1to1_edit.php @@ -407,9 +407,8 @@ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) $interfaces['pppoe'] = "PPPoE Server"; /* add ipsec interfaces */ -if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) - if (have_ruleint_access("enc0")) - $interfaces["enc0"] = "IPsec"; +if (ipsec_enabled() && have_ruleint_access("enc0")) + $interfaces["enc0"] = "IPsec"; /* add openvpn/tun interfaces */ if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) diff --git a/src/usr/local/www/firewall_nat_edit.php b/src/usr/local/www/firewall_nat_edit.php index ca23d26..bda89d6 100644 --- a/src/usr/local/www/firewall_nat_edit.php +++ b/src/usr/local/www/firewall_nat_edit.php @@ -669,9 +669,8 @@ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) $interfaces['pppoe'] = "PPPoE Server"; /* add ipsec interfaces */ -if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) - if (have_ruleint_access("enc0")) - $interfaces["enc0"] = "IPsec"; +if (ipsec_enabled() && have_ruleint_access("enc0")) + $interfaces["enc0"] = "IPsec"; /* add openvpn/tun interfaces */ if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) diff --git a/src/usr/local/www/firewall_nat_npt_edit.php b/src/usr/local/www/firewall_nat_npt_edit.php index f4ef6fd..f29806d 100644 --- a/src/usr/local/www/firewall_nat_npt_edit.php +++ b/src/usr/local/www/firewall_nat_npt_edit.php @@ -191,10 +191,8 @@ function build_if_list() { $interfaces['pppoe'] = "PPPoE Server"; /* add ipsec interfaces */ - if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable'])) { - if (have_ruleint_access("enc0")) - $interfaces["enc0"] = "IPsec"; - } + if (ipsec_enabled() && have_ruleint_access("enc0")) + $interfaces["enc0"] = "IPsec"; /* add openvpn/tun interfaces */ if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) diff --git a/src/usr/local/www/firewall_nat_out_edit.php b/src/usr/local/www/firewall_nat_out_edit.php index 9ad6eb1..7f3ee12 100644 --- a/src/usr/local/www/firewall_nat_out_edit.php +++ b/src/usr/local/www/firewall_nat_out_edit.php @@ -475,9 +475,8 @@ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) $interfaces['pppoe'] = "PPPoE Server"; /* add ipsec interfaces */ -if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) - if (have_ruleint_access("enc0")) - $interfaces["enc0"] = "IPsec"; +if (ipsec_enabled() && have_ruleint_access("enc0")) + $interfaces["enc0"] = "IPsec"; /* add openvpn/tun interfaces */ if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) diff --git a/src/usr/local/www/firewall_rules.php b/src/usr/local/www/firewall_rules.php index d2e2cd9..a1398f0 100644 --- a/src/usr/local/www/firewall_rules.php +++ b/src/usr/local/www/firewall_rules.php @@ -69,6 +69,7 @@ require("guiconfig.inc"); require_once("functions.inc"); require_once("filter.inc"); +require_once("ipsec.inc"); require_once("shaper.inc"); $pgtitle = array(gettext("Firewall"), gettext("Rules")); @@ -134,11 +135,8 @@ if (is_array($config['pppoes']['pppoe'])) { } /* add ipsec interfaces */ -if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) { - if (have_ruleint_access("enc0")) { - $iflist["enc0"] = "IPsec"; - } -} +if (ipsec_enabled() && have_ruleint_access("enc0")) + $iflist["enc0"] = "IPsec"; /* add openvpn/tun interfaces */ if ($config['openvpn']["openvpn-server"] || $config['openvpn']["openvpn-client"]) { diff --git a/src/usr/local/www/firewall_rules_edit.php b/src/usr/local/www/firewall_rules_edit.php index 7d93cf7..2cb3271 100644 --- a/src/usr/local/www/firewall_rules_edit.php +++ b/src/usr/local/www/firewall_rules_edit.php @@ -1139,7 +1139,7 @@ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) $interfaces['pppoe'] = "PPPoE Server"; // add ipsec interfaces -if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable']) && have_ruleint_access("enc0")) +if (ipsec_enabled() && have_ruleint_access("enc0")) $interfaces["enc0"] = "IPsec"; // add openvpn/tun interfaces diff --git a/src/usr/local/www/status_graph.php b/src/usr/local/www/status_graph.php index e663780..404158a 100644 --- a/src/usr/local/www/status_graph.php +++ b/src/usr/local/www/status_graph.php @@ -70,6 +70,7 @@ ##|-PRIV require("guiconfig.inc"); +require_once("ipsec.inc"); if ($_POST['width']) { $width = $_POST['width']; @@ -85,9 +86,8 @@ if ($_POST['height']) { // Get configured interface list $ifdescrs = get_configured_interface_with_descr(); -if (isset($config['ipsec']['enable'])) { +if (ipsec_enabled()) $ifdescrs['enc0'] = "IPsec"; -} foreach (array('server', 'client') as $mode) { if (is_array($config['openvpn']["openvpn-{$mode}"])) { foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $setting) { @@ -248,9 +248,8 @@ events.push(function(){ <?php /* link the ipsec interface magically */ -if (isset($config['ipsec']['enable']) || isset($config['ipsec']['client']['enable'])) { +if (ipsec_enabled()) $ifdescrs['enc0'] = "IPsec"; -} ?> <div class="panel panel-default"> diff --git a/src/usr/local/www/widgets/widgets/traffic_graphs.widget.php b/src/usr/local/www/widgets/widgets/traffic_graphs.widget.php index e035e5f..d9997be 100644 --- a/src/usr/local/www/widgets/widgets/traffic_graphs.widget.php +++ b/src/usr/local/www/widgets/widgets/traffic_graphs.widget.php @@ -80,9 +80,8 @@ if (!is_array($a_config["shown"]["item"])) { } $ifdescrs = get_configured_interface_with_descr(); -if (isset($config['ipsec']['enable'])) { +if (ipsec_enabled()) $ifdescrs['enc0'] = "IPsec"; -} if ($_POST) { if (isset($_POST["refreshinterval"])) { |