@-record mass creation

This commit is contained in:
Jamie Cameron
2008-01-29 17:53:05 +00:00
parent 2aea0bcc80
commit 217c114e1d
4 changed files with 21 additions and 8 deletions

View File

@@ -66,3 +66,4 @@ Added buttons for freezing and un-freezing a master zone, for use on systems tha
When adding a remote slave zone, the IPs of all other slaves and the master are included in the master IPs list.
---- Changes since 1.390 ----
BIND on Windows can now be configured using this module.
Mass record creation can now add records for the domain name (by entering @ as the name), as records that already exist.

View File

@@ -926,3 +926,4 @@ rmass_ettl=Missing or invalid time-to-live
rmass_doing=Adding record to zone $1 ..
rmass_done=.. done
rmass_eclash=.. a record with the same name and value $1 already exists.
rmass_clash=Create even if record already exists?

View File

@@ -18,7 +18,7 @@ foreach $d (split(/\0/, $in{'d'})) {
$access{'ro'} && &error($text{'master_ero'});
# Validate inputs
&valdnsname($in{'name'}) || &error($text{'rmass_ename'});
&valdnsname($in{'name'}) || $in{'name'} eq '@' || &error($text{'rmass_ename'});
$in{'name'} =~ /\.$/ && &error($text{'rmass_ename2'});
if ($in{'type'} eq 'A') {
&check_ipaddress($in{'value'}) ||
@@ -60,13 +60,19 @@ foreach $zi (@zones) {
print $text{'umass_notmaster'},"<p>\n";
next;
}
$fullname = $in{'name'}.".".$zi->{'name'}.".";
$fullname = $in{'name'} eq '@' ?
$zi->{'name'}."." :
$in{'name'}.".".$zi->{'name'}.".";
@recs = &read_zone_file($zi->{'file'}, $zi->{'name'});
($clash) = grep { $_->{'name'} eq $fullname } @recs;
if ($clash) {
print &text('rmass_eclash',
"<tt>".join(" ", @{$clash->{'values'}})."</tt>"),"<p>\n";
next;
if ($in{'type'} eq 'CNAME' || $in{'clash'}) {
($clash) = grep { $_->{'name'} eq $fullname &&
$_->{'type'} eq $in{'type'} } @recs;
if ($clash) {
print &text('rmass_eclash',
"<tt>".join(" ", @{$clash->{'values'}})."</tt>"),
"<p>\n";
next;
}
}
&create_record($zi->{'file'}, $in{'name'}, $in{'ttl'}, "IN",
$in{'type'}, $in{'value'});

View File

@@ -14,7 +14,7 @@ foreach $d (@d) {
print &ui_hidden("d", $d),"\n";
$dc++;
}
print &ui_table_start($text{'rmass_header'}, undef, 2);
print &ui_table_start($text{'rmass_header'}, undef, 2, [ "width=30%" ]);
# Number of domains selected
print &ui_table_row($text{'umass_sel'}, $dc);
@@ -39,6 +39,11 @@ print &ui_table_row($text{'rmass_ttl'},
&ui_opt_textbox("ttl", undef, 10, $text{'default'}).
" ".$text{'seconds'});
# Prevent clash
print &ui_table_row($text{'rmass_clash'},
&ui_radio("clash", 1, [ [ 0, $text{'yes'} ],
[ 1, $text{'no'} ] ]));
print &ui_table_end();
print &ui_form_end([ [ "create", $text{'rmass_ok'} ] ]);