Changeset 452 for trunk/dns-rpc.cgi
- Timestamp:
- 01/11/13 12:21:13 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns-rpc.cgi
r447 r452 64 64 'dnsdb.updateRec' => \&updateRec, 65 65 'dnsdb.delRec' => \&delRec, 66 #sub getLogCount {} 67 #sub getLogEntries {} 68 'dnsdb.getRevPattern' => \&getRevPattern, 66 69 'dnsdb.zoneStatus' => \&zoneStatus, 70 'dnsdb.getZonesByCIDR' => \&getZonesByCIDR, 67 71 68 72 'dnsdb.getMethods' => \&get_method_list … … 371 375 } 372 376 377 # callers may often not care about TTLs 378 if (!$args{ttl}) { 379 my $tmp = DNSDB::getSOA($dbh, $args{defrec}, $args{revrec}, $args{parent_id}); 380 $args{ttl} = $tmp->{minttl}; 381 } 382 373 383 my @recargs = ($dbh, $args{defrec}, $args{revrec}, $args{parent_id}, 374 384 \$args{name}, \$args{type}, \$args{address}, $args{ttl}, $args{location}); … … 392 402 _commoncheck(\%args, 'y'); 393 403 404 # get old line, so we can update only the bits that the caller passed to change 405 # note we subbed address for val since it's a little more caller-friendly 406 my $oldrec = DNSDB::getRecLine($dbh, $args{defrec}, $args{revrec}, $args{id}); 407 foreach my $field (qw(name type address ttl location distance weight port)) { 408 $args{$field} = $oldrec->{$field} if !$args{$field} && defined($oldrec->{$field}); 409 } 410 394 411 # note dist, weight, port are not required on all types; will be ignored if not needed. 395 412 # parent_id is the "primary" zone we're updating; necessary for forward/reverse voodoo … … 415 432 #sub getLogCount {} 416 433 #sub getLogEntries {} 434 435 sub getRevPattern { 436 my %args = @_; 437 438 _commoncheck(\%args, 'y'); 439 440 return DNSDB::getRevPattern($dbh, $args{cidr}, $args{group}); 441 } 442 417 443 #sub getTypelist {} 418 444 #sub parentID {} … … 428 454 429 455 my $status = DNSDB::zoneStatus(@arglist); 456 } 457 458 # Get a list of hashes referencing the reverse zone(s) for a passed CIDR block 459 sub getZonesByCIDR { 460 my %args = @_; 461 462 _commoncheck(\%args, 'y'); 463 464 return DNSDB::getZonesByCIDR($dbh, %args); 430 465 } 431 466
Note:
See TracChangeset
for help on using the changeset viewer.