Changeset 436 for trunk


Ignore:
Timestamp:
10/30/12 12:18:50 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix bug in AXFR import (couldn't import as inactive)
Extend AXFR import to allow overriding TTLs. Note this is all-or-nothing.

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/DNSDB.pm

    r429 r436  
    41584158  my $zone = shift;
    41594159  my $group = shift;
    4160   my $status = shift || 1;
     4160  my $status = shift;
     4161  $status = (defined($status) ? $status : 0);   # force sane semantics, and allow passing "null" (inactive) status
    41614162  my $rwsoa = shift || 0;
    41624163  my $rwns = shift || 0;
     4164  my $newttl = shift;
    41634165  my $merge = shift || 0;       # do we attempt to merge A/AAAA and PTR records whenever possible?
    41644166                                # do we overload this with the fixme below?
     
    43164318      my $type = $rr->type;
    43174319      my $host = $rr->name;
    4318       my $ttl = $rr->ttl;
     4320      my $ttl = ($newttl ? $newttl : $rr->ttl); # allow force-override TTLs
    43194321
    43204322      $soaflag = 1 if $type eq 'SOA';
  • trunk/dns.cgi

    r431 r436  
    15421542  $page->param(rwsoa => $webvar{rwsoa}) if $webvar{rwsoa};
    15431543  $page->param(rwns => $webvar{rwns}) if $webvar{rwns};
     1544  $page->param(forcettl => $webvar{forcettl}) if $webvar{forcettl};
     1545  $page->param(newttl => $webvar{newttl}) if $webvar{newttl};
    15441546  # This next one is arguably better on by default, but Breaking Things Is Bad, Mmmkay?
    15451547  $page->param(mergematching => $webvar{mergematching}) if $webvar{mergematching};
     
    15691571      my %row;
    15701572      my ($code,$msg) = importAXFR($dbh, $webvar{ifrom}, $domain, $webvar{group},
    1571         $webvar{zonestatus}, $webvar{rwsoa}, $webvar{rwns}, $webvar{mergematching});
     1573        $webvar{domactive}, $webvar{rwsoa}, $webvar{rwns}, ($webvar{forcettl} ? $webvar{newttl} : 0),
     1574        $webvar{mergematching});
    15721575      $row{domok} = $msg if $code eq 'OK';
    15731576      if ($code eq 'WARN') {
  • trunk/templates/axfr.tmpl

    r308 r436  
    3333        <td>Rewrite NS to group default?</td>
    3434        <td><input type="checkbox" name="rwns"<TMPL_IF rwns> checked="checked"</TMPL_IF> /></td>
     35</tr>
     36<tr class="datalinelight">
     37        <td>Force all TTLs to new value?</td>
     38        <td><input type="checkbox" name="forcettl"<TMPL_IF forcettl> checked="checked"</TMPL_IF> /><input name="newttl" size="7"<TMPL_IF newttl> value="<TMPL_VAR NAME=newttl>"</TMPL_IF> /></td>
    3539</tr>
    3640<tr class="datalinelight">
Note: See TracChangeset for help on using the changeset viewer.