#!/usr/local/bin/perl # edit_master.cgi # Display a form for editing a master domain require './dns-lib.pl'; &ReadParse(); $conf = &get_config(); $zconf = $conf->[$in{'index'}]; $dom = $zconf->{'values'}->[0]; %access = &get_module_acl(); &can_edit_zone(\%access, $dom) || &error("You are not allowed to edit this zone"); &header("Edit Master Zone", ""); print "
\n"; @recs = &read_zone_file($zconf->{'values'}->[1], $dom); if ($dom =~ /in-addr.arpa/i) { @rcodes = ("PTR", "NS"); } else { @rcodes = ("A", "NS", "CNAME", "MX", "HINFO", "TXT", "WKS", "RP"); } foreach $c (@rcodes) { $rnum{$c} = 0; } foreach $r (@recs) { $rnum{$r->{'type'}}++; if ($r->{'type'} eq "SOA") { $soa = $r; } } if ($config{'show_list'}) { # display as list $mid = int((@rcodes+1)/2); print "
\n"; &types_table(@rcodes[0..$mid-1]); print " | \n"; &types_table(@rcodes[$mid..$#rcodes]); print " |