summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/services_dnsmasq.php
diff options
context:
space:
mode:
authorSteve Beaver <sbeaver@netgate.com>2016-11-09 09:56:00 -0500
committerSteve Beaver <sbeaver@netgate.com>2016-11-09 09:56:00 -0500
commit8e7fea674a34ab217c9b9821c608639ca45bd281 (patch)
tree4aac5d8503632be9249966a4f59f1ba8ccb580f2 /src/usr/local/www/services_dnsmasq.php
parentb8b0fab1a4ef44758ff7fdd9cbfcc8bab2fe49b9 (diff)
downloadpfsense-8e7fea674a34ab217c9b9821c608639ca45bd281.zip
pfsense-8e7fea674a34ab217c9b9821c608639ca45bd281.tar.gz
Fixed #6903
hosts and domains sorted on display, not on save to config
Diffstat (limited to 'src/usr/local/www/services_dnsmasq.php')
-rw-r--r--src/usr/local/www/services_dnsmasq.php34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/usr/local/www/services_dnsmasq.php b/src/usr/local/www/services_dnsmasq.php
index 5413583..662e268 100644
--- a/src/usr/local/www/services_dnsmasq.php
+++ b/src/usr/local/www/services_dnsmasq.php
@@ -37,6 +37,36 @@ require_once("filter.inc");
require_once("shaper.inc");
require_once("system.inc");
+// Sort host entries for display in alpabetical order
+function hostcmp($a, $b) {
+ return strcasecmp($a['host'], $b['host']);
+}
+
+function hosts_sort() {
+ global $a_hosts;
+
+ if (!is_array($a_hosts)) {
+ return;
+ }
+
+ usort($a_hosts, "hostcmp");
+}
+
+// Sort domain entries for display in alpabetical order
+function domaincmp($a, $b) {
+ return strcasecmp($a['domain'], $b['domain']);
+}
+
+function domains_sort() {
+ global $a_domainOverrides;
+
+ if (!is_array($a_domainOverrides)) {
+ return;
+ }
+
+ usort($a_domainOverrides, "domaincmp");
+}
+
$pconfig['enable'] = isset($config['dnsmasq']['enable']);
$pconfig['regdhcp'] = isset($config['dnsmasq']['regdhcp']);
$pconfig['regdhcpstatic'] = isset($config['dnsmasq']['regdhcpstatic']);
@@ -46,8 +76,8 @@ $pconfig['domain_needed'] = isset($config['dnsmasq']['domain_needed']);
$pconfig['no_private_reverse'] = isset($config['dnsmasq']['no_private_reverse']);
$pconfig['port'] = $config['dnsmasq']['port'];
$pconfig['custom_options'] = $config['dnsmasq']['custom_options'];
-
$pconfig['strictbind'] = isset($config['dnsmasq']['strictbind']);
+
if (!empty($config['dnsmasq']['interface'])) {
$pconfig['interface'] = explode(",", $config['dnsmasq']['interface']);
} else {
@@ -63,7 +93,9 @@ if (!is_array($config['dnsmasq']['domainoverrides'])) {
}
$a_hosts = &$config['dnsmasq']['hosts'];
+hosts_sort();
$a_domainOverrides = &$config['dnsmasq']['domainoverrides'];
+domains_sort();
if ($_POST) {
if ($_POST['apply']) {
OpenPOWER on IntegriCloud