summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2008-11-07 19:12:47 +0000
committerErmal Luçi <eri@pfsense.org>2008-11-07 19:12:47 +0000
commit1723f72d93c1e0d4c9a4ec9a56262e81a09d45b8 (patch)
tree12c0a58043fe143072bc6d4fac92cf3a07529dde /usr
parent4bd1d5eb3b931232f7d7723629b210694f5f5732 (diff)
downloadpfsense-1723f72d93c1e0d4c9a4ec9a56262e81a09d45b8.zip
pfsense-1723f72d93c1e0d4c9a4ec9a56262e81a09d45b8.tar.gz
Do not allow deletion of interfaces that are part of a bridge. While here fix an error on nat 1:1 rule unsetting.
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/interfaces_assign.php75
1 files changed, 39 insertions, 36 deletions
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php
index ba8fc9b..835da63 100755
--- a/usr/local/www/interfaces_assign.php
+++ b/usr/local/www/interfaces_assign.php
@@ -196,47 +196,50 @@ if ($_POST['apply']) {
if ($_GET['act'] == "del") {
$id = $_GET['id'];
- unset($config['interfaces'][$id]['enable']);
- interface_bring_down($id); /* down the interface */
+ if (link_int_to_bridge_interface($id))
+ $input_errors[] = "The interface is part of a bridge. Please remove it from the bridge to continue";
+ else {
+ unset($config['interfaces'][$id]['enable']);
+ interface_bring_down($id); /* down the interface */
- unset($config['interfaces'][$id]); /* delete the specified OPTn or LAN*/
-
- if($id == "lan") {
- unset($config['interfaces']['lan']);
- if (is_array($config['dhcpd']))
- unset($config['dhcpd']['lan']);
- unset($config['shaper']);
- unset($config['ezshaper']);
- unset($config['nat']);
- system("rm /var/dhcpd/var/db/*");
- services_dhcpd_configure();
- }
-
- if ($config['filter']['rule'] > 0)
- foreach ($config['filter']['rule'] as $x => $rule) {
- if($rule['interface'] == $id)
- unset($config['filter']['rule'][$x]);
- }
- if ($config['nat']['advancedoutbound']['rule'] > 0)
- foreach ($config['nat']['advancedoutbound']['rule'] as $id => $rule) {
- if($rule['interface'] == $x)
- unset($config['nat']['advancedoutbound']['rule'][$x]['interface']);
- }
- if (count($config['nat']['rule']) > 0)
- foreach ($config['nat']['rule'] as $x => $rule) {
- if($rule['interface'] == $id)
- unset($config['nat']['rule'][$x]['interface']);
- }
+ unset($config['interfaces'][$id]); /* delete the specified OPTn or LAN*/
+
+ if($id == "lan") {
+ unset($config['interfaces']['lan']);
+ if (is_array($config['dhcpd']))
+ unset($config['dhcpd']['lan']);
+ unset($config['shaper']);
+ unset($config['ezshaper']);
+ unset($config['nat']);
+ system("rm /var/dhcpd/var/db/*");
+ services_dhcpd_configure();
+ }
+ if ($config['filter']['rule'] > 0)
+ foreach ($config['filter']['rule'] as $x => $rule) {
+ if($rule['interface'] == $id)
+ unset($config['filter']['rule'][$x]);
+ }
+ if ($config['nat']['advancedoutbound']['rule'] > 0)
+ foreach ($config['nat']['advancedoutbound']['rule'] as $x => $rule) {
+ if($rule['interface'] == $id)
+ unset($config['nat']['advancedoutbound']['rule'][$x]['interface']);
+ }
+ if (count($config['nat']['rule']) > 0)
+ foreach ($config['nat']['rule'] as $x => $rule) {
+ if($rule['interface'] == $id)
+ unset($config['nat']['rule'][$x]['interface']);
+ }
- write_config();
+ write_config();
- /* XXX: What is this for?!?! */
- if($config['interfaces']['lan']) {
- unset($config['dhcpd']['wan']);
- }
+ /* XXX: What is this for?!?! */
+ if($config['interfaces']['lan']) {
+ unset($config['dhcpd']['wan']);
+ }
- $savemsg = "Interface has been deleted.";
+ $savemsg = "Interface has been deleted.";
+ }
}
if ($_GET['act'] == "add") {
OpenPOWER on IntegriCloud