diff --git a/bind8/bind8-lib.pl b/bind8/bind8-lib.pl index 7bc14a2c0..285fee01a 100755 --- a/bind8/bind8-lib.pl +++ b/bind8/bind8-lib.pl @@ -3161,10 +3161,13 @@ my ($zone) = @_; my @rv; if (!$access{'ro'} && $access{'apply'}) { my $r = $ENV{'REQUEST_METHOD'} eq 'POST' ? 0 : 1; - my $zone_name; + my $link_params; if ($zone) { - $zone_name = "&" . "zone=$zone->{'name'}&type=$zone->{'type'}"; - } + $link_params = "&" . "zone=$zone->{'name'}&type=$zone->{'type'}"; + if ($zone->{'viewindex'}) { + $link_params .= "&view=$zone->{'viewindex'}"; + } + } if (&is_bind_running()) { if ($zone && ($access{'apply'} == 1 || $access{'apply'} == 2)) { # Apply this zone @@ -3175,16 +3178,16 @@ if (!$access{'ro'} && $access{'apply'}) { } # Apply whole config if ($access{'apply'} == 1 || $access{'apply'} == 3) { - push(@rv, &ui_link("restart.cgi?return=$r$zone_name", $text{'links_restart'}) ); + push(@rv, &ui_link("restart.cgi?return=$r$link_params", $text{'links_restart'}) ); } if ($access{'apply'} == 1) { # Stop BIND - push(@rv, &ui_link("stop.cgi?return=$r$zone_name", $text{'links_stop'}) ); + push(@rv, &ui_link("stop.cgi?return=$r$link_params", $text{'links_stop'}) ); } } elsif ($access{'apply'} == 1) { # Start BIND - push(@rv, &ui_link("start.cgi?return=$r$zone_name", $text{'links_start'})); + push(@rv, &ui_link("start.cgi?return=$r$link_params", $text{'links_start'})); } } return join('
', @rv); diff --git a/bind8/restart.cgi b/bind8/restart.cgi index 92f852a75..370554e90 100755 --- a/bind8/restart.cgi +++ b/bind8/restart.cgi @@ -31,6 +31,9 @@ my $redir_targ = ($in{'type'} eq "master" ? "edit_master.cgi" : my $zone; if ($in{'zone'}) { $zone = "?zone=$in{'zone'}"; -} + if ($in{'view'}) { + $zone .= "&view=$in{'view'}"; + } + } &redirect($zone && $in{'return'} ? "$redir_targ$zone" : ""); diff --git a/bind8/restart_zone.cgi b/bind8/restart_zone.cgi index 0928b58f0..a79f23438 100755 --- a/bind8/restart_zone.cgi +++ b/bind8/restart_zone.cgi @@ -18,10 +18,4 @@ my $err = &restart_zone($zone->{'name'}, $zone->{'view'}); my $tv = $zone->{'type'}; my $redir_targ = ($tv eq "master" ? "edit_master.cgi" : $tv eq "forward" ? "edit_forward.cgi" : "edit_slave.cgi"); -if ($in{'return'}) { - &redirect($redir_targ . "?zone=$in{'zone'}"); - } -else { - &redirect($redir_targ . "?zone=$in{'zone'}&view=$in{'view'}"); - } - +&redirect($redir_targ . "?zone=$in{'zone'}&view=$in{'view'}"); diff --git a/bind8/start.cgi b/bind8/start.cgi index d5d199225..e71d0299d 100755 --- a/bind8/start.cgi +++ b/bind8/start.cgi @@ -17,6 +17,9 @@ my $redir_targ = ($in{'type'} eq "master" ? "edit_master.cgi" : my $zone; if ($in{'zone'}) { $zone = "?zone=$in{'zone'}"; -} + if ($in{'view'}) { + $zone .= "&view=$in{'view'}"; + } + } &redirect($zone && $in{'return'} ? "$redir_targ$zone" : ""); diff --git a/bind8/stop.cgi b/bind8/stop.cgi index 9c8c2baca..1d1c96e10 100755 --- a/bind8/stop.cgi +++ b/bind8/stop.cgi @@ -13,6 +13,9 @@ my $redir_targ = ($in{'type'} eq "master" ? "edit_master.cgi" : my $zone; if ($in{'zone'}) { $zone = "?zone=$in{'zone'}"; -} + if ($in{'view'}) { + $zone .= "&view=$in{'view'}"; + } + } &redirect($zone && $in{'return'} ? "$redir_targ$zone" : "");