Changeset 287 for trunk/DNSDB.pm
- Timestamp:
- 03/26/12 16:59:08 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r286 r287 2502 2502 my $vallen = '?'.(',?'x$#vallist); 2503 2503 2504 # Put together the success log entry. We have to use this horrible kludge 2505 # because domain_id and rdns_id may or may not be present, and if they are, 2506 # they're not at a guaranteed consistent index in the array. wheee! 2507 my %logdata; 2508 my @ftmp = split /,/, $fields; 2509 for (my $i=0; $i <= $#vallist; $i++) { 2510 $logdata{domain_id} = $vallist[$i] if $ftmp[$i] eq 'domain_id'; 2511 $logdata{rdns_id} = $vallist[$i] if $ftmp[$i] eq 'rdns_id'; 2512 } 2513 $logdata{group_id} = $id if $defrec eq 'y'; 2514 $logdata{group_id} = parentID($dbh, 2515 (id => $id, type => ($revrec eq 'n' ? 'domain' : 'revzone'), revrec => $revrec) ) 2516 if $defrec eq 'n'; 2517 $logdata{entry} = "Added ".($defrec eq 'y' ? 'default record' : 'record')." '$$host $typemap{$$rectype}"; 2518 $logdata{entry} .= " [distance $dist]" if $typemap{$$rectype} eq 'MX'; 2519 $logdata{entry} .= " [priority $dist] [weight $weight] [port $port]" 2520 if $typemap{$$rectype} eq 'SRV'; 2521 $logdata{entry} .= " $$val', TTL $ttl"; 2522 2504 2523 # Allow transactions, and raise an exception on errors so we can catch it later. 2505 2524 # Use local to make sure these get "reset" properly on exiting this block … … 2510 2529 $dbh->do("INSERT INTO "._rectable($defrec, $revrec)." ($fields) VALUES ($vallen)", 2511 2530 undef, @vallist); 2531 _log($dbh, %logdata); 2512 2532 $dbh->commit; 2513 2533 }; … … 2518 2538 } 2519 2539 2540 $resultstr = $logdata{entry}; 2520 2541 return ($retcode, $retmsg); 2521 2542
Note:
See TracChangeset
for help on using the changeset viewer.