summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/services_dnsmasq_domainoverride_edit.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-12-16 23:16:58 +0545
committerPhil Davis <phil.davis@inf.org>2015-12-16 23:16:58 +0545
commit6e3488e958f8f1e548962a7f07cca8f45f106a46 (patch)
treefaa73d19c44557e5de589a0384f3f9e64af948ab /src/usr/local/www/services_dnsmasq_domainoverride_edit.php
parente84865c8c5d72b44000aee8c1c3cf97c22686f9d (diff)
downloadpfsense-6e3488e958f8f1e548962a7f07cca8f45f106a46.zip
pfsense-6e3488e958f8f1e548962a7f07cca8f45f106a46.tar.gz
Code style services dhcp dnsmasq dyndns
Diffstat (limited to 'src/usr/local/www/services_dnsmasq_domainoverride_edit.php')
-rw-r--r--src/usr/local/www/services_dnsmasq_domainoverride_edit.php59
1 files changed, 30 insertions, 29 deletions
diff --git a/src/usr/local/www/services_dnsmasq_domainoverride_edit.php b/src/usr/local/www/services_dnsmasq_domainoverride_edit.php
index 4eb3e49..b230a4b 100644
--- a/src/usr/local/www/services_dnsmasq_domainoverride_edit.php
+++ b/src/usr/local/www/services_dnsmasq_domainoverride_edit.php
@@ -92,46 +92,46 @@ if (isset($id) && $a_domainOverrides[$id]) {
}
if ($_POST) {
- unset($input_errors);
- $pconfig = $_POST;
+ unset($input_errors);
+ $pconfig = $_POST;
- /* input validation */
- $reqdfields = explode(" ", "domain ip");
- $reqdfieldsn = array(gettext("Domain"),gettext("IP address"));
+ /* input validation */
+ $reqdfields = explode(" ", "domain ip");
+ $reqdfieldsn = array(gettext("Domain"), gettext("IP address"));
- do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
+ do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
- function String_Begins_With($needle, $haystack) {
- return (substr($haystack, 0, strlen($needle))==$needle);
- }
+ function String_Begins_With($needle, $haystack) {
+ return (substr($haystack, 0, strlen($needle)) == $needle);
+ }
- if (String_Begins_With(_msdcs, $_POST['domain'])) {
- $subdomainstr = substr($_POST['domain'], 7);
+ if (String_Begins_With(_msdcs, $_POST['domain'])) {
+ $subdomainstr = substr($_POST['domain'], 7);
- if ($subdomainstr && !is_domain($subdomainstr)) {
- $input_errors[] = gettext("A valid domain must be specified after _msdcs.");
- }
- }
- elseif ($_POST['domain'] && !is_domain($_POST['domain'])) {
- $input_errors[] = gettext("A valid domain must be specified.");
- }
+ if ($subdomainstr && !is_domain($subdomainstr)) {
+ $input_errors[] = gettext("A valid domain must be specified after _msdcs.");
+ }
+ } elseif ($_POST['domain'] && !is_domain($_POST['domain'])) {
+ $input_errors[] = gettext("A valid domain must be specified.");
+ }
- if ($_POST['ip'] && !is_ipaddr($_POST['ip']) && ($_POST['ip'] != '#') && ($_POST['ip'] != '!')) {
- $input_errors[] = gettext("A valid IP address must be specified, or # for an exclusion or ! to not forward at all.");
- }
+ if ($_POST['ip'] && !is_ipaddr($_POST['ip']) && ($_POST['ip'] != '#') && ($_POST['ip'] != '!')) {
+ $input_errors[] = gettext("A valid IP address must be specified, or # for an exclusion or ! to not forward at all.");
+ }
- if ($_POST['dnssrcip'] && !in_array($_POST['dnssrcip'], get_configured_ip_addresses())) {
- $input_errors[] = gettext("An interface IP address must be specified for the DNS query source.");
- }
+ if ($_POST['dnssrcip'] && !in_array($_POST['dnssrcip'], get_configured_ip_addresses())) {
+ $input_errors[] = gettext("An interface IP address must be specified for the DNS query source.");
+ }
- if (!$input_errors) {
+ if (!$input_errors) {
$doment = array();
$doment['domain'] = $_POST['domain'];
- if (empty($_POST['dnssrcip']))
+ if (empty($_POST['dnssrcip'])) {
$doment['ip'] = $_POST['ip'];
- else
- $doment['ip'] = $_POST['ip'] . "@" . $_POST['dnssrcip'];
+ } else {
+ $doment['ip'] = $_POST['ip'] . "@" . $_POST['dnssrcip'];
+ }
$doment['descr'] = $_POST['descr'];
@@ -154,8 +154,9 @@ $pgtitle = array(gettext("Services"), gettext("DNS Forwarder"), gettext("Edit Do
$shortcut_section = "forwarder";
include("head.inc");
-if ($input_errors)
+if ($input_errors) {
print_input_errors($input_errors);
+}
$form = new Form();
OpenPOWER on IntegriCloud