From 13541a81e1173fc02af9af8ab7fe46df2a51007d Mon Sep 17 00:00:00 2001 From: Steve Beaver Date: Tue, 14 Feb 2017 14:42:13 -0500 Subject: GET/POST conversions --- src/usr/local/www/services_unbound_host_edit.php | 28 ++---------------------- 1 file changed, 2 insertions(+), 26 deletions(-) (limited to 'src/usr/local/www/services_unbound_host_edit.php') diff --git a/src/usr/local/www/services_unbound_host_edit.php b/src/usr/local/www/services_unbound_host_edit.php index 9b54292..b5949f3 100644 --- a/src/usr/local/www/services_unbound_host_edit.php +++ b/src/usr/local/www/services_unbound_host_edit.php @@ -53,13 +53,7 @@ if (!is_array($config['unbound']['hosts'])) { } $a_hosts = &$config['unbound']['hosts']; - -if (is_numericint($_GET['id'])) { - $id = $_GET['id']; -} -if (isset($_POST['id']) && is_numericint($_POST['id'])) { - $id = $_POST['id']; -} +$id = $_REQUEST['id']; if (isset($id) && $a_hosts[$id]) { $pconfig['host'] = $a_hosts[$id]['host']; @@ -69,7 +63,7 @@ if (isset($id) && $a_hosts[$id]) { $pconfig['aliases'] = $a_hosts[$id]['aliases']; } -if ($_POST) { +if ($_POST['save']) { unset($input_errors); $pconfig = $_POST; @@ -179,24 +173,6 @@ if ($_POST) { } } -// Delete a row in the options table -if ($_GET['act'] == "delopt") { - $idx = $_GET['id']; - - if ($pconfig['aliases'] && is_array($pconfig['aliases']['item'][$idx])) { - unset($pconfig['aliases']['item'][$idx]); - } -} - -// Add an option row -if ($_GET['act'] == "addopt") { - if (!is_array($pconfig['aliases']['item'])) { - $pconfig['aliases']['item'] = array(); - } - - array_push($pconfig['aliases']['item'], array('host' => null, 'domain' => null, 'description' => null)); -} - $pgtitle = array(gettext("Services"), gettext("DNS Resolver"), gettext("General Settings"), gettext("Edit Host Override")); $pglinks = array("", "services_unbound.php", "services_unbound.php", "@self"); $shortcut_section = "resolver"; -- cgit v1.1