diff options
-rw-r--r-- | usr/local/www/wizards/setup_wizard.xml | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/usr/local/www/wizards/setup_wizard.xml b/usr/local/www/wizards/setup_wizard.xml index 01d1e5c..5cb794b 100644 --- a/usr/local/www/wizards/setup_wizard.xml +++ b/usr/local/www/wizards/setup_wizard.xml @@ -420,19 +420,18 @@ } $type = $_POST['selectedtype']; - 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]); - } - } + $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 ($type == "pppoe" || $type == "pptp") { |