summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Beaver <sbeaver@netgate.com>2017-02-10 11:34:07 -0500
committerSteve Beaver <sbeaver@netgate.com>2017-02-10 11:34:07 -0500
commit41063bd734a9d0a37667433f5939d6052916a3ce (patch)
treea73fc0dd34d6b9717aa78d93e3b72462559efdbf
parente1a5d73ca227609312a08ef28629ab16f4421912 (diff)
downloadpfsense-41063bd734a9d0a37667433f5939d6052916a3ce.zip
pfsense-41063bd734a9d0a37667433f5939d6052916a3ce.tar.gz
GET/POST conversion interfaces_lagg*
-rw-r--r--src/usr/local/www/interfaces_lagg.php18
-rw-r--r--src/usr/local/www/interfaces_lagg_edit.php10
2 files changed, 11 insertions, 17 deletions
diff --git a/src/usr/local/www/interfaces_lagg.php b/src/usr/local/www/interfaces_lagg.php
index 23deb7d..72f195e 100644
--- a/src/usr/local/www/interfaces_lagg.php
+++ b/src/usr/local/www/interfaces_lagg.php
@@ -54,17 +54,17 @@ function lagg_inuse($num) {
return false;
}
-if ($_GET['act'] == "del") {
- if (!isset($_GET['id'])) {
+if ($_POST['act'] == "del") {
+ if (!isset($_POST['id'])) {
$input_errors[] = gettext("Wrong parameters supplied");
- } else if (empty($a_laggs[$_GET['id']])) {
+ } else if (empty($a_laggs[$_POST['id']])) {
$input_errors[] = gettext("Wrong index supplied");
/* check if still in use */
- } else if (lagg_inuse($_GET['id'])) {
+ } else if (lagg_inuse($_POST['id'])) {
$input_errors[] = gettext("This LAGG interface cannot be deleted because it is still being used.");
} else {
- pfSense_interface_destroy($a_laggs[$_GET['id']]['laggif']);
- unset($a_laggs[$_GET['id']]);
+ pfSense_interface_destroy($a_laggs[$_POST['id']]['laggif']);
+ unset($a_laggs[$_POST['id']]);
write_config();
@@ -125,8 +125,8 @@ foreach ($a_laggs as $lagg) {
<?=htmlspecialchars($lagg['descr'])?>
</td>
<td>
- <a class="fa fa-pencil" title="<?=gettext('Edit LAGG interface')?>" href="interfaces_lagg_edit.php?id=<?=$i?>"></a>
- <a class="fa fa-trash" title="<?=gettext('Delete LAGG interface')?>" href="interfaces_lagg.php?act=del&amp;id=<?=$i?>"></a>
+ <a class="fa fa-pencil" title="<?=gettext('Edit LAGG interface')?>" href="interfaces_lagg_edit.php?id=<?=$i?>" usepost></a>
+ <a class="fa fa-trash" title="<?=gettext('Delete LAGG interface')?>" href="interfaces_lagg.php?act=del&amp;id=<?=$i?>" usepost></a>
</td>
</tr>
<?php
@@ -140,7 +140,7 @@ foreach ($a_laggs as $lagg) {
</div>
<nav class="action-buttons">
- <a href="interfaces_lagg_edit.php" class="btn btn-success btn-sm">
+ <a href="interfaces_lagg_edit.php" class="btn btn-success btn-sm" usepost>
<i class="fa fa-plus icon-embed-btn"></i>
<?=gettext("Add")?>
</a>
diff --git a/src/usr/local/www/interfaces_lagg_edit.php b/src/usr/local/www/interfaces_lagg_edit.php
index ad24d53..64ef97a 100644
--- a/src/usr/local/www/interfaces_lagg_edit.php
+++ b/src/usr/local/www/interfaces_lagg_edit.php
@@ -107,13 +107,7 @@ foreach ($checklist as $tmpif) {
$realifchecklist[get_real_interface($tmpif)] = $tmpif;
}
-if (is_numericint($_GET['id'])) {
- $id = $_GET['id'];
-}
-
-if (isset($_POST['id']) && is_numericint($_POST['id'])) {
- $id = $_POST['id'];
-}
+$id = $_POST['id'];
if (isset($id) && $a_laggs[$id]) {
$pconfig['laggif'] = $a_laggs[$id]['laggif'];
@@ -126,7 +120,7 @@ if (isset($id) && $a_laggs[$id]) {
$pconfig['descr'] = $a_laggs[$id]['descr'];
}
-if ($_POST) {
+if ($_POST['save']) {
unset($input_errors);
$pconfig = $_POST;
OpenPOWER on IntegriCloud