Show canonical name if not auto-converted

This commit is contained in:
Jamie Cameron
2008-08-07 19:07:28 +00:00
parent 62390a31a8
commit ca7991fd7a
4 changed files with 20 additions and 10 deletions

View File

@@ -79,3 +79,4 @@ Record names or values entered like ns.foo.com in the domain foo.com automatical
Update serial number (by default) when editing records manually.
Try downloading root zone files from the IP for rs.internic.net if the hostname cannot be resolved, to avoid catch-22 problem.
Access control lists are now automatically re-ordered to handle dependencies.
When Webmin is not automatically converting records to canonical format for editing, display the canonical name on the Edit Record page.

View File

@@ -898,6 +898,11 @@ else {
&ui_textbox("name", $rec{'name'}, 30));
}
# Show canonical name too, if not auto-converted
if ($config{'short_names'} && @_ > 6) {
print &ui_table_row($text{'edit_canon'}, "<tt>$rec{'canon'}</tt>");
}
# TTL field
if ($rec{'ttl'} =~ /^(\d+)([SMHDW]?)$/i) {
$ttl = $1; $ttlunit = $2;

View File

@@ -213,6 +213,7 @@ edit_edit=Edit $1 Record
edit_add=Add $1 Record
edit_addr=Address
edit_name=Name
edit_canon=Full canonical name
edit_zonename=Zone Name
edit_ttl=Time-To-Live
edit_comment=Comment

View File

@@ -242,22 +242,25 @@ while($i < @tok) {
}
$dir{'values'} = \@values;
$dir{'eline'} = $lnum[$i-1];
if (!$config{'short_names'}) {
if ($dir{'name'} eq "@") {
$dir{'name'} = $origin eq "." ? "."
: "$origin.";
}
elsif ($dir{'name'} !~ /\.$/) {
$dir{'name'} .= $origin eq "." ? "."
: ".$origin.";
}
# Work out canonical form, and maybe use it
my $canon = $dir{'name'};
if ($canon eq "@") {
$canon = $origin eq "." ? "." : "$origin.";
}
elsif ($canon !~ /\.$/) {
$canon .= $origin eq "." ? "." : ".$origin.";
}
if (!$config{'short_names'}) {
$dir{'name'} = $canon;
}
$dir{'canon'} = $canon;
$dir{'num'} = $num++;
# If this is an SPF record .. adjust the class
local $spf;
if ($dir{'type'} eq 'TXT' &&
($spf=&parse_spf($dir{'values'}->[0]))) {
# An SPF record .. adjust the class
if (!@{$spf->{'other'}}) {
$dir{'type'} = 'SPF';
}