Changeset 242 for trunk/dns.cgi


Ignore:
Timestamp:
02/23/12 17:54:48 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix buglet that snuck back into A/AAAA+PTR add - domain ID was
not added field list or bind-values array. See #26.
Log entry update: Accidentally committed cleanups on fill_recdata
and several parts of the record page:

  • Fill in suitable starting points for domain name and IP address on adding reverse records, same as forward records start with the base domain name
  • Fix SOA retrieval for default TTL
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r239 r242  
    598598      $page->param(fwdzone      => $webvar{revrec} eq 'n');
    599599      fill_recdata();   # populate the form... er, mostly.
    600       $page->param(name => $webvar{name});
    601600      if ($config{log_failures}) {
    602601        if ($webvar{defrec} eq 'y') {
     
    684683  } else {
    685684    $page->param(parentid => $webvar{parentid});
    686     $page->param(dohere => domainName($dbh,$webvar{parentid}));
     685    $page->param(dohere => domainName($dbh,$webvar{parentid})) if $webvar{revrec} eq 'n';
     686    $page->param(dohere => revName($dbh,$webvar{parentid})) if $webvar{revrec} eq 'y';
    687687  }
    688688
     
    18121812##todo:  allow BIND-style bare names, ASS-U-ME that the name is within the domain?
    18131813# prefill <domain> or DOMAIN in "Host" space for new records
    1814   my $domroot = ($webvar{defrec} eq 'y' ? 'DOMAIN' : domainName($dbh,$webvar{parentid}));
    1815   $page->param(name     => $domroot);
    1816   $page->param(address  => $webvar{address});
    1817   $page->param(distance => $webvar{distance})
     1814  if ($webvar{revrec} eq 'n') {
     1815    my $domroot = ($webvar{defrec} eq 'y' ? 'DOMAIN' : domainName($dbh,$webvar{parentid}));
     1816    $page->param(name   => $domroot);
     1817    $page->param(address        => $webvar{address});
     1818    $page->param(distance       => $webvar{distance})
    18181819        if ($webvar{type} == $reverse_typemap{MX} or $webvar{type} == $reverse_typemap{SRV});
    1819   $page->param(weight   => $webvar{weight}) if $webvar{type} == $reverse_typemap{SRV};
    1820   $page->param(port     => $webvar{port}) if $webvar{type} == $reverse_typemap{SRV};
     1820    $page->param(weight => $webvar{weight}) if $webvar{type} == $reverse_typemap{SRV};
     1821    $page->param(port   => $webvar{port}) if $webvar{type} == $reverse_typemap{SRV};
     1822  } else {
     1823    my $domroot = ($webvar{defrec} eq 'y' ? 'ADMINDOMAIN' : ".$config{domain}");
     1824    $page->param(name   => ($webvar{name} ? $webvar{name} : $domroot));
     1825    my $zname = ($webvar{defrec} eq 'y' ? 'ZONE' : revName($dbh,$webvar{parentid}));
     1826    $zname =~ s|\d*/\d+$||;
     1827    $page->param(address        => ($webvar{address} ? $webvar{address} : $zname));
     1828  }
    18211829# retrieve the right ttl instead of falling (way) back to the hardcoded system default
    1822   my %soa = getSOA($dbh,$webvar{defrec},$webvar{parentid});
     1830  my %soa = getSOA($dbh,$webvar{defrec},$webvar{revrec},$webvar{parentid});
    18231831  $page->param(ttl      => ($webvar{ttl} ? $webvar{ttl} : $soa{minttl}));
    18241832}
Note: See TracChangeset for help on using the changeset viewer.