diff options
Diffstat (limited to 'src/usr')
-rw-r--r-- | src/usr/local/www/interfaces_gre.php | 18 | ||||
-rw-r--r-- | src/usr/local/www/interfaces_gre_edit.php | 10 |
2 files changed, 11 insertions, 17 deletions
diff --git a/src/usr/local/www/interfaces_gre.php b/src/usr/local/www/interfaces_gre.php index 9f2d8c0..388e75d 100644 --- a/src/usr/local/www/interfaces_gre.php +++ b/src/usr/local/www/interfaces_gre.php @@ -48,17 +48,17 @@ function gre_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_gres[$_GET['id']])) { + } else if (empty($a_gres[$_POST['id']])) { $input_errors[] = gettext("Wrong index supplied"); /* check if still in use */ - } else if (gre_inuse($_GET['id'])) { + } else if (gre_inuse($_POST['id'])) { $input_errors[] = gettext("This GRE tunnel cannot be deleted because it is still being used as an interface."); } else { - pfSense_interface_destroy($a_gres[$_GET['id']]['greif']); - unset($a_gres[$_GET['id']]); + pfSense_interface_destroy($a_gres[$_POST['id']]['greif']); + unset($a_gres[$_POST['id']]); write_config(); @@ -119,8 +119,8 @@ display_top_tabs($tab_array); <?=htmlspecialchars($gre['descr'])?> </td> <td> - <a class="fa fa-pencil" title="<?=gettext('Edit GRE interface')?>" href="interfaces_gre_edit.php?id=<?=$i?>"></a> - <a class="fa fa-trash" title="<?=gettext('Delete GRE interface')?>" href="interfaces_gre.php?act=del&id=<?=$i?>"></a> + <a class="fa fa-pencil" title="<?=gettext('Edit GRE interface')?>" href="interfaces_gre_edit.php?id=<?=$i?>" usepost></a> + <a class="fa fa-trash" title="<?=gettext('Delete GRE interface')?>" href="interfaces_gre.php?act=del&id=<?=$i?>" usepost></a> </td> </tr> <?php endforeach; ?> @@ -131,7 +131,7 @@ display_top_tabs($tab_array); </div> <nav class="action-buttons"> - <a href="interfaces_gre_edit.php" class="btn btn-success btn-sm"> + <a href="interfaces_gre_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_gre_edit.php b/src/usr/local/www/interfaces_gre_edit.php index 5899927..ab739d7 100644 --- a/src/usr/local/www/interfaces_gre_edit.php +++ b/src/usr/local/www/interfaces_gre_edit.php @@ -34,13 +34,7 @@ if (!is_array($config['gres']['gre'])) { } $a_gres = &$config['gres']['gre']; - -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_gres[$id]) { $pconfig['if'] = $a_gres[$id]['if']; @@ -55,7 +49,7 @@ if (isset($id) && $a_gres[$id]) { $pconfig['descr'] = $a_gres[$id]['descr']; } -if ($_POST) { +if ($_POST['save']) { unset($input_errors); $pconfig = $_POST; |