From 75bb4bc3849cda6af49ee51cc495353dcb5ad489 Mon Sep 17 00:00:00 2001 From: jim-p Date: Mon, 12 Sep 2011 17:06:51 -0400 Subject: If we are coming from a PPPoE/PPTP WAN type, grab the old physical interface first to avoid assigning a ppp interface to itself. Fixes pppoe->pppoe wizard run as well as changing pppoe->dhcp. Fixes #1696 --- usr/local/www/wizards/setup_wizard.xml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/usr/local/www/wizards/setup_wizard.xml b/usr/local/www/wizards/setup_wizard.xml index a3607e6..01d1e5c 100644 --- a/usr/local/www/wizards/setup_wizard.xml +++ b/usr/local/www/wizards/setup_wizard.xml @@ -419,17 +419,23 @@ die; } $type = $_POST['selectedtype']; - if ($type == "pppoe" || $type == "pptp") { - 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") { - unset($config['ppps']['ppp'][$pppid]); - // break; + + 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") { if ($type == "pptp") { $config['wizardtemp']['wan']['username'] = $config['wizardtemp']['wan']['pptpusername']; $config['wizardtemp']['wan']['password'] = $config['wizardtemp']['wan']['pptppassword']; -- cgit v1.1