diff options
author | Stephen Beaver <sbeaver@netgate.com> | 2016-04-05 07:58:54 -0400 |
---|---|---|
committer | Stephen Beaver <sbeaver@netgate.com> | 2016-04-05 07:59:07 -0400 |
commit | 4d9a5d999eac0e6b99a02eac377da035558bdcca (patch) | |
tree | 3668353f8a2676c18cb0af2473cb4359db01d438 | |
parent | f36a00f5052d2c82697d3591f881e2123935e4c8 (diff) | |
download | pfsense-4d9a5d999eac0e6b99a02eac377da035558bdcca.zip pfsense-4d9a5d999eac0e6b99a02eac377da035558bdcca.tar.gz |
Merge pull request #2840 from phil-davis/patch-7
(cherry picked from commit 64c3e9a58d426637fa91996d3a30695f10e01e70)
-rwxr-xr-x | src/usr/local/www/diag_dns.php | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/src/usr/local/www/diag_dns.php b/src/usr/local/www/diag_dns.php index 3bb4490..177949e 100755 --- a/src/usr/local/www/diag_dns.php +++ b/src/usr/local/www/diag_dns.php @@ -85,9 +85,6 @@ foreach ($a_aliases as $a) { } if (isset($_POST['create_alias']) && (is_hostname($host) || is_ipaddr($host))) { - if ($_POST['override']) { - $override = true; - } $resolved = gethostbyname($host); $type = "hostname"; if ($resolved) { @@ -106,22 +103,17 @@ if (isset($_POST['create_alias']) && (is_hostname($host) || is_ipaddr($host))) { } } $newalias = array(); - if ($override) { - $alias_exists = false; - } - if ($alias_exists == false) { - $newalias['name'] = $aliasname; - $newalias['type'] = "network"; - $newalias['address'] = $addresses; - $newalias['descr'] = gettext("Created from Diagnostics-> DNS Lookup"); - if ($override) { - $a_aliases[$id] = $newalias; - } else { - $a_aliases[] = $newalias; - } - write_config(); - $createdalias = true; + $newalias['name'] = $aliasname; + $newalias['type'] = "network"; + $newalias['address'] = $addresses; + $newalias['descr'] = gettext("Created from Diagnostics-> DNS Lookup"); + if ($alias_exists) { + $a_aliases[$id] = $newalias; + } else { + $a_aliases[] = $newalias; } + write_config(); + $createdalias = true; } } @@ -218,7 +210,11 @@ if ($input_errors) { } if ($createdalias) { - print_info_box(gettext("Alias was created/updated successfully."), 'success', false); + if ($alias_exists) { + print_info_box(gettext("Alias was updated successfully."), 'success'); + } else { + print_info_box(gettext("Alias was created successfully."), 'success'); + } } $form = new Form(false); @@ -233,9 +229,14 @@ $section->addInput(new Form_Input( )); if (!empty($resolved)) { + if ($alias_exists) { + $button_text = gettext("Update alias"); + } else { + $button_text = gettext("Add alias"); + } $form->addGlobal(new Form_Button( 'create_alias', - 'Add alias', + $button_text, null, 'fa-plus' ))->removeClass('btn-primary')->addClass('btn-success'); |