diff options
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/services_dnsmasq.php | 37 | ||||
-rwxr-xr-x | usr/local/www/services_dnsmasq_edit.php | 21 |
2 files changed, 28 insertions, 30 deletions
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") { <?php print_info_box_np("The DNS forwarder configuration has been changed.<br>You must apply the changes in order for them to take effect.");?><br> <input name="apply" type="submit" class="formbtn" id="apply" value="Apply changes"></p> <?php endif; ?> - <table width="100%" border="0" cellpadding="6" cellspacing="0"> + <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> <td class="vtable"><p> <input name="enable" type="checkbox" id="enable" value="yes" <?php if ($pconfig['enable'] == "yes") echo "checked";?>> @@ -149,9 +148,9 @@ if ($_GET['act'] == "del") { You may enter records that override the results from the forwarders below.</p></td> </tr> - </table> - <br> - <table width="100%" border="0" cellpadding="0" cellspacing="0"> + </table> + <br> + <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="20%" class="listhdrr">Host</td> <td width="25%" class="listhdrr">Domain</td> @@ -191,17 +190,17 @@ if ($_GET['act'] == "del") { </tr> </table> </td> - </table> + </table> <!-- update to enable domain overrides --> - <table width="100%" border="0" cellpadding="6" cellspacing="0"> + <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr><td> </td></tr> <tr> <td><p>Below you can override an entire domain by specifying an authoritative dns server to be queried for that domain.</p></td> </tr> - </table> - <br> - <table width="100%" border="0" cellpadding="0" cellspacing="0"> + </table> + <br> + <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="35%" class="listhdrr">Domain</td> <td width="20%" class="listhdrr">IP</td> @@ -227,8 +226,8 @@ if ($_GET['act'] == "del") { <td class="list" colspan="3"></td> <td class="list"> <a href="services_dnsmasq_domainoverride_edit.php"><img src="plus.gif" width="17" height="17" border="0"></a></td> </tr> - </table> - </form> + </table> + </form> <?php include("fend.inc"); ?> </body> </html> 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) { <?php include("fbegin.inc"); ?> <p class="pgtitle">Services: DNS forwarder: Edit host</p> <?php if ($input_errors) print_input_errors($input_errors); ?> - <form action="services_dnsmasq_edit.php" method="post" name="iform" id="iform"> - <table width="100%" border="0" cellpadding="6" cellspacing="0"> + <form action="services_dnsmasq_edit.php" method="post" name="iform" id="iform"> + <table width="100%" border="0" cellpadding="6" cellspacing="0"> <tr> <td width="22%" valign="top" class="vncell">Host</td> <td width="78%" class="vtable"> @@ -154,7 +153,7 @@ if ($_POST) { <?php endif; ?> </td> </tr> - </table> + </table> </form> <?php include("fend.inc"); ?> </body> |