diff options
author | Matt Smith <mgsmith@netgate.com> | 2015-11-06 14:44:46 -0600 |
---|---|---|
committer | Matt Smith <mgsmith@netgate.com> | 2015-11-06 14:47:17 -0600 |
commit | 7aeae838123a434c9228dc2f0254e04fc43e3749 (patch) | |
tree | f89b384742b3da3530a31094bb8fdd2297840f8b /src/usr/local/www | |
parent | 101911ff55062635fc4ce6f93859a4c244b32edf (diff) | |
download | pfsense-7aeae838123a434c9228dc2f0254e04fc43e3749.zip pfsense-7aeae838123a434c9228dc2f0254e04fc43e3749.tar.gz |
Fix services_unbound.php. The interfaces menus did not display the selected
interfaces, they always showed "all" selected. Made it so an "apply changes"
message shows when something changes.
Diffstat (limited to 'src/usr/local/www')
-rw-r--r-- | src/usr/local/www/services_unbound.php | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/usr/local/www/services_unbound.php b/src/usr/local/www/services_unbound.php index d36a822..d3113b7 100644 --- a/src/usr/local/www/services_unbound.php +++ b/src/usr/local/www/services_unbound.php @@ -122,8 +122,6 @@ if (empty($config['unbound']['outgoing_interface'])) { } if ($_POST) { - $pconfig = $_POST; - unset($input_errors); if ($_POST['apply']) { $retval = services_unbound_configure(); @@ -136,6 +134,9 @@ if ($_POST) { /* Start or restart dhcpleases when it's necessary */ system_dhcpleases_configure(); } else { + $pconfig = $_POST; + unset($input_errors); + if (isset($_POST['enable']) && isset($config['dnsmasq']['enable'])) { if ($_POST['port'] == $config['dnsmasq']['port']) { $input_errors[] = "The DNS Forwarder is enabled using this port. Choose a non-conflicting port, or disable the DNS Forwarder."; @@ -229,18 +230,19 @@ if ($_GET['act'] == "del") { } } -function build_if_list() { +function build_if_list($selectedifs) { $interface_addresses = get_possible_listen_ips(true); $iflist = array('options' => array(), 'selected' => array()); $iflist['options']['all'] = "All"; - if (empty($pconfig['interface']) || empty($pconfig['interface'][0])) + if (empty($selectedifs) || empty($selectedifs[0]) || in_array("all", $selectedifs)) { array_push($iflist['selected'], "all"); + } foreach ($interface_addresses as $laddr => $ldescr) { $iflist['options'][$laddr] = htmlspecialchars($ldescr); - if ($pconfig['interface'] && in_array($laddr, $pconfig['interface'])) + if ($selectedifs && in_array($laddr, $selectedifs)) array_push($iflist['selected'], $laddr); } @@ -261,6 +263,10 @@ if ($input_errors) if ($savemsg) print_info_box($savemsg, 'success'); +if (is_subsystem_dirty('unbound')) { + print_info_box_np(gettext("The configuration of the DNS Resolver has been changed. You must apply changes for them to take effect.")); +} + $tab_array = array(); $tab_array[] = array(gettext("General settings"), true, "services_unbound.php"); $tab_array[] = array(gettext("Advanced settings"), false, "services_unbound_advanced.php"); @@ -287,22 +293,24 @@ $section->addInput(new Form_Input( $pconfig['port'] ))->setHelp('The port used for responding to DNS queries. It should normally be left blank unless another service needs to bind to TCP/UDP port 53.'); -$iflist = build_if_list(); +$activeiflist = build_if_list($pconfig['active_interface']); $section->addInput(new Form_Select( 'active_interface', 'Network Interfaces', - $iflist['selected'], - $iflist['options'], + $activeiflist['selected'], + $activeiflist['options'], true ))->setHelp('Interface IPs used by the DNS Resolver for responding to queries from clients. If an interface has both IPv4 and IPv6 IPs, both are used. Queries to other interface IPs not selected below are discarded. ' . 'The default behavior is to respond to queries on every available IPv4 and IPv6 address.'); +$outiflist = build_if_list($pconfig['outgoing_interface']); + $section->addInput(new Form_Select( 'outgoing_interface', 'Outgoing Network Interfaces', - $iflist['selected'], - $iflist['options'], + $outiflist['selected'], + $outiflist['options'], true ))->setHelp('Utilize different network interface(s) that the DNS Resolver will use to send queries to authoritative servers and receive their replies. By default all interfaces are used.'); |