* Move the interface detection of which interface is configured to the top so the pppoe reset function work correctly.

* Check is the array isset before referenceing it.
This commit is contained in:
Ermal Luçi 2008-08-14 16:06:48 +00:00
parent 7a6148e4ef
commit 67473d80ef
2 changed files with 22 additions and 20 deletions

View File

@ -38,6 +38,15 @@
##|*MATCH=interfaces_wan.php*
##|-PRIV
unset($if);
if ($_GET['if'])
$if = $_GET['if'];
else if ($_POST['if'])
$if = $_POST['if'];
if (!$if)
$if = "wan";
define("CRON_MONTHLY_PATTERN", "0 0 1 * *");
define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
@ -80,15 +89,6 @@ function remove_bad_chars($string) {
require("guiconfig.inc");
unset($if);
if ($_GET['if'])
$if = $_GET['if'];
else if ($_POST['if'])
$if = $_POST['if'];
if (!$if)
$if = "wan";
if (!is_array($config['gateways']['gateway_item']))
$config['gateways']['gateway_item'] = array();
$a_gateways = &$config['gateways']['gateway_item'];
@ -363,7 +363,8 @@ n already exists.";
unset($wancfg['provider']);
unset($wancfg['ondemand']);
unset($wancfg['timeout']);
unset($wancfg['pppoe']['pppoe-reset-type']);
if ($wancfg['pppoe']['pppoe-reset-type'])
unset($wancfg['pppoe']['pppoe-reset-type']);
unset($wancfg['local']);
unset($wancfg['subnet']);
unset($wancfg['remote']);

View File

@ -38,6 +38,15 @@
##|*MATCH=interfaces_wan.php*
##|-PRIV
unset($if);
if ($_GET['if'])
$if = $_GET['if'];
else if ($_POST['if'])
$if = $_POST['if'];
if (!$if)
$if = "wan";
define("CRON_MONTHLY_PATTERN", "0 0 1 * *");
define("CRON_WEEKLY_PATTERN", "0 0 * * 0");
@ -80,15 +89,6 @@ function remove_bad_chars($string) {
require("guiconfig.inc");
unset($if);
if ($_GET['if'])
$if = $_GET['if'];
else if ($_POST['if'])
$if = $_POST['if'];
if (!$if)
$if = "wan";
if (!is_array($config['gateways']['gateway_item']))
$config['gateways']['gateway_item'] = array();
$a_gateways = &$config['gateways']['gateway_item'];
@ -363,7 +363,8 @@ n already exists.";
unset($wancfg['provider']);
unset($wancfg['ondemand']);
unset($wancfg['timeout']);
unset($wancfg['pppoe']['pppoe-reset-type']);
if ($wancfg['pppoe']['pppoe-reset-type'])
unset($wancfg['pppoe']['pppoe-reset-type']);
unset($wancfg['local']);
unset($wancfg['subnet']);
unset($wancfg['remote']);