summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/captiveportal.inc8
-rw-r--r--etc/inc/easyrule.inc2
-rw-r--r--etc/inc/pfsense-utils.inc16
-rwxr-xr-xetc/rc.filter_synchronize4
-rwxr-xr-xusr/local/www/firewall_nat_1to1_edit.php5
-rwxr-xr-xusr/local/www/firewall_nat_edit.php5
-rwxr-xr-xusr/local/www/firewall_nat_out.php34
-rwxr-xr-xusr/local/www/firewall_nat_out_edit.php5
-rwxr-xr-xusr/local/www/firewall_rules_edit.php5
9 files changed, 49 insertions, 35 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index 5518dee..e6fa70f 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -1082,10 +1082,10 @@ function setup_dnsfilter_entries() {
$cp_filterdns_conf = "";
if (is_array($config['captiveportal']['allowedhostname'])) {
foreach ($config['captiveportal']['allowedhostname'] as $hostnameent) {
- $cp_filterdns_conf .= "ipfw {$hostnameent['hostname']} 3 '/etc/rc.captiveportal_configure'\n";
- $cp_filterdns_conf .= "ipfw {$hostnameent['hostname']} 4 '/etc/rc.captiveportal_configure'\n";
- $cp_filterdns_conf .= "ipfw {$hostnameent['hostname']} 7 '/etc/rc.captiveportal_configure'\n";
- $cp_filterdns_conf .= "ipfw {$hostnameent['hostname']} 8 '/etc/rc.captiveportal_configure'\n";
+ $cp_filterdns_conf .= "ipfw {$hostnameent['hostname']} 3\n";
+ $cp_filterdns_conf .= "ipfw {$hostnameent['hostname']} 4\n";
+ $cp_filterdns_conf .= "ipfw {$hostnameent['hostname']} 7\n";
+ $cp_filterdns_conf .= "ipfw {$hostnameent['hostname']} 8\n";
}
}
file_put_contents($cp_filterdns_filename, $cp_filterdns_conf);
diff --git a/etc/inc/easyrule.inc b/etc/inc/easyrule.inc
index c62f76b..b5b1620 100644
--- a/etc/inc/easyrule.inc
+++ b/etc/inc/easyrule.inc
@@ -46,7 +46,7 @@ function easyrule_find_rule_interface($int) {
if ($config['pptpd']['mode'] == "server")
$iflist['pptp'] = "PPTP VPN";
- if ($config['pppoe']['mode'] == "server")
+ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
$iflist['pppoe'] = "PPPoE VPN";
if ($config['l2tp']['mode'] == "server")
diff --git a/etc/inc/pfsense-utils.inc b/etc/inc/pfsense-utils.inc
index 54ca19f..adc3eda 100644
--- a/etc/inc/pfsense-utils.inc
+++ b/etc/inc/pfsense-utils.inc
@@ -1050,6 +1050,22 @@ function is_dhcp_server_enabled()
return $dhcpdenable;
}
+/* Any PPPoE servers enabled? */
+function is_pppoe_server_enabled() {
+ global $config;
+
+ $pppoeenable = false;
+
+ if (!is_array($config['pppoes']) || !is_array($config['pppoes']['pppoe']))
+ return false;
+
+ foreach ($config['pppoes']['pppoe'] as $pppoes)
+ if ($pppoes['mode'] == 'server')
+ $pppoeenable = true;
+
+ return $pppoeenable;
+}
+
function convert_seconds_to_hms($sec){
$min=$hrs=0;
if ($sec != 0){
diff --git a/etc/rc.filter_synchronize b/etc/rc.filter_synchronize
index 086a537..28b08cf 100755
--- a/etc/rc.filter_synchronize
+++ b/etc/rc.filter_synchronize
@@ -115,7 +115,7 @@ function carp_check_version($url, $password, $port = 80, $method = 'pfsense.host
$parsed_response = XML_RPC_decode($resp->value());
if(!is_array($parsed_response)) {
if (trim($parsed_response) == "Authentication failed") {
- $error = "A authentication failure occurred while trying to access {$url}:{$port} ({$method}).";
+ $error = "An authentication failure occurred while trying to access {$url}:{$port} ({$method}).";
log_error($error);
file_notice("sync_settings", $error, "Settings Sync", "");
exit;
@@ -250,7 +250,7 @@ function carp_sync_xml($url, $password, $sections, $port = 80, $method = 'pfsens
} else {
$parsed_response = XML_RPC_decode($resp->value());
if(!is_array($parsed_response) && trim($parsed_repsonse) == "Authentication failed") {
- $error = "A authentication failure occurred while trying to access {$url}:{$port} ($method).";
+ $error = "An authentication failure occurred while trying to access {$url}:{$port} ($method).";
log_error($error);
file_notice("sync_settings", $error, "Settings Sync", "");
exit;
diff --git a/usr/local/www/firewall_nat_1to1_edit.php b/usr/local/www/firewall_nat_1to1_edit.php
index b8956af..135dd99 100755
--- a/usr/local/www/firewall_nat_1to1_edit.php
+++ b/usr/local/www/firewall_nat_1to1_edit.php
@@ -284,9 +284,8 @@ function typesel_change() {
if(have_ruleint_access("pptp"))
$interfaces['pptp'] = "PPTP VPN";
- if ($config['pppoe']['mode'] == "server")
- if(have_ruleint_access("pppoe"))
- $interfaces['pppoe'] = "PPPoE VPN";
+ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
+ $interfaces['pppoe'] = "PPPoE VPN";
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable']))
diff --git a/usr/local/www/firewall_nat_edit.php b/usr/local/www/firewall_nat_edit.php
index 125a34f..b62e257 100755
--- a/usr/local/www/firewall_nat_edit.php
+++ b/usr/local/www/firewall_nat_edit.php
@@ -478,9 +478,8 @@ include("fbegin.inc"); ?>
if(have_ruleint_access("pptp"))
$interfaces['pptp'] = "PPTP VPN";
- if ($config['pppoe']['mode'] == "server")
- if(have_ruleint_access("pppoe"))
- $interfaces['pppoe'] = "PPPoE VPN";
+ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
+ $interfaces['pppoe'] = "PPPoE VPN";
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable']))
diff --git a/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php
index ae901d3..3e2c402 100755
--- a/usr/local/www/firewall_nat_out.php
+++ b/usr/local/www/firewall_nat_out.php
@@ -145,22 +145,24 @@ if (isset($_POST['save']) && $_POST['save'] == "Save") {
}
}
/* PPPoE subnet */
- if($config['pppoe']['mode'] == "server") {
- if (is_ipaddr($config['pppoe']['localip'])) {
- if($config['pppoe']['pppoe_subnet'] <> "")
- $ossubnet = $config['pppoe']['pppoe_subnet'];
- else
- $ossubnet = "32";
- $osn = gen_subnet($config['pppoe']['localip'], $ossubnet);
- $natent = array();
- $natent['source']['network'] = "{$osn}/{$ossubnet}";
- $natent['sourceport'] = "";
- $natent['descr'] = gettext("Auto created rule for PPPoE server");
- $natent['target'] = "";
- $natent['interface'] = $if2;
- $natent['destination']['any'] = true;
- $natent['natport'] = "";
- $a_out[] = $natent;
+ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe")) {
+ foreach ($config['pppoes']['pppoe'] as $pppoes) {
+ if (($pppoes['mode'] == "server") && is_ipaddr($pppoes['localip'])) {
+ if($pppoes['pppoe_subnet'] <> "")
+ $ossubnet = $pppoes['pppoe_subnet'];
+ else
+ $ossubnet = "32";
+ $osn = gen_subnet($pppoes['localip'], $ossubnet);
+ $natent = array();
+ $natent['source']['network'] = "{$osn}/{$ossubnet}";
+ $natent['sourceport'] = "";
+ $natent['descr'] = gettext("Auto created rule for PPPoE server");
+ $natent['target'] = "";
+ $natent['interface'] = $if2;
+ $natent['destination']['any'] = true;
+ $natent['natport'] = "";
+ $a_out[] = $natent;
+ }
}
}
/* L2TP subnet */
diff --git a/usr/local/www/firewall_nat_out_edit.php b/usr/local/www/firewall_nat_out_edit.php
index b730476..528af1f 100755
--- a/usr/local/www/firewall_nat_out_edit.php
+++ b/usr/local/www/firewall_nat_out_edit.php
@@ -410,9 +410,8 @@ function poolopts_change() {
if(have_ruleint_access("pptp"))
$interfaces['pptp'] = "PPTP VPN";
- if ($config['pppoe']['mode'] == "server")
- if(have_ruleint_access("pppoe"))
- $interfaces['pppoe'] = "PPPoE VPN";
+ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
+ $interfaces['pppoe'] = "PPPoE VPN";
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable']))
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php
index a6809f2..38f256e 100755
--- a/usr/local/www/firewall_rules_edit.php
+++ b/usr/local/www/firewall_rules_edit.php
@@ -690,9 +690,8 @@ include("head.inc");
if(have_ruleint_access("pptp"))
$interfaces['pptp'] = "PPTP VPN";
- if ($config['pppoe']['mode'] == "server")
- if(have_ruleint_access("pppoe"))
- $interfaces['pppoe'] = "PPPoE VPN";
+ if (is_pppoe_server_enabled() && have_ruleint_access("pppoe"))
+ $interfaces['pppoe'] = "PPPoE VPN";
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable']))
if(have_ruleint_access("enc0"))
OpenPOWER on IntegriCloud