This commit is contained in:
Jamie Cameron
2019-10-21 18:13:57 -07:00
parent 5866463772
commit 6701e9f756
3 changed files with 12 additions and 9 deletions

View File

@@ -1047,11 +1047,13 @@ if ($config{'short_names'} && defined($_[5])) {
}
# TTL field
if ($rec{'ttl'} =~ /^(\d+)([SMHDW]?)$/i) {
$ttl = $1; $ttlunit = $2;
if ($rec{'ttl'} && $rec{'ttl'} =~ /^(\d+)([SMHDW]?)$/i) {
$ttl = $1;
$ttlunit = $2;
}
else {
$ttl = $rec{'ttl'}; $ttlunit = "";
$ttl = $rec{'ttl'} || '';
$ttlunit = "";
}
print &ui_table_row($text{'edit_ttl'},
&ui_opt_textbox("ttl", $ttl, 8, $text{'default'})." ".
@@ -1063,7 +1065,7 @@ if ($rec{'values'}) {
@v = @{$rec{'values'}};
}
else {
@v = undef;
@v = ( );
}
if ($type eq "A" || $type eq "AAAA") {
print &ui_table_row($text{'value_A1'},
@@ -3086,6 +3088,7 @@ sub move_zone_button
{
my ($conf, $view, $zonename) = @_;
my @views = grep { &can_edit_view($_) } &find("view", $conf);
$view = '' if (!defined($view));
if ($view eq '' && @views || $view ne '' && @views > 1) {
return &ui_buttons_row("move_zone.cgi",
$text{'master_move'},
@@ -3150,9 +3153,9 @@ if (!$access{'ro'} && $access{'apply'}) {
if (&is_bind_running()) {
if ($zone && ($access{'apply'} == 1 || $access{'apply'} == 2)) {
# Apply this zone
my $link = "restart_zone.cgi?return=$r&".
"view=$zone->{'viewindex'}&".
"zone=$zone->{'name'}";
my $link = "restart_zone.cgi?return=$r&".
"view=$zone->{'viewindex'}&".
"zone=$zone->{'name'}";
push(@rv, &ui_link($link, $text{'links_apply'}) );
}
# Apply whole config

View File

@@ -8,7 +8,7 @@ our (%access, %text, %in, %config, %is_extra);
require './bind8-lib.pl';
&ReadParse();
our $ipv6revzone;
$in{'view'} = 'any' if ($in{'view'} eq '');
$in{'view'} = 'any' if (!$in{'view'} || $in{'view'} eq '');
my $zone = &get_zone_name_or_error($in{'zone'}, $in{'view'});
my $dom = $zone->{'name'};
&can_edit_zone($zone) || &error($text{'master_ecannot'});

View File

@@ -180,7 +180,7 @@ for(my $i=0; $i<@_; $i++) {
if ($in{'type'} eq 'ALL') {
push(@cols, $r->{'type'});
}
if ($r->{'ttl'} =~ /(\d+)([SMHDW]?)/i) {
if ($r->{'ttl'} && $r->{'ttl'} =~ /(\d+)([SMHDW]?)/i) {
$r->{'ttl'} =~ s/S//i;
if ($r->{'ttl'} =~ s/M//i) { $r->{'ttl'} *= 60; }
if ($r->{'ttl'} =~ s/H//i) { $r->{'ttl'} *= 3600; }