summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-08-03 12:35:17 -0400
committerjim-p <jimp@pfsense.org>2011-08-03 12:38:47 -0400
commitc5ce8398292e986a1f35fca34bd85786948d9d29 (patch)
treeb91b1a6ab043bb6a3c9dbbe2b5a180d5ab0f8c53 /usr
parent27018d3cc4f12c995efadf5dc5ba90eb7c1aa641 (diff)
downloadpfsense-c5ce8398292e986a1f35fca34bd85786948d9d29.zip
pfsense-c5ce8398292e986a1f35fca34bd85786948d9d29.tar.gz
Work around the fact that get_configured_interface_list re-parses the config and kills the reference made before it, which was making it impossible to delete a pppoe instance.
Diffstat (limited to 'usr')
-rw-r--r--usr/local/www/interfaces_ppps.php25
1 files changed, 14 insertions, 11 deletions
diff --git a/usr/local/www/interfaces_ppps.php b/usr/local/www/interfaces_ppps.php
index 1e22bd0..2b5329a 100644
--- a/usr/local/www/interfaces_ppps.php
+++ b/usr/local/www/interfaces_ppps.php
@@ -43,16 +43,14 @@
require("guiconfig.inc");
require_once("functions.inc");
-if (!is_array($config['ppps']['ppp']))
- $config['ppps']['ppp'] = array();
-
-$a_ppps = &$config['ppps']['ppp'] ;
-
function ppp_inuse($num) {
- global $config, $g, $a_ppps;
+ global $config, $g;
$iflist = get_configured_interface_list(false, true);
+ if (!is_array($config['ppps']['ppp']))
+ return false;
+
foreach ($iflist as $if) {
- if ($config['interfaces'][$if]['if'] == $a_ppps[$num]['if'])
+ if ($config['interfaces'][$if]['if'] == $config['ppps']['ppp'][$num]['if'])
return true;
}
return false;
@@ -62,16 +60,21 @@ if ($_GET['act'] == "del") {
/* check if still in use */
if (ppp_inuse($_GET['id'])) {
$input_errors[] = gettext("This point-to-point link cannot be deleted because it is still being used as an interface.");
- } else {
- unset($a_ppps[$_GET['id']]['pppoe-reset-type']);
- handle_pppoe_reset($a_ppps[$_GET['id']]);
- unset($a_ppps[$_GET['id']]);
+ } elseif (is_array($config['ppps']['ppp']) && is_array($config['ppps']['ppp'][$_GET['id']])) {
+
+ unset($config['ppps']['ppp'][$_GET['id']]['pppoe-reset-type']);
+ handle_pppoe_reset($config['ppps']['ppp'][$_GET['id']]);
+ unset($config['ppps']['ppp'][$_GET['id']]);
write_config();
header("Location: interfaces_ppps.php");
exit;
}
}
+if (!is_array($config['ppps']['ppp']))
+ $config['ppps']['ppp'] = array();
+$a_ppps = $config['ppps']['ppp'];
+
$pgtitle = gettext("Interfaces: PPPs");
include("head.inc");
OpenPOWER on IntegriCloud