Changeset 286 for trunk/dns.cgi


Ignore:
Timestamp:
03/23/12 13:25:45 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Convert action logging for "Add reverse zone" to DNSDB-internal. See #35

  • don't pass userdata, either in the upstream caller (dns.cgi) or internally to _log()
  • don't expect userdata to be passed in

Fix up some warning-message-propagation in addRDNS()
Remove domain_id from addDomain() failure logging; if the domain wasn't
added then the log can't usefully refer to it by domain ID.
File off stale ##fixme's on reclist page
Fine-tune handling of message parameters in changepage(); if we're
going to go to the effort of converting newlines to <br> we should
use the result.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r285 r286  
    489489
    490490  my ($code,$msg) = addRDNS($dbh, $webvar{revzone}, $webvar{revpatt}, $webvar{group},
    491         ($webvar{makeactive} eq 'on' ? 1 : 0),
    492         (username => $session->param("username"), id => $session->param("uid")) );
     491        ($webvar{makeactive} eq 'on' ? 1 : 0));
    493492
    494493  if ($code eq 'OK') {
    495     logaction(0, $session->param("username"), $webvar{group}, "Added reverse zone $webvar{revzone}", $msg);
    496494    changepage(page => "reclist", id => $msg, revrec => 'y');
     495  } elsif ($code eq 'WARN') {
     496    changepage(page => "reclist", id => $msg, revrec => 'y', warnmsg => $DNSDB::resultstr);
    497497  } else {
    498     logaction(0, $session->param("username"), $webvar{group}, "Failed adding reverse zone $webvar{revzone} ($msg)");
    499498    $session->param('add_failed', 1);
    500499    changepage(page => "newrevzone", revzone => $webvar{revzone}, revpatt => $webvar{revpatt}, errmsg => $msg);
     
    602601    showzone($webvar{defrec}, $webvar{revrec}, $webvar{id});
    603602    if ($webvar{defrec} eq 'n') {
    604 #      showzone('n',$webvar{id});
    605 ##fixme:  permission for viewing logs?
    606 ##fixme:  determine which slice of the log we view (group, domain, revzone)
    607603      if ($webvar{revrec} eq 'n') {
    608604        $page->param(logdom => 1);
     
    18681864  foreach my $sessme ('resultmsg','warnmsg','errmsg') {
    18691865    if (my $tmp = $params{$sessme}) {
     1866      $tmp =~ s/^\n//;
    18701867      $tmp =~ s|\n|<br />\n|g;
    1871       $session->param($sessme, $params{$sessme});
     1868      $session->param($sessme, $tmp);
    18721869      delete $params{$sessme};
    18731870    }
Note: See TracChangeset for help on using the changeset viewer.