diff options
author | jim-p <jimp@pfsense.org> | 2011-02-10 11:16:13 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-02-10 11:16:13 -0500 |
commit | 8c5df70558fa0b21bacd543c0e33275da5a9b908 (patch) | |
tree | 3fa4d988e4b80eaeb1303acd146675adfb29ba90 | |
parent | 93c2c1e620aa71b9ffd29deb0aeeda3028bb413a (diff) | |
download | pfsense-8c5df70558fa0b21bacd543c0e33275da5a9b908.zip pfsense-8c5df70558fa0b21bacd543c0e33275da5a9b908.tar.gz |
Also fix easyrule and auto->manual nat switch code. Ticket #1243
-rw-r--r-- | etc/inc/easyrule.inc | 2 | ||||
-rwxr-xr-x | usr/local/www/firewall_nat_out.php | 34 |
2 files changed, 19 insertions, 17 deletions
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/usr/local/www/firewall_nat_out.php b/usr/local/www/firewall_nat_out.php index 85c4550..0a8af47 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 */ |