3 # Display records of some type from some domain
5 require './dns-lib.pl';
8 $zconf = $conf->[$in{'index'}];
9 $dom = $zconf->{'values'}->[0];
10 %access = &get_module_acl();
11 &can_edit_zone(\%access, $dom) ||
12 &error("You are not allowed to edit records in this zone");
13 &header("$code_map{$in{'type'}} Records", "");
14 print "<center><font size=+2>In ",&arpa_to_ip($dom),"</font></center>\n";
17 $file = $zconf->{'values'}->[1];
18 &foreign_call("bind8", "record_input", $in{'index'}, undef, $in{'type'}, $file, $dom);
19 @recs = &read_zone_file($file, $dom);
20 @recs = grep { $_->{'type'} eq $in{'type'} } @recs;
22 @recs = &sort_records(@recs);
23 %hmap = ( "A", [ "Address" ],
24 "NS", [ "Name Server" ],
25 "CNAME", [ "Real Name" ],
26 "MX", [ "Priority", "Mail Server" ],
27 "HINFO", [ "Hardware", "Operating System" ],
29 "WKS", [ "Address", "Protocol", "Service" ],
30 "RP", [ "Email Address", "Text Record" ],
31 "PTR", [ "Hostname" ] );
32 if ($in{'type'} =~ /HINFO|WKS|RP/) {
36 $mid = int((@recs+1)/2);
37 print "<table width=100%><tr><td width=50% valign=top>\n";
38 &recs_table(@recs[0 .. $mid-1]);
39 print "</td><td width=50% valign=top>\n";
40 if ($mid < @recs) { &recs_table(@recs[$mid .. $#recs]); }
41 print "</td></tr></table><p>\n";
46 &footer("edit_master.cgi?index=$in{'index'}", "record types");
50 print "<table border width=100%>\n";
51 print "<tr $tb> <td><b>",$in{'type'} eq "PTR" ? "Address" : "Name",
52 "</b></td> <td><b>TTL</b></td>\n";
53 @hmap = @{$hmap{$in{'type'}}};
55 print "<td><b>$h</b></td>\n";
58 for($i=0; $i<@_; $i++) {
60 $name = &html_escape($in{'type'} eq "PTR" ? &arpa_to_ip($r->{'name'})
62 print "<tr $cb> <td><a href=\"edit_record.cgi?index=",
63 "$in{'index'}&type=$in{'type'}&num=$r->{'num'}\">$name",
65 print "<td>",$r->{'ttl'} ? $r->{'ttl'} : "Default","</td>\n";
66 for($j=0; $j<@hmap; $j++) {
67 print "<td>",&html_escape($r->{'values'}->[$j]),"</td>\n";