Changeset 543 for trunk/dns-rpc.cgi
- Timestamp:
- 12/10/13 16:22:10 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns-rpc.cgi
r516 r543 475 475 476 476 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}); 478 479 if ($args{type} == $DNSDB::reverse_typemap{MX} or $args{type} == $DNSDB::reverse_typemap{SRV}) { 479 480 push @recargs, $args{distance}; … … 497 498 _reccheck(\%args); 498 499 500 # put some caller-friendly names in their rightful DB column places 501 $args{val} = $args{address}; 502 $args{host} = $args{name}; 503 499 504 # 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-friendly501 505 my $oldrec = $dnsdb->getRecLine($args{defrec}, $args{revrec}, $args{id}); 502 foreach my $field (qw( name type address ttl locationdistance weight port)) {506 foreach my $field (qw(host type val ttl location expires distance weight port)) { 503 507 $args{$field} = $oldrec->{$field} if !$args{$field} && defined($oldrec->{$field}); 504 508 } 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}); 505 511 506 512 # allow passing text types rather than DNS integer IDs … … 510 516 # parent_id is the "primary" zone we're updating; necessary for forward/reverse voodoo 511 517 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}, 513 520 $args{distance}, $args{weight}, $args{port}); 514 521
Note:
See TracChangeset
for help on using the changeset viewer.