diff --git a/bind8/bind8-lib.pl b/bind8/bind8-lib.pl
index 0061d5c8f..e6b479f93 100755
--- a/bind8/bind8-lib.pl
+++ b/bind8/bind8-lib.pl
@@ -1188,11 +1188,9 @@ $rv .= &ui_columns_start([ "", $text{'index_zone'}, $text{'index_type'} ],
for($i=0; $i<@{$_[0]}; $i++) {
local @cols;
if (&have_dnssec_tools_support()) {
- @cols = ( "[$i]\">$_[1]->[$i]",
- $_[2]->[$i], $_[4]->[$i]);
+ @cols = ( &ui_link($_[0]->[$i], $_[1]->[$i]), $_[2]->[$i], $_[4]->[$i] );
} else {
- @cols = ( "[$i]\">$_[1]->[$i]",
- $_[2]->[$i]);
+ @cols = ( &ui_link($_[0]->[$i], $_[1]->[$i]), $_[2]->[$i] );
}
if (defined($_[3]->[$i])) {
$rv .= &ui_checked_columns_row(\@cols, \@tds, "d", $_[3]->[$i]);
@@ -2930,26 +2928,23 @@ if (!$access{'ro'} && $access{'apply'}) {
if (&is_bind_running()) {
if ($zone && ($access{'apply'} == 1 || $access{'apply'} == 2)) {
# Apply this zone
- push(@rv, "{'name'}'>".
- "$text{'links_apply'}");
+ my $link = "restart_zone.cgi?return=$r&".
+ "view=$zone->{'viewindex'}&".
+ "zone=$zone->{'name'}";
+ push(@rv, &ui_link($link, $text{'links_apply'}) );
}
# Apply whole config
if ($access{'apply'} == 1 || $access{'apply'} == 3) {
- push(@rv, "".
- "$text{'links_restart'}");
+ push(@rv, &ui_link("restart.cgi?return=$r", $text{'links_restart'}) );
}
if ($access{'apply'} == 1) {
# Stop BIND
- push(@rv, "".
- "$text{'links_stop'}");
+ push(@rv, &ui_link("stop.cgi?return=$r", $text{'links_stop'}) );
}
}
elsif ($access{'apply'} == 1) {
# Start BIND
- push(@rv, "".
- "$text{'links_start'}");
+ push(@rv, &ui_link("start.cgi?return=$r", $text{'links_start'}));
}
}
return join('
', @rv);
diff --git a/bind8/edit_master.cgi b/bind8/edit_master.cgi
index 8c5563ca5..c245b8eb5 100755
--- a/bind8/edit_master.cgi
+++ b/bind8/edit_master.cgi
@@ -191,9 +191,7 @@ if ($_[0]) {
%rnum ? ( $text{'master_records'} ) : ( )
], 100);
for(my $i=0; $_[$i]; $i++) {
- local @cols = ( "".
- ($text{"recs_$_[$i]"} || $_[$i])."" );
+ local @cols = ( &ui_link("edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$_[$i]", ($text{"recs_$_[$i]"} || $_[$i]) ) );
if (%rnum) {
push(@cols, $rnum{$_[$i]});
}
diff --git a/bind8/edit_recs.cgi b/bind8/edit_recs.cgi
index 2cc2b0cb1..2ea407df6 100755
--- a/bind8/edit_recs.cgi
+++ b/bind8/edit_recs.cgi
@@ -136,18 +136,18 @@ if (!$access{'ro'} && $type eq 'master') {
push(@hcols, "");
push(@tds, "width=5");
}
-push(@hcols, "".($in{'type'} eq "PTR" ? $text{'recs_addr'} : $text{'recs_name'})."");
-push(@hcols, "$text{'recs_type'}") if ($in{'type'} eq "ALL");
+push(@hcols, &ui_link("edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$in{'type'}&sort=1", ($in{'type'} eq "PTR" ? $text{'recs_addr'} : $text{'recs_name'}) ) );
+push(@hcols, &ui_link("edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$in{'type'}&sort=5", $text{'recs_type'}) ) if ($in{'type'} eq "ALL");
push(@hcols, $text{'recs_ttl'});
@hmap = @{$hmap{$in{'type'}}};
foreach $h (@hmap) {
- push(@hcols, "$h");
+ push(@hcols, &ui_link("edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$in{'type'}&sort=2",$h) );
}
if ($in{'type'} eq "ALL" || $is_extra{$in{'type'}}) {
push(@hcols, $text{'recs_vals'});
}
if ($config{'allow_comments'} && $in{'type'} ne "WKS") {
- push(@hcols, "$text{'recs_comment'}");
+ push(@hcols, &ui_link("edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$in{'type'}&sort=4", $text{'recs_comment'}) );
}
$rv .= &ui_columns_start(\@hcols, 100);
@@ -169,11 +169,7 @@ for($i=0; $i<@_; $i++) {
$name = &html_escape($name);
$id = &record_id($r);
if (!$access{'ro'} && $type eq 'master') {
- push(@cols,
- "{'num'}&".
- "type=$in{'type'}&sort=$in{'sort'}&view=$in{'view'}\">".
- "$name");
+ push(@cols, &ui_link("edit_record.cgi?zone=$in{'zone'}&id=".&urlize($id)."&num=$r->{'num'}&type=$in{'type'}&sort=$in{'sort'}&view=$in{'view'}", $name) );
}
else {
push(@cols, $name);
diff --git a/bind8/edit_slave.cgi b/bind8/edit_slave.cgi
index 4979f08f6..228e07f2b 100755
--- a/bind8/edit_slave.cgi
+++ b/bind8/edit_slave.cgi
@@ -123,9 +123,7 @@ if ($_[0]) {
$text{'master_records'},
], 100);
for(my $i=0; $_[$i]; $i++) {
- local @cols = ( "".
- ($text{"recs_$_[$i]"} || $_[$i])."",
+ local @cols = ( &ui_link("edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=$_[$i]",($text{"recs_$_[$i]"} || $_[$i]) ),
$rnum{$_[$i]} );
$rv .= &ui_columns_row(\@cols);
}
diff --git a/bind8/find_free.cgi b/bind8/find_free.cgi
index f545edf12..a005fc614 100755
--- a/bind8/find_free.cgi
+++ b/bind8/find_free.cgi
@@ -147,8 +147,7 @@ print &ui_form_end([ [ undef, $text{'findfree_search'} ] ]);
sub frecs_table
{
print &ui_grid_table(
- [ map { "{'ip'}'>$_->{'ip'}" } @_ ],
+ [ map { &ui_link("edit_recs.cgi?zone=$in{'zone'}&view=$in{'view'}&type=A&newvalue=$_->{'ip'}", $_->{'ip'}) } @_ ],
4, 100, [ "width=25%", "width=25%", "width=25%", "width=25%" ]);
}
diff --git a/bind8/free_chooser.cgi b/bind8/free_chooser.cgi
index cd642ffcd..cc69b3b0f 100755
--- a/bind8/free_chooser.cgi
+++ b/bind8/free_chooser.cgi
@@ -68,7 +68,7 @@ foreach $net (@nets) {
for($d=$start; $d<=$end; $d++) {
$ip = "$netip[0].$netip[1].$netip[2].$d";
if (!$taken{$ip}) {
- print &ui_columns_row([ "$ip" ]);
+ print &ui_columns_row([ &ui_link("", $ip, undef, "onClick='return select(\"$ip\");'") ]);
}
}
}
diff --git a/bind8/index.cgi b/bind8/index.cgi
index e458b4d03..8f60393da 100755
--- a/bind8/index.cgi
+++ b/bind8/index.cgi
@@ -128,31 +128,24 @@ if ($access{'defaults'}) {
# Work out what creation links we have
@crlinks = ( );
if ($access{'master'} && !$access{'ro'}) {
- push(@crlinks,
- "$text{'index_addmaster'}");
+ push(@crlinks, &ui_link("master_form.cgi", $text{'index_addmaster'}) );
}
if ($access{'slave'} && !$access{'ro'}) {
- push(@crlinks,
- "$text{'index_addslave'}");
- push(@crlinks,
- "$text{'index_addstub'}");
+ push(@crlinks, &ui_link("slave_form.cgi", $text{'index_addslave'}) );
+ push(@crlinks, &ui_link("stub_form.cgi", $text{'index_addstub'}) );
}
if ($access{'forward'} && !$access{'ro'}) {
- push(@crlinks,
- "$text{'index_addfwd'}");
+ push(@crlinks, &ui_link("forward_form.cgi", $text{'index_addfwd'}) );
}
if ($access{'delegation'} && !$access{'ro'} && &version_atleast(9, 2, 1)) {
- push(@crlinks,
- "$text{'index_adddele'}");
+ push(@crlinks, &ui_link("delegation_form.cgi", $text{'index_adddele'}) );
}
if ($access{'master'} && !$access{'ro'} &&
scalar(@hashint) < (@views ? scalar(@views) : 1)) {
- push(@crlinks,
- "$text{'index_addhint'}");
+ push(@crlinks, &ui_link("hint_form.cgi", $text{'index_addhint'}) );
}
if (@crlinks) {
- push(@crlinks,
- "$text{'index_addmass'}");
+ push(@crlinks, &ui_link("mass_form.cgi", $text{'index_addmass'}) );
}
if (@zones > $config{'max_zones'}) {
@@ -463,8 +456,7 @@ if ($access{'views'} && $bind_version >= 9) {
push(@vicons, "images/view.gif");
}
@links = ( );
- push(@links, "$text{'index_addview'}")
- if (!$access{'ro'} && $access{'views'} != 2);
+ push(@links, &ui_link("view_form.cgi", $text{'index_addview'}) ) if (!$access{'ro'} && $access{'views'} != 2);
if (@views) {
print &ui_links_row(\@links);
&icons_table(\@vlinks, \@vtitles, \@vicons, 5);
@@ -518,13 +510,13 @@ if ($_[0] ne "") {
$name =~ /^([^\.]+)/;
if (!$ztree{$name}) {
# Has no children
- print "
$1\n",
+ print "
$1\n",
}
else {
# Has children
local $act = $heiropen{$name} ? "close" : "open";
- print "";
- print "
$1\n",
+ print &ui_link("$act.cgi?what=".&urlize($name), "
");
+ print " $1\n",
}
}
else {
@@ -535,9 +527,9 @@ if ($zhash{$name}) {
local $cb = $zdelhash{$name} ?
&ui_checkbox("d", $zdelhash{$name}, "", 0)." " : "";
if (&have_dnssec_tools_support()) {
- print "