summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorgnhb <gnoahb@gmail.com>2010-05-13 01:30:22 +0700
committergnhb <gnoahb@gmail.com>2010-05-13 01:30:22 +0700
commit3f2ef8d739eba4f62f0fa31071bd587ae93f6185 (patch)
tree31832ad40253c86549dc28dddb2a7794fab44a97 /usr/local/www
parent37df6d7b15905be3dd198d9c17f19a1697beea9f (diff)
downloadpfsense-3f2ef8d739eba4f62f0fa31071bd587ae93f6185.zip
pfsense-3f2ef8d739eba4f62f0fa31071bd587ae93f6185.tar.gz
Fixing bugs and ommissions.
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/interfaces.php27
-rwxr-xr-xusr/local/www/interfaces_assign.php7
-rw-r--r--usr/local/www/interfaces_ppps_edit.php3
3 files changed, 21 insertions, 16 deletions
diff --git a/usr/local/www/interfaces.php b/usr/local/www/interfaces.php
index a24765a..ba73335 100755
--- a/usr/local/www/interfaces.php
+++ b/usr/local/www/interfaces.php
@@ -523,11 +523,11 @@ if ($_POST) {
}
}
- // Here code assumes only that strings of form "opt#" will be passed.
+ // Here the else condition code assumes only that strings of form "opt#" will be passed.
if ($if == "wan")
$if_num = "0";
else
- $if_num = substr($interface, 3);
+ $if_num = substr($if, 3);
switch($_POST['type']) {
case "static":
@@ -640,6 +640,12 @@ if ($_POST) {
if (isset($wancfg['wireless'])) {
handle_wireless_post();
}
+
+ if (isset($_POST['pppid']) && $a_ppps[$pppid])
+ $a_ppps[$pppid] = $ppp;
+ else
+ $a_ppps[] = $ppp;
+
write_config();
mark_subsystem_dirty('interfaces');
/* regenerate cron settings/crontab file */
@@ -649,10 +655,7 @@ if ($_POST) {
exit;
}
- if (isset($_POST['pppid']) && $a_ppps[$pppid])
- $a_ppps[$pppid] = $ppp;
- else
- $a_ppps[] = $ppp;
+
} // end if($_POST)
@@ -692,7 +695,7 @@ function handle_pppoe_reset() {
$item['month'] = "*";
$item['wday'] = "*";
$item['who'] = "root";
- $item['command'] = CRON_PPPOE_CMD_FILE;
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
break;
case "weekly":
$item['minute'] = "0";
@@ -701,7 +704,7 @@ function handle_pppoe_reset() {
$item['month'] = "*";
$item['wday'] = "0";
$item['who'] = "root";
- $item['command'] = CRON_PPPOE_CMD_FILE;
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
break;
case "daily":
$item['minute'] = "0";
@@ -710,7 +713,7 @@ function handle_pppoe_reset() {
$item['month'] = "*";
$item['wday'] = "*";
$item['who'] = "root";
- $item['command'] = CRON_PPPOE_CMD_FILE;
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
break;
case "hourly":
$item['minute'] = "0";
@@ -719,7 +722,7 @@ function handle_pppoe_reset() {
$item['month'] = "*";
$item['wday'] = "*";
$item['who'] = "root";
- $item['command'] = CRON_PPPOE_CMD_FILE;
+ $item['command'] = CRON_PPPOE_CMD_FILE.$_POST['ptpid'];
break;
} // end switch
} // end if
@@ -728,8 +731,8 @@ function handle_pppoe_reset() {
else
$config['cron']['item'][] = $item;
/* finally install the pppoerestart file */
- if (isset($_POST['pppoe-reset-type']) {
- setup_pppoe_reset_file($_POST['ptpid'], $if);
+ if (isset($_POST['pppoe-reset-type'])) {
+ setup_pppoe_reset_file($_POST['ptpid'], $_POST['if']);
// $wancfg['pppoe_reset'] = true;
// $wancfg['pppoe_preset'] = true;
sigkillbypid("{$g['varrun_path']}/cron.pid", "HUP");
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php
index e67b346..3074050 100755
--- a/usr/local/www/interfaces_assign.php
+++ b/usr/local/www/interfaces_assign.php
@@ -131,12 +131,13 @@ if (is_array($config['ppps']['ppp']) && count($config['ppps']['ppp'])) {
$portname = $ppp['type'].$pppid;
$portlist[$portname] = $ppp;
$portlist[$portname]['isppp'] = true;
+ $ports_base = basename($ppp['ports']);
if (isset($ppp['descr']))
- $portlist[$portname]['descr'] = strtoupper($ppp['type']). "({$ppp['ports']}) - {$ppp['descr']}";
+ $portlist[$portname]['descr'] = strtoupper($ppp['type']). "({$ports_base}) - {$ppp['descr']}";
else if (isset($ppp['username']))
- $portlist[$portname]['descr'] = strtoupper($ppp['type']). "({$ppp['ports']}) - {$ppp['username']}";
+ $portlist[$portname]['descr'] = strtoupper($ppp['type']). "({$ports_base}) - {$ppp['username']}";
else
- $portlist[$portname]['descr'] = strtoupper($ppp['type']). "({$ppp['ports']})";
+ $portlist[$portname]['descr'] = strtoupper($ppp['type']). "({$ports_base})";
}
}
diff --git a/usr/local/www/interfaces_ppps_edit.php b/usr/local/www/interfaces_ppps_edit.php
index 53d8ad4..2ff63bb 100644
--- a/usr/local/www/interfaces_ppps_edit.php
+++ b/usr/local/www/interfaces_ppps_edit.php
@@ -358,7 +358,7 @@ if ($_POST) {
}
*/
foreach($_POST['bandwidth'] as $bw){
- if(!empty($bw))
+ if(!empty($bw) && count($bw_array) < count($_POST['interfaces'])+1)
$bw_array[] = $bw;
}
if (count($bw_array)){
@@ -403,6 +403,7 @@ if ($_POST) {
$a_ppps[] = $ppp;
write_config();
+ configure_cron();
if (isset($thisif)){
interface_ppps_configure($thisif);
OpenPOWER on IntegriCloud