summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-07-07 10:54:39 +0000
committerErmal Luçi <eri@pfsense.org>2009-07-07 10:55:30 +0000
commit4d828a9a8462389f1decbb4412818a486ed968f0 (patch)
treeea5ec5f3a6e8dd7e24080e09af3af8b374cc2050 /usr
parent2779830353aac351969eabd4e403c84e8c984c51 (diff)
downloadpfsense-4d828a9a8462389f1decbb4412818a486ed968f0.zip
pfsense-4d828a9a8462389f1decbb4412818a486ed968f0.tar.gz
Fix interface list usage
WARN: Please ask before introducing old code on what have changed!
Diffstat (limited to 'usr')
-rw-r--r--usr/local/www/easyrule.inc15
-rwxr-xr-xusr/local/www/firewall_rules_edit.php2
-rwxr-xr-xusr/local/www/guiconfig.inc9
-rw-r--r--usr/local/www/vpn_ipsec_phase1.php3
-rw-r--r--usr/local/www/vpn_ipsec_phase2.php3
5 files changed, 11 insertions, 21 deletions
diff --git a/usr/local/www/easyrule.inc b/usr/local/www/easyrule.inc
index 1900f24..4c7d26d 100644
--- a/usr/local/www/easyrule.inc
+++ b/usr/local/www/easyrule.inc
@@ -29,16 +29,12 @@
*/
$blockaliasname = 'EasyRuleBlockHosts';
-$specialsrcdst = explode(" ", "any wanip lanip lan pptp pppoe");
+
function easyrule_find_rule_interface($int) {
global $config;
/* Borrowed from firewall_rules.php */
- $iflist = array("lan" => "LAN", "wan" => "WAN");
-
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $iflist['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
- }
+ $iflist = get_configured_interface_with_descr(false, true);
if ($config['pptpd']['mode'] == "server")
$iflist['pptp'] = "PPTP VPN";
@@ -46,15 +42,14 @@ function easyrule_find_rule_interface($int) {
if ($config['pppoe']['mode'] == "server")
$iflist['pppoe'] = "PPPoE VPN";
+ if ($config['l2tp']['mode'] == "server")
+ $iflist['l2tp'] = "L2TP VPN";
+
/* add ipsec interfaces */
if (isset($config['ipsec']['enable']) || isset($config['ipsec']['mobileclients']['enable'])){
$iflist["enc0"] = "IPSEC";
}
- for ($i = 1; isset($config['interfaces']['opt' . $i]); $i++) {
- $iflist['opt' . $i] = $config['interfaces']['opt' . $i]['descr'];
- }
-
if (isset($iflist[$int]))
return $int;
diff --git a/usr/local/www/firewall_rules_edit.php b/usr/local/www/firewall_rules_edit.php
index aa2c146..4cd2d82 100755
--- a/usr/local/www/firewall_rules_edit.php
+++ b/usr/local/www/firewall_rules_edit.php
@@ -41,7 +41,7 @@
require("guiconfig.inc");
-$specialsrcdst = explode(" ", "any wanip lanip lan pptp pppoe");
+$specialsrcdst = explode(" ", "any pptp pppoe l2tp");
if (!is_array($config['filter']['rule'])) {
$config['filter']['rule'] = array();
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index f7de688..bec591e 100755
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -179,7 +179,7 @@ $wkports = array(
69 => "TFTP",
5900 => "VNC");
-$specialnets = array("wanip" => "WAN address", "lanip" => "LAN address", "lan" => "LAN net", "pptp" => "PPTP clients");
+$specialnets = array("wanip" => "WAN address", "lanip" => "LAN address", "lan" => "LAN net", "pptp" => "PPTP clients", "pppoe" => "PPPoE client", "l2tp" => "L2TP clients");
$spiflist = get_configured_interface_with_descr(true, true);
foreach ($spiflist as $ifgui => $ifdesc) {
@@ -587,8 +587,9 @@ function pconfig_to_address(&$adr, $padr, $pmask, $pnot=false, $pbeginport=0, $p
function is_specialnet($net) {
global $specialsrcdst;
- if(!$net)
- return false;
+
+ if(!$net)
+ return false;
if (in_array($net, $specialsrcdst) || strstr($net, "opt"))
return true;
else
@@ -1078,4 +1079,4 @@ function download_file_with_progress_bar($url_file, $destination_file, $readbody
return ($http_code == 200) ? true : $http_code;
}
-?> \ No newline at end of file
+?>
diff --git a/usr/local/www/vpn_ipsec_phase1.php b/usr/local/www/vpn_ipsec_phase1.php
index 20ddd9b..399db37 100644
--- a/usr/local/www/vpn_ipsec_phase1.php
+++ b/usr/local/www/vpn_ipsec_phase1.php
@@ -48,9 +48,6 @@ if (!is_array($config['ipsec']['phase2']))
$a_phase1 = &$config['ipsec']['phase1'];
$a_phase2 = &$config['ipsec']['phase2'];
-if($config['interfaces']['lan'])
- $specialsrcdst = explode(" ", "lan");
-
$p1index = $_GET['p1index'];
if (isset($_POST['p1index']))
$p1index = $_POST['p1index'];
diff --git a/usr/local/www/vpn_ipsec_phase2.php b/usr/local/www/vpn_ipsec_phase2.php
index d9ab1ac..bb54c59 100644
--- a/usr/local/www/vpn_ipsec_phase2.php
+++ b/usr/local/www/vpn_ipsec_phase2.php
@@ -49,9 +49,6 @@ if (!is_array($config['ipsec']['phase2']))
$a_phase2 = &$config['ipsec']['phase2'];
-if($config['interfaces']['lan'])
- $specialsrcdst = explode(" ", "lan");
-
$p2index = $_GET['p2index'];
if (isset($_POST['p2index']))
$p2index = $_POST['p2index'];
OpenPOWER on IntegriCloud