Changeset 543 for trunk/dns.cgi


Ignore:
Timestamp:
12/10/13 16:22:10 (11 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.cgi

    r533 r543  
    3030use Net::DNS;
    3131use DBI;
     32
    3233use Data::Dumper;
    3334
     
    721722
    722723    my @recargs = ($webvar{defrec}, $webvar{revrec}, $webvar{parentid},
    723         \$webvar{name}, \$webvar{type}, \$webvar{address}, $webvar{ttl}, $webvar{location});
     724        \$webvar{name}, \$webvar{type}, \$webvar{address}, $webvar{ttl}, $webvar{location},
     725        $webvar{expires}, $webvar{stamp});
    724726    if ($webvar{type} == $reverse_typemap{MX} or $webvar{type} == $reverse_typemap{SRV}) {
    725727      push @recargs, $webvar{distance};
     
    769771    $page->param(ttl            => $recdata->{ttl});
    770772    $page->param(typelist       => $dnsdb->getTypelist($webvar{revrec}, $recdata->{type}));
    771 
     773    if ($recdata->{stampactive}) {
     774      $page->param(stamp => $recdata->{stamp});
     775      $page->param(stamp_until => $recdata->{expires});
     776    }
    772777    if ($webvar{defrec} eq 'n') {
    773778      fill_loclist($curgroup, $recdata->{location});
     
    785790    my ($code,$msg) = $dnsdb->updateRec($webvar{defrec}, $webvar{revrec}, $webvar{id}, $webvar{parentid},
    786791        \$webvar{name}, \$webvar{type}, \$webvar{address}, $webvar{ttl}, $webvar{location},
     792        $webvar{expires}, $webvar{stamp},
    787793        $webvar{distance}, $webvar{weight}, $webvar{port});
    788794
     
    20022008    $rec->{record_delete} = ($permissions{admin} || $permissions{record_delete});
    20032009    $rec->{locname} = '' unless ($permissions{admin} || $permissions{location_view});
     2010# Timestamps
     2011    if ($rec->{expires}) {
     2012      $rec->{stamptype} = $rec->{ispast} ? 'expired at' : 'expires at';
     2013    } else {
     2014      $rec->{stamptype} = 'valid after';
     2015    }
     2016    # strip seconds and timezone?  no, not yet.  could probably offer a config knob on this display at some point.
     2017#    $rec->{stamp} =~ s/:\d\d-\d+$//;
     2018    delete $rec->{expires};
     2019    delete $rec->{ispast};
    20042020  }
    20052021  $page->param(reclist => $foo2);
     
    20322048  my $soa = $dnsdb->getSOA($webvar{defrec}, $webvar{revrec}, $webvar{parentid});
    20332049  $page->param(ttl      => ($webvar{ttl} ? $webvar{ttl} : $soa->{minttl}));
     2050  $page->param(stamp_until => ($webvar{expires} eq 'until'));
     2051  $page->param(stamp => $webvar{stamp});
    20342052}
    20352053
Note: See TracChangeset for help on using the changeset viewer.