summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_unbound.php
diff options
context:
space:
mode:
authorWarren Baker <warren@decoy.co.za>2014-03-29 14:34:09 +0200
committerWarren Baker <warren@decoy.co.za>2014-03-29 14:34:09 +0200
commit188609c6dcbb2d354748616657fa645dd912659c (patch)
treed941301ee65299015267f29a523666f05d227791 /usr/local/www/services_unbound.php
parent16a3108ff29670fc0f4d5fd6cde265fae7ae1ea5 (diff)
downloadpfsense-188609c6dcbb2d354748616657fa645dd912659c.zip
pfsense-188609c6dcbb2d354748616657fa645dd912659c.tar.gz
Fix tab indents and make sure interfaces are saved correctly
Diffstat (limited to 'usr/local/www/services_unbound.php')
-rw-r--r--usr/local/www/services_unbound.php33
1 files changed, 22 insertions, 11 deletions
diff --git a/usr/local/www/services_unbound.php b/usr/local/www/services_unbound.php
index 0f6b9eb..2b57691 100644
--- a/usr/local/www/services_unbound.php
+++ b/usr/local/www/services_unbound.php
@@ -43,15 +43,21 @@ require_once("unbound.inc");
$pconfig['enable'] = isset($config['unbound']['enable']);
$pconfig['port'] = $config['unbound']['port'];
-$pconfig['active_interface'] = explode(",", $config['unbound']['active_interface']);
-$pconfig['outgoing_interface'] = explode(",", $config['unbound']['outgoing_interface']);
+if (empty($config['unbound']['active_interface']))
+ $pconfig['active_interface'] = array();
+else
+ $pconfig['active_interface'] = explode(",", $config['unbound']['active_interface']);
+if (empty($config['unbound']['outgoing_interface']))
+ $pconfig['outgoing_interface'] = array();
+else
+ $pconfig['outgoing_interface'] = explode(",", $config['unbound']['outgoing_interface']);
$pconfig['dnssec'] = isset($config['unbound']['dnssec']);
$pconfig['forwarding'] = isset($config['unbound']['forwarding']);
$pconfig['regdhcp'] = isset($config['unbound']['regdhcp']);
$pconfig['regdhcpstatic'] = isset($config['unbound']['regdhcpstatic']);
$pconfig['txtsupport'] = isset($config['unbound']['txtsupport']);
-if(!is_array($config['unbound']))
+if (!is_array($config['unbound']))
$config['unbound'] = array();
$a_unboundcfg =& $config['unbound'];
@@ -91,14 +97,19 @@ if ($_POST) {
$a_unboundcfg['regdhcp'] = ($_POST['regdhcp']) ? true : false;
$a_unboundcfg['regdhcpstatic'] = ($_POST['regdhcpstatic']) ? true : false;
$a_unboundcfg['txtsupport'] = ($_POST['txtsupport']) ? true : false;
- if (is_array($_POST['active_interface']))
+ if (is_array($_POST['active_interface']) && !empty($_POST['active_interface']))
$a_unboundcfg['active_interface'] = implode(",", $_POST['active_interface']);
- else
- $a_unboundcfg['active_interface'] = $_POST['active_interface'];
- if (is_array($_POST['outgoing_interface']))
+ else if (isset($config['unbound']['active_interface'])) {
+ unset($config['unbound']['active_interface']);
+ $pconfig['active_interface'] = array();
+ }
+
+ if (is_array($_POST['outgoing_interface']) && !empty($_POST['outgoing_interface']))
$a_unboundcfg['outgoing_interface'] = implode(",", $_POST['outgoing_interface']);
- else
- $a_unboundcfg['outgoing_interface'] = $_POST['outgoing_interface'];
+ else if (isset($config['unbound']['outgoing_interface'])) {
+ unset($config['unbound']['outgoing_interface']);
+ $pconfig['outgoing_interface'] = array();
+ }
if (!$input_errors) {
write_config("DNS Resolver configured.");
@@ -143,8 +154,8 @@ function show_advanced_dns() {
<td class="tabnavtbl">
<?php
$tab_array = array();
- $tab_array[] = array(gettext("General settings"), true, "services_unbound.php");
- $tab_array[] = array(gettext("Advanced settings"), false, "services_unbound_advanced.php");
+ $tab_array[] = array(gettext("General settings"), true, "services_unbound.php");
+ $tab_array[] = array(gettext("Advanced settings"), false, "services_unbound_advanced.php");
$tab_array[] = array(gettext("Access Lists"), false, "/services_unbound_acls.php");
display_top_tabs($tab_array, true);
?>
OpenPOWER on IntegriCloud