From d3ce6a8be35c1ee9a712b6e468eb1acd18695e02 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 12 Sep 2011 19:20:13 -0400 Subject: Revert "Another try at prventing panic on reconfig of ppp type wans. Ticket #1696" This reverts commit afe88d69235f84530ed6386b22cfc9c488bf94c5. --- usr/local/www/wizards/setup_wizard.xml | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/usr/local/www/wizards/setup_wizard.xml b/usr/local/www/wizards/setup_wizard.xml index 5cb794b..01d1e5c 100644 --- a/usr/local/www/wizards/setup_wizard.xml +++ b/usr/local/www/wizards/setup_wizard.xml @@ -420,18 +420,19 @@ } $type = $_POST['selectedtype']; - $wanif = ""; - if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) { - foreach ($config['ppps']['ppp'] as $pppid => $ppp) { - if ($realif == $ppp['if']) { - $ifaces = explode(",", $ppp['ports']); - $wanif = $ifaces[0]; - } - } - } - if (!empty($wanif)) { - $config['interfaces']['wan']['if'] = $wanif; - unset($config['ppps']['ppp'][$pppid]); + if (!is_array($config['ppps']['ppp'])) + $config['ppps']['ppp'] = array(); + if (count($config['ppps']['ppp'])) { + foreach ($config['ppps']['ppp'] as $pppid => $ppp) { + if ($ppp['ptpid'] == "0") { + if ((substr($config['interfaces']['wan']['if'],0,5) == "pppoe") || (substr($config['interfaces']['wan']['if'],0,4) == "pptp")) { + $oldif = explode(",", $ppp['ports']); + $config['interfaces']['wan']['if'] = $oldif[0]; + } + if ($type == "pppoe" || $type == "pptp") + unset($config['ppps']['ppp'][$pppid]); + } + } } if ($type == "pppoe" || $type == "pptp") { -- cgit v1.1