Changeset 543 for trunk/dns-rpc.cgi


Ignore:
Timestamp:
12/10/13 16:22:10 (10 years ago)
Author:
Kris Deugau
Message:

/trunk

Implement most of the UI and back end for handling scheduled changes
to records. See #40.

This turned out to be most of what I had vaguely imagined; only SOA
records can't sanely be set for scheduled changes yet (can't think of
a scenario where this would even be useful) and there's only a small
dusting of UI chrome left for another time.

Bumped up from projected 1.4 to 1.2 per request from Reid Sutherland.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns-rpc.cgi

    r516 r543  
    475475
    476476  my @recargs = ($args{defrec}, $args{revrec}, $args{parent_id},
    477         \$args{name}, \$args{type}, \$args{address}, $args{ttl}, $args{location});
     477        \$args{name}, \$args{type}, \$args{address}, $args{ttl}, $args{location},
     478        $args{expires}, $args{stamp});
    478479  if ($args{type} == $DNSDB::reverse_typemap{MX} or $args{type} == $DNSDB::reverse_typemap{SRV}) {
    479480    push @recargs, $args{distance};
     
    497498  _reccheck(\%args);
    498499
     500  # put some caller-friendly names in their rightful DB column places
     501  $args{val} = $args{address};
     502  $args{host} = $args{name};
     503
    499504  # get old line, so we can update only the bits that the caller passed to change
    500   # note we subbed address for val since it's a little more caller-friendly
    501505  my $oldrec = $dnsdb->getRecLine($args{defrec}, $args{revrec}, $args{id});
    502   foreach my $field (qw(name type address ttl location distance weight port)) {
     506  foreach my $field (qw(host type val ttl location expires distance weight port)) {
    503507    $args{$field} = $oldrec->{$field} if !$args{$field} && defined($oldrec->{$field});
    504508  }
     509  # stamp has special handling when blank or 0.  "undefined" from the caller should mean "don't change"
     510  $args{stamp} = $oldrec->{stamp} if !defined($args{stamp}) && defined($oldrec->{stamp});
    505511
    506512  # allow passing text types rather than DNS integer IDs
     
    510516  # parent_id is the "primary" zone we're updating;  necessary for forward/reverse voodoo
    511517  my ($code, $msg) = $dnsdb->updateRec($args{defrec}, $args{revrec}, $args{id}, $args{parent_id},
    512         \$args{name}, \$args{type}, \$args{address}, $args{ttl}, $args{location},
     518        \$args{host}, \$args{type}, \$args{val}, $args{ttl}, $args{location},
     519        $args{expires}, $args{stamp},
    513520        $args{distance}, $args{weight}, $args{port});
    514521
Note: See TracChangeset for help on using the changeset viewer.