From 93c5ed2ff6f7600359528235d5b3160f33499537 Mon Sep 17 00:00:00 2001 From: Warren Baker Date: Mon, 19 Dec 2011 21:57:08 +0200 Subject: make use of an apply button and use pfSenseHeader() instead --- config/unbound/unbound_acls.php | 50 +++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 19 deletions(-) (limited to 'config/unbound') diff --git a/config/unbound/unbound_acls.php b/config/unbound/unbound_acls.php index 7e4e5a71..a7c3ea9e 100644 --- a/config/unbound/unbound_acls.php +++ b/config/unbound/unbound_acls.php @@ -98,22 +98,32 @@ if ($_POST) { if (!$input_errors) { - if(!$a_acls[$id]) - $a_acls[$id]['aclid'] = $id; - - if (isset($id) && $a_acls[$id]) { - $a_acls[$id]['aclid'] = $pconfig['aclid']; - $a_acls[$id]['aclname'] = $pconfig['aclname']; - $a_acls[$id]['aclaction'] = $pconfig['aclaction']; - $a_acls[$id]['description'] = $pconfig['description']; - $a_acls[$id]['row'] = array(); - foreach ($networkacl as $acl) - $a_acls[$id]['row'][] = $acl; - write_config(); - unbound_reconfigure(); + if ($pconfig['Submit'] == gettext("Save")) { + if(!$a_acls[$id]) + $a_acls[$id]['aclid'] = $id; + + if (isset($id) && $a_acls[$id]) { + $a_acls[$id]['aclid'] = $pconfig['aclid']; + $a_acls[$id]['aclname'] = $pconfig['aclname']; + $a_acls[$id]['aclaction'] = $pconfig['aclaction']; + $a_acls[$id]['description'] = $pconfig['description']; + $a_acls[$id]['row'] = array(); + foreach ($networkacl as $acl) + $a_acls[$id]['row'][] = $acl; + write_config(); + mark_subsystem_dirty("unbound"); + //unbound_reconfigure(); + } + pfSenseHeader("/unbound_acls.php"); + exit; + } + + if ($pconfig['apply']) { + clear_subsystem_dirty("unbound"); + $retval = 0; + $retval = unbound_reconfigure(); + $savemsg = get_std_save_message($retval); } - header("Location: unbound_acls.php"); - exit; } } @@ -148,6 +158,7 @@ include("head.inc"); +
@@ -178,7 +192,7 @@ if ($savemsg) - + @@ -361,6 +375,4 @@ if ($savemsg)
- - -?> \ No newline at end of file + \ No newline at end of file -- cgit v1.2.3