Changeset 101 for trunk/dns.cgi


Ignore:
Timestamp:
07/06/11 17:17:46 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

dns.cgi:

Prefill <domain> or DOMAIN in Hostname field on add record page
Set initial TTL correctly based on SOA record rather than hardcoded defaults

DNSDB.pm:

Tweak retrieval code to pull SOA's serial from distance field

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r98 r101  
    3737
    3838my @debugbits;  # temp, to be spit out near the end of processing
    39 my $debugenv = 1;
     39my $debugenv = 0;
    4040
    4141# Let's do these templates right...
     
    12691269  no warnings qw( uninitialized );
    12701270
    1271   $page->param(name     => $webvar{name});
     1271##todo:  allow BIND-style bare names, ASS-U-ME that the name is within the domain?
     1272# prefill <domain> or DOMAIN in "Host" space for new records
     1273  my $domroot = ($webvar{defrec} eq 'y' ? 'DOMAIN' : domainName($dbh,$webvar{parentid}));
     1274  $page->param(name     => $domroot);
    12721275  $page->param(address  => $webvar{address});
    12731276  $page->param(distance => $webvar{distance})
     
    12751278  $page->param(weight   => $webvar{weight}) if $webvar{type} == $reverse_typemap{SRV};
    12761279  $page->param(port     => $webvar{port}) if $webvar{type} == $reverse_typemap{SRV};
    1277   $page->param(ttl      => ($webvar{ttl} ? $webvar{ttl} : $DNSDB::def{minttl}));
     1280# retrieve the right ttl instead of falling (way) back to the hardcoded system default
     1281  my %soa = getSOA($dbh,$webvar{defrec},$webvar{parentid});
     1282  $page->param(ttl      => ($webvar{ttl} ? $webvar{ttl} : $soa{minttl}));
    12781283}
    12791284
     
    16771682
    16781683##fixme: push SQL into DNSDB.pm
     1684##fixme: add bits to retrieve group/domain name info to retain after entity is deleted?
    16791685  my $sth = $dbh->prepare("SELECT user_id, firstname || ' ' || lastname FROM users WHERE username=?");
    16801686  $sth->execute($username);
Note: See TracChangeset for help on using the changeset viewer.