diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2016-08-22 11:24:08 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-08-22 11:24:45 -0400 |
commit | 9db8959dd3a4e4c944b396ad5b8cbd2fce82d954 (patch) | |
tree | f5ff9a9fb517f52f29ccd4d60aa62c1f1c3da321 | |
parent | a28e9c319e741158521a58b1286fc601e80ef389 (diff) | |
download | pfsense-9db8959dd3a4e4c944b396ad5b8cbd2fce82d954.zip pfsense-9db8959dd3a4e4c944b396ad5b8cbd2fce82d954.tar.gz |
Fixed #6732
(cherry picked from commit e73770057872aa1f78dfff885f89916e446e2e4c)
-rw-r--r-- | src/usr/local/www/interfaces_ppps_edit.php | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/usr/local/www/interfaces_ppps_edit.php b/src/usr/local/www/interfaces_ppps_edit.php index 9920d51..9349c19 100644 --- a/src/usr/local/www/interfaces_ppps_edit.php +++ b/src/usr/local/www/interfaces_ppps_edit.php @@ -212,6 +212,7 @@ if (isset($id) && $a_ppps[$id]) { } if (isset($_POST) && is_array($_POST) && count($_POST) > 0) { + unset($input_errors); $pconfig = $_POST; @@ -344,6 +345,7 @@ if (isset($_POST) && is_array($_POST) && count($_POST) > 0) { } } } + } if (!$input_errors) { @@ -376,6 +378,16 @@ if (isset($_POST) && is_array($_POST) && count($_POST) > 0) { unset($ppp['descr']); } + // Loop through fields associated with an individual link/port and make an array of the data + $port_fields = array("localip", "gateway", "subnet", "bandwidth", "mtu", "mru", "mrru"); + foreach ($_POST['interfaces'] as $iface) { + foreach ($port_fields as $field_label) { + if (isset($_POST[$field_label][$iface])) { + $port_data[$field_label][] = $_POST[$field_label][$iface]; + } + } + } + switch ($_POST['type']) { case "ppp": $ppp['country'] = $_POST['country']; @@ -658,17 +670,17 @@ if ($pconfig['type'] == 'pptp' || $pconfig['type'] == 'l2tp') { $group = new Form_Group('IP/Gateway (' . $ifnm . ')'); $group->add(new Form_IpAddress( - 'localiplabel' . $j, + 'localip[' . $ifnm . ']', null, $pconfig['localip'][$j] - ))->addMask('subnet' . $j, $pconfig['subnet'][$j], 31)->setHelp('IP Address'); + ))->addMask('subnet[' . $ifnm . ']', $pconfig['subnet'][$j], 31)->setHelp('Local IP Address'); $group->add(new Form_Input( - 'gateway' . $j, + 'gateway[' . $ifnm . ']', null, 'text', $pconfig['gateway'][$j] - ))->setHelp('IP or Hostname'); + ))->setHelp('Gateway IP or Hostname'); $j++; @@ -923,28 +935,28 @@ foreach ($linklist['list'] as $ifnm => $nm) { $group = new Form_Group('Link Parameters (' . $ifnm . ')'); $group->add(new Form_Input( - 'bandwidth' . $ifnm, + 'bandwidth[' . $ifnm . ']', null, 'text', $pconfig['bandwidth'][$ifnm] ))->setHelp('Bandwidth'); $group->add(new Form_Input( - 'mtu' . $ifnm, + 'mtu[' . $ifnm . ']', null, 'text', $pconfig['mtu'][$ifnm] ))->setHelp('MTU'); $group->add(new Form_Input( - 'mru' . $ifnm, + 'mru[' . $ifnm . ']', null, 'text', $pconfig['mru'][$ifnm] ))->setHelp('MRU'); $group->add(new Form_Input( - 'mrru' . $ifnm, + 'mrru[' . $ifnm . ']', null, 'text', $pconfig['mrru'][$ifnm] |