From 4d6ba181c8322b8e694e09623944c70cb87d51d3 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 1 Jul 2005 19:00:13 +0000 Subject: Minor code cleanups (style related). --- usr/local/www/services_dnsmasq.php | 37 ++++++++++++++++----------------- usr/local/www/services_dnsmasq_edit.php | 21 +++++++++---------- 2 files changed, 28 insertions(+), 30 deletions(-) (limited to 'usr/local/www') diff --git a/usr/local/www/services_dnsmasq.php b/usr/local/www/services_dnsmasq.php index 3a1da17..5e0a835 100755 --- a/usr/local/www/services_dnsmasq.php +++ b/usr/local/www/services_dnsmasq.php @@ -32,19 +32,18 @@ require("guiconfig.inc"); -$pconfig['enable'] = isset($config['dnsmasq']['enable']); +$pconfig['enable'] = isset($config['dnsmasq']['enable']); $pconfig['regdhcp'] = isset($config['dnsmasq']['regdhcp']); -if (!is_array($config['dnsmasq']['hosts'])) { +if (!is_array($config['dnsmasq']['hosts'])) $config['dnsmasq']['hosts'] = array(); -} -if (!is_array($config['dnsmasq']['domainoverrides'])) { +if (!is_array($config['dnsmasq']['domainoverrides'])) $config['dnsmasq']['domainoverrides'] = array(); -} hosts_sort(); -$a_hosts = &$config['dnsmasq']['hosts']; + +$a_hosts = &$config['dnsmasq']['hosts']; $a_domainOverrides = &$config['dnsmasq']['domainoverrides']; if ($_POST) { @@ -75,7 +74,7 @@ if ($_GET['act'] == "del") { if ($a_hosts[$_GET['id']]) { unset($a_hosts[$_GET['id']]); write_config(); - touch($d_dnsmasqdirty_path); + touch($d_hostsdirty_path); header("Location: services_dnsmasq.php"); exit; } @@ -84,7 +83,7 @@ if ($_GET['act'] == "del") { if ($a_domainOverrides[$_GET['id']]) { unset($a_domainOverrides[$_GET['id']]); write_config(); - touch($d_dnsmasqdirty_path); + touch($d_hostsdirty_path); header("Location: services_dnsmasq.php"); exit; } @@ -110,7 +109,7 @@ if ($_GET['act'] == "del") { You must apply the changes in order for them to take effect.");?>

- +
-

> @@ -149,9 +148,9 @@ if ($_GET['act'] == "del") { You may enter records that override the results from the forwarders below.

-  
- +
+  
+ @@ -191,17 +190,17 @@ if ($_GET['act'] == "del") {
Host Domain
- + - +
-
 

Below you can override an entire domain by specifying an authoritative dns server to be queried for that domain.

-  
- +
+  
+ @@ -227,8 +226,8 @@ if ($_GET['act'] == "del") { -
Domain IP
- + + diff --git a/usr/local/www/services_dnsmasq_edit.php b/usr/local/www/services_dnsmasq_edit.php index 1d2a999..a667730 100755 --- a/usr/local/www/services_dnsmasq_edit.php +++ b/usr/local/www/services_dnsmasq_edit.php @@ -32,9 +32,9 @@ require("guiconfig.inc"); -if (!is_array($config['dnsmasq']['hosts'])) { +if (!is_array($config['dnsmasq']['hosts'])) $config['dnsmasq']['hosts'] = array(); -} + hosts_sort(); $a_hosts = &$config['dnsmasq']['hosts']; @@ -60,15 +60,14 @@ if ($_POST) { do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - if (($_POST['host'] && !is_hostname($_POST['host']))) { + if (($_POST['host'] && !is_hostname($_POST['host']))) $input_errors[] = "A valid host must be specified."; - } - if (($_POST['domain'] && !is_domain($_POST['domain']))) { + + if (($_POST['domain'] && !is_domain($_POST['domain']))) $input_errors[] = "A valid domain must be specified."; - } - if (($_POST['ip'] && !is_ipaddr($_POST['ip']))) { + + if (($_POST['ip'] && !is_ipaddr($_POST['ip']))) $input_errors[] = "A valid IP address must be specified."; - } /* check for overlaps */ foreach ($a_hosts as $hostent) { @@ -114,8 +113,8 @@ if ($_POST) {

Services: DNS forwarder: Edit host

-
- + +
-
Host @@ -154,7 +153,7 @@ if ($_POST) {
+
-- cgit v1.1