From 4a0c7b4297c3350c2153cef709449f91f56e4515 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sat, 4 Apr 2020 18:42:44 -0700 Subject: [PATCH] Show view name in header on all pages https://github.com/webmin/webmin/issues/1227 --- bind8/bind8-lib.pl | 10 ++++++++++ bind8/edit_delegation.cgi | 3 +-- bind8/edit_forward.cgi | 3 +-- bind8/edit_master.cgi | 3 +-- bind8/edit_options.cgi | 3 +-- bind8/edit_record.cgi | 2 +- bind8/edit_recs.cgi | 2 +- bind8/edit_slave.cgi | 5 ++--- bind8/edit_soa.cgi | 3 +-- bind8/edit_soptions.cgi | 3 +-- bind8/edit_zonedt.cgi | 3 +-- bind8/edit_zonekey.cgi | 3 +-- bind8/find_free.cgi | 2 +- bind8/lang/en | 1 + bind8/list_gen.cgi | 2 +- bind8/whois.cgi | 3 +-- 16 files changed, 26 insertions(+), 25 deletions(-) diff --git a/bind8/bind8-lib.pl b/bind8/bind8-lib.pl index b4a12f062..363c264ed 100755 --- a/bind8/bind8-lib.pl +++ b/bind8/bind8-lib.pl @@ -4260,5 +4260,15 @@ if (&foreign_check("virtual-server")) { return wantarray ? @rv : $rv[0]; } +# zone_subhead(&zone) +# Returns a ui_header subtitle for a zone +sub zone_subhead +{ +my ($zone) = @_; +my $desc = &ip6int_to_net(&arpa_to_ip($zone->{'name'})); +my $view = $zone->{'view'}; +return $view ? &text('master_inview', $desc, $view) : $desc; +} + 1; diff --git a/bind8/edit_delegation.cgi b/bind8/edit_delegation.cgi index 98fac782e..9c3bcadb3 100755 --- a/bind8/edit_delegation.cgi +++ b/bind8/edit_delegation.cgi @@ -16,8 +16,7 @@ my $dom = $zone->{'name'}; &can_edit_zone($zone) || &error($text{'master_ecannot'}); -my $desc = &ip6int_to_net(&arpa_to_ip($dom)); -&ui_print_header($desc, $text{'delegation_title'}, "", +&ui_print_header(&zone_subhead($zone), $text{'delegation_title'}, "", undef, undef, undef, undef, &restart_links()); print "$text{'delegation_noopts'}

\n"; diff --git a/bind8/edit_forward.cgi b/bind8/edit_forward.cgi index 802ffe448..8aa69ddf5 100755 --- a/bind8/edit_forward.cgi +++ b/bind8/edit_forward.cgi @@ -19,8 +19,7 @@ my $dom = $zone->{'name'}; $dom = $zone->{'name'}; &can_edit_zone($zone) || &error($text{'fwd_ecannot'}); -my $desc = &ip6int_to_net(&arpa_to_ip($dom)); -&ui_print_header($desc, $text{'fwd_title'}, "", +&ui_print_header(&zone_subhead($zone), $text{'fwd_title'}, "", undef, undef, undef, undef, &restart_links()); # Start of the form diff --git a/bind8/edit_master.cgi b/bind8/edit_master.cgi index 21aee5413..5741f6a42 100755 --- a/bind8/edit_master.cgi +++ b/bind8/edit_master.cgi @@ -12,8 +12,7 @@ $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'}); -my $desc = &ip6int_to_net(&arpa_to_ip($dom)); -&ui_print_header($desc, $text{'master_title'}, "", +&ui_print_header(&zone_subhead($zone), $text{'master_title'}, "", undef, undef, undef, undef, &restart_links($zone)); # Find the record types diff --git a/bind8/edit_options.cgi b/bind8/edit_options.cgi index 177f0daee..72ae19d17 100755 --- a/bind8/edit_options.cgi +++ b/bind8/edit_options.cgi @@ -16,8 +16,7 @@ my $dom = $zone->{'name'}; &error($text{'master_ecannot'}); $access{'opts'} || &error($text{'master_eoptscannot'}); -my $desc = &ip6int_to_net(&arpa_to_ip($dom)); -&ui_print_header($desc, $text{'master_opts'}, "", +&ui_print_header(&zone_subhead($zone), $text{'master_opts'}, "", undef, undef, undef, undef, &restart_links($zone)); # Start of form for editing zone options diff --git a/bind8/edit_record.cgi b/bind8/edit_record.cgi index e47048ca4..752ea7955 100755 --- a/bind8/edit_record.cgi +++ b/bind8/edit_record.cgi @@ -19,7 +19,7 @@ $rec || &error($text{'edit_egone'}); &can_edit_type($rec->{'type'}, \%access) || &error($text{'recs_ecannottype'}); -my $desc = &text('edit_header', &ip6int_to_net(&arpa_to_ip($dom))); +my $desc = &text('edit_header', &zone_subhead($zone)); &ui_print_header($desc, &text('edit_title', $text{"edit_".$rec->{'type'}} || $rec->{'type'}), "", undef, undef, undef, undef, &restart_links($zone)); diff --git a/bind8/edit_recs.cgi b/bind8/edit_recs.cgi index 81652690b..abdd72e23 100755 --- a/bind8/edit_recs.cgi +++ b/bind8/edit_recs.cgi @@ -13,7 +13,7 @@ my $dom = $zone->{'name'}; &error($text{'recs_ecannot'}); &can_edit_type($in{'type'}, \%access) || &error($text{'recs_ecannottype'}); -my $desc = &text('recs_header', &ip6int_to_net(&arpa_to_ip($dom))); +my $desc = &text('recs_header', &zone_subhead($zone)); my $typedesc = $text{"recs_$in{'type'}"} || $in{'type'}; &ui_print_header($desc, &text('recs_title', $typedesc), "", undef, undef, undef, undef, &restart_links($zone)); diff --git a/bind8/edit_slave.cgi b/bind8/edit_slave.cgi index d18e0ec8c..045efd8fc 100755 --- a/bind8/edit_slave.cgi +++ b/bind8/edit_slave.cgi @@ -14,7 +14,6 @@ my $zone = &get_zone_name_or_error($in{'zone'}, $in{'view'}); my $dom = $zone->{'name'}; &can_edit_zone($zone) || &error($text{'master_ecannot'}); -my $desc = &ip6int_to_net(&arpa_to_ip($dom)); my @st; my $lasttrans; if ($zone->{'file'}) { @@ -22,8 +21,8 @@ if ($zone->{'file'}) { $lasttrans = &text('slave_last', @st && $st[7] ? &make_date($st[9]) : $text{'slave_never'}); } -&ui_print_header($desc, $0 =~ /edit_slave/ ? $text{'slave_title'} - : $text{'stub_title'}, +&ui_print_header(&zone_subhead($zone), + $0 =~ /edit_slave/ ? $text{'slave_title'} : $text{'stub_title'}, "", undef, 0, 0, 0, &restart_links($zone), undef, undef, $lasttrans); diff --git a/bind8/edit_soa.cgi b/bind8/edit_soa.cgi index 89af334dd..d0cf80c43 100755 --- a/bind8/edit_soa.cgi +++ b/bind8/edit_soa.cgi @@ -12,8 +12,7 @@ my $dom = $zone->{'name'}; &can_edit_zone($zone) || &error($text{'master_ecannot'}); $access{'params'} || &error($text{'master_esoacannot'}); -my $desc = &ip6int_to_net(&arpa_to_ip($dom)); -&ui_print_header($desc, $text{'master_params'}, "", +&ui_print_header(&zone_subhead($zone), $text{'master_params'}, "", undef, undef, undef, undef, &restart_links($zone)); my @recs = &read_zone_file($zone->{'file'}, $dom); diff --git a/bind8/edit_soptions.cgi b/bind8/edit_soptions.cgi index 8ebeca006..c68da27dd 100755 --- a/bind8/edit_soptions.cgi +++ b/bind8/edit_soptions.cgi @@ -17,8 +17,7 @@ my $dom = $zone->{'name'}; &error($text{'master_ecannot'}); $access{'opts'} || &error($text{'slave_ecannot'}); -my $desc = &ip6int_to_net(&arpa_to_ip($dom)); -&ui_print_header($desc, $text{'master_opts'}, "", +&ui_print_header(&zone_subhead($zone), $text{'master_opts'}, "", undef, undef, undef, undef, &restart_links($zone)); # Start of the form diff --git a/bind8/edit_zonedt.cgi b/bind8/edit_zonedt.cgi index 78fe41a3a..6b85fe196 100755 --- a/bind8/edit_zonedt.cgi +++ b/bind8/edit_zonedt.cgi @@ -12,9 +12,8 @@ my $dom = $zone->{'name'}; &can_edit_zone($zone) || &error($text{'master_ecannot'}); $access{'dnssec'} || &error($text{'dnssec_ecannot'}); -my $desc = &ip6int_to_net(&arpa_to_ip($dom)); -&ui_print_header($desc, $text{'dt_zone_title'}, "", +&ui_print_header(&zone_subhead($zone), $text{'dt_zone_title'}, "", undef, undef, undef, undef, &restart_links($zone)); my $rrr; diff --git a/bind8/edit_zonekey.cgi b/bind8/edit_zonekey.cgi index 1ec9efafd..1122af4b5 100755 --- a/bind8/edit_zonekey.cgi +++ b/bind8/edit_zonekey.cgi @@ -11,9 +11,8 @@ my $dom = $zone->{'name'}; &can_edit_zone($zone) || &error($text{'master_ecannot'}); $access{'dnssec'} || &error($text{'dnssec_ecannot'}); -my $desc = &ip6int_to_net(&arpa_to_ip($dom)); -&ui_print_header($desc, $text{'zonekey_title'}, "", +&ui_print_header(&zone_subhead($zone), $text{'zonekey_title'}, "", undef, undef, undef, undef, &restart_links($zone)); # Check if the zone already has a key, from a DNSKEY record diff --git a/bind8/find_free.cgi b/bind8/find_free.cgi index decfdd620..d9074af31 100755 --- a/bind8/find_free.cgi +++ b/bind8/find_free.cgi @@ -15,7 +15,7 @@ my $file = $zone->{'file'}; my $type = $zone->{'type'}; if (!$access{'findfree'}) {&error($text{'findfree_nofind'})}; -my $desc = &text('findfree_header', &arpa_to_ip($dom)); +my $desc = &text('findfree_header', &zone_subhead($zone)); &ui_print_header($desc, &text('findfree_title'), "", undef, undef, undef, undef, &restart_links($zone)); diff --git a/bind8/lang/en b/bind8/lang/en index 31f3a5570..b21c43d70 100644 --- a/bind8/lang/en +++ b/bind8/lang/en @@ -67,6 +67,7 @@ index_eexpired_conf=Automatic signing should be re-enabled on the $1 page. index_eexpired_mod=Use the $1 module to either disable DNSSEC for these domains, or check why signing is failing. master_title=Edit Master Zone +master_inview=$1 in view $2 master_ecannot=You are not allowed to edit this zone master_egone=Zone $1 does not exist in any view master_egone2=Zone $1 does not exist! diff --git a/bind8/list_gen.cgi b/bind8/list_gen.cgi index 256f684d4..b463f75e1 100755 --- a/bind8/list_gen.cgi +++ b/bind8/list_gen.cgi @@ -14,7 +14,7 @@ my $zone = &get_zone_name_or_error($in{'zone'}, $in{'view'}); my $dom = $zone->{'name'}; &can_edit_zone($zone) || &error($text{'master_ecannot'}); -my $desc = &text('recs_header', &ip6int_to_net(&arpa_to_ip($dom))); +my $desc = &text('recs_header', &zone_subhead($zone)); &ui_print_header($desc, $text{'gen_title'}, "", undef, undef, undef, undef, &restart_links($zone)); diff --git a/bind8/whois.cgi b/bind8/whois.cgi index 2f8572edf..7b6f9219b 100755 --- a/bind8/whois.cgi +++ b/bind8/whois.cgi @@ -15,8 +15,7 @@ my $dom = $zone->{'name'}; my $tv = $zone->{'type'}; $dom =~ s/\.$//; -my $desc = &ip6int_to_net(&arpa_to_ip($dom)); -&ui_print_header($desc, $text{'whois_title'}, "", +&ui_print_header(&zone_subhead($zone), $text{'whois_title'}, "", undef, undef, undef, undef, &restart_links($zone)); my $qdom = quotemeta($dom);