diff options
author | Steve Beaver <sbeaver@netgate.com> | 2017-02-10 08:21:21 -0500 |
---|---|---|
committer | Steve Beaver <sbeaver@netgate.com> | 2017-02-10 08:21:21 -0500 |
commit | ba14d48e26a7f5fb172e6dcf40872a4388f4bc81 (patch) | |
tree | 8aa2c9a11d7db6e64acce6443aeddb992c33ee1a | |
parent | bda120a4cb284f276156a3e9da8f8f3261999ea9 (diff) | |
download | pfsense-ba14d48e26a7f5fb172e6dcf40872a4388f4bc81.zip pfsense-ba14d48e26a7f5fb172e6dcf40872a4388f4bc81.tar.gz |
GET/POST conversion system_gateway_groups*
-rw-r--r-- | src/usr/local/www/system_gateway_groups.php | 19 | ||||
-rw-r--r-- | src/usr/local/www/system_gateway_groups_edit.php | 11 |
2 files changed, 13 insertions, 17 deletions
diff --git a/src/usr/local/www/system_gateway_groups.php b/src/usr/local/www/system_gateway_groups.php index 5502a31..3a8f447 100644 --- a/src/usr/local/www/system_gateway_groups.php +++ b/src/usr/local/www/system_gateway_groups.php @@ -42,7 +42,6 @@ $a_gateways = &$config['gateways']['gateway_item']; $changedesc = gettext("Gateway Groups") . ": "; if ($_POST) { - $pconfig = $_POST; if ($_POST['apply']) { @@ -69,16 +68,16 @@ if ($_POST) { } } -if ($_GET['act'] == "del") { - if ($a_gateway_groups[$_GET['id']]) { - $changedesc .= sprintf(gettext("removed gateway group %s"), $_GET['id']); +if ($_POST['act'] == "del") { + if ($a_gateway_groups[$_POST['id']]) { + $changedesc .= sprintf(gettext("removed gateway group %s"), $_POST['id']); foreach ($config['filter']['rule'] as $idx => $rule) { - if ($rule['gateway'] == $a_gateway_groups[$_GET['id']]['name']) { + if ($rule['gateway'] == $a_gateway_groups[$_POST['id']]['name']) { unset($config['filter']['rule'][$idx]['gateway']); } } - unset($a_gateway_groups[$_GET['id']]); + unset($a_gateway_groups[$_POST['id']]); write_config($changedesc); mark_subsystem_dirty('staticroutes'); header("Location: system_gateway_groups.php"); @@ -167,9 +166,9 @@ foreach ($a_gateway_groups as $gateway_group): <?=htmlspecialchars($gateway_group['descr'])?> </td> <td> - <a href="system_gateway_groups_edit.php?id=<?=$i?>" class="fa fa-pencil" title="<?=gettext('Edit gateway group')?>"></a> - <a href="system_gateway_groups_edit.php?dup=<?=$i?>" class="fa fa-clone" title="<?=gettext('Copy gateway group')?>"></a> - <a href="system_gateway_groups.php?act=del&id=<?=$i?>" class="fa fa-trash" title="<?=gettext('Delete gateway group')?>"></a> + <a href="system_gateway_groups_edit.php?id=<?=$i?>" class="fa fa-pencil" title="<?=gettext('Edit gateway group')?>" usepost></a> + <a href="system_gateway_groups_edit.php?dup=<?=$i?>" class="fa fa-clone" title="<?=gettext('Copy gateway group')?>" usepost></a> + <a href="system_gateway_groups.php?act=del&id=<?=$i?>" class="fa fa-trash" title="<?=gettext('Delete gateway group')?>" usepost></a> </td> </tr> <?php @@ -183,7 +182,7 @@ endforeach; </div> <nav class="action-buttons"> - <a href="system_gateway_groups_edit.php" class="btn btn-success btn-sm"> + <a href="system_gateway_groups_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/system_gateway_groups_edit.php b/src/usr/local/www/system_gateway_groups_edit.php index b5cc167..5e3c18a 100644 --- a/src/usr/local/www/system_gateway_groups_edit.php +++ b/src/usr/local/www/system_gateway_groups_edit.php @@ -44,15 +44,12 @@ $categories = array( 'downlatency' => gettext("High Latency"), 'downlosslatency' => gettext("Packet Loss or High Latency")); -if (is_numericint($_GET['id'])) { - $id = $_GET['id']; -} if (isset($_POST['id']) && is_numericint($_POST['id'])) { $id = $_POST['id']; } -if (isset($_GET['dup']) && is_numericint($_GET['dup'])) { - $id = $_GET['dup']; +if (isset($_POST['dup']) && is_numericint($_POST['dup'])) { + $id = $_POST['dup']; } if (isset($id) && $a_gateway_groups[$id]) { @@ -62,11 +59,11 @@ if (isset($id) && $a_gateway_groups[$id]) { $pconfig['trigger'] = $a_gateway_groups[$id]['trigger']; } -if (isset($_GET['dup']) && is_numericint($_GET['dup'])) { +if (isset($_POST['dup']) && is_numericint($_POST['dup'])) { unset($id); } -if ($_POST) { +if (isset($_POST['save'])) { unset($input_errors); $pconfig = $_POST; |