Changeset 288 for trunk/dns.cgi


Ignore:
Timestamp:
03/26/12 18:06:09 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Move action logging for updateRec() into DNSDB.pm.
Fix lurking bug in update that reset distance/weight/port to 0
Rearrange log/resultstring entry in addRec() for more consistent
order of fields, also to match ordering in updateRec()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r287 r288  
    738738
    739739    if ($code eq 'OK' || $code eq 'WARN') {
    740       my $restr;
    741       if ($webvar{defrec} eq 'y') {
    742         $restr = "Updated default record from '$oldrec->{host} $typemap{$oldrec->{type}} $oldrec->{val}', TTL $oldrec->{ttl}\n".
    743                 "to '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl}";
    744         logaction(0, $session->param("username"), $webvar{parentid}, $restr);
    745       } else {
    746         $restr = "Updated record from '$oldrec->{host} $typemap{$oldrec->{type}} $oldrec->{val}', TTL $oldrec->{ttl}\n".
    747                 "to '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl}";
    748         logaction($webvar{parentid}, $session->param("username"),
    749                 parentID($dbh, (id => $webvar{id}, type => 'record', defrec => $webvar{defrec},
    750                         revrec => $webvar{revrec}, partype => 'group')),
    751                 $restr);
    752       }
    753       changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec},
    754         revrec => $webvar{revrec}, resultmsg => $restr, warnmsg => ($code ne 'OK' ? $msg : ''));
     740      my %pageparams = (page => "reclist", id => $webvar{parentid},
     741        defrec => $webvar{defrec}, revrec => $webvar{revrec});
     742      $pageparams{warnmsg} = $msg."<br><br>\n".$DNSDB::resultstr if $code eq 'WARN';
     743      $pageparams{resultmsg} = $DNSDB::resultstr if $code eq 'OK';
     744      changepage(%pageparams);
    755745    } else {
    756746      $page->param(failed       => 1);
Note: See TracChangeset for help on using the changeset viewer.