Changeset 583 for trunk/dns.cgi


Ignore:
Timestamp:
01/03/14 14:58:09 (11 years ago)
Author:
Kris Deugau
Message:

/trunk

Revise and extend the showrec_arpa_ns hack to optionally cover all
displayed zone names, all displayed records, or both

May still need a little more fixing for complete coverage.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r581 r583  
    20042004
    20052005  foreach my $rec (@$foo2) {
    2006     # NS records.  Need to do this first before we convert the type-value to the text representation
    2007     if ($rev eq 'y' && $dnsdb->{showrec_arpa_ns} && $rec->{type} == $reverse_typemap{NS}) {
    2008       my $tmp = new NetAddr::IP $rec->{val};
    2009       $rec->{val} = DNSDB::_ZONE($tmp, 'ZONE', 'r', '.').($tmp->{isv6} ? '.ip6.arpa' : '.in-addr.arpa');
    2010     }
    20112006    $rec->{type} = $typemap{$rec->{type}};
    20122007    $rec->{fwdzone} = $rev eq 'n';
     
    20342029
    20352030sub fill_recdata {
    2036   $page->param(typelist => $dnsdb->getTypelist($webvar{revrec}, $webvar{type}));
    2037 
    2038 # le sigh.  we may get called with many empty %webvar keys
     2031  # le sigh.  we may get called with many empty %webvar keys
    20392032  no warnings qw( uninitialized );
    20402033
     
    20422035# prefill <domain> or DOMAIN in "Host" space for new records
    20432036  if ($webvar{revrec} eq 'n') {
     2037    $page->param(typelist => $dnsdb->getTypelist($webvar{revrec}, $webvar{type}));
    20442038    my $domroot = ($webvar{defrec} eq 'y' ? 'DOMAIN' : $dnsdb->domainName($webvar{parentid}));
    20452039    $page->param(name   => ($webvar{name} ? $webvar{name} : $domroot));
     
    20522046    my $domroot = ($webvar{defrec} eq 'y' ? 'ADMINDOMAIN' : ".$dnsdb->{domain}");
    20532047    $page->param(name   => ($webvar{name} ? $webvar{name} : $domroot));
    2054     my $zname = ($webvar{defrec} eq 'y' ? 'ZONE' : $dnsdb->revName($webvar{parentid}));
     2048    my $zname = ($webvar{defrec} eq 'y' ? 'ZONE' : $dnsdb->revName($webvar{parentid}, 'y'));
     2049    my $cidr = new NetAddr::IP $zname;
    20552050    $zname =~ s|\d*/\d+$||;
    20562051    $page->param(address        => ($webvar{address} ? $webvar{address} : $zname));
     2052    $page->param(typelist => $dnsdb->getTypelist($webvar{revrec},
     2053        $webvar{type} || ($cidr->{isv6} ? $reverse_typemap{'AAAA+PTR'} : $reverse_typemap{'A+PTR'})));
    20572054  }
    20582055# retrieve the right ttl instead of falling (way) back to the hardcoded system default
     
    21832180        );
    21842181# probably don't need this, keeping for reference for now
    2185 #  foreach (@$zonelist) {
     2182#  foreach my $rec (@$zonelist) {
    21862183#  }
    21872184  $page->param(domtable => $zonelist);
Note: See TracChangeset for help on using the changeset viewer.