Changeset 287
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 -
trunk/dns.cgi
r286 r287 677 677 678 678 if ($code eq 'OK' || $code eq 'WARN') { 679 my $restr;680 if ($webvar{defrec} eq 'y') {681 $restr = "Added default record '$webvar{name} $typemap{$webvar{type}}";682 $restr .= " [distance $webvar{distance}]" if $typemap{$webvar{type}} eq 'MX';683 $restr .= " [priority $webvar{distance}] [weight $webvar{weight}] [port $webvar{port}]"684 if $typemap{$webvar{type}} eq 'SRV';685 $restr .= " $webvar{address}', TTL $webvar{ttl}";686 logaction(0, $session->param("username"), $webvar{parentid}, $restr);687 } else {688 $restr = "Added record '$webvar{name} $typemap{$webvar{type}}";689 $restr .= " [distance $webvar{distance}]" if $typemap{$webvar{type}} eq 'MX';690 $restr .= " [priority $webvar{distance}] [weight $webvar{weight}] [port $webvar{port}]"691 if $typemap{$webvar{type}} eq 'SRV';692 $restr .= " $webvar{address}', TTL $webvar{ttl}";693 logaction($webvar{parentid}, $session->param("username"),694 parentID($dbh, (id => $webvar{parentid}, type => 'domain', revrec => $webvar{revrec})), $restr);695 }696 679 my %pageparams = (page => "reclist", id => $webvar{parentid}, 697 680 defrec => $webvar{defrec}, revrec => $webvar{revrec}); 698 $pageparams{warnmsg} = $msg."<br><br>\n".$ restr if $code eq 'WARN';699 $pageparams{resultmsg} = $ restr if $code eq 'OK';681 $pageparams{warnmsg} = $msg."<br><br>\n".$DNSDB::resultstr if $code eq 'WARN'; 682 $pageparams{resultmsg} = $DNSDB::resultstr if $code eq 'OK'; 700 683 changepage(%pageparams); 701 684 } else {
Note:
See TracChangeset
for help on using the changeset viewer.