Changeset 851 for trunk/cgi-bin/main.cgi


Ignore:
Timestamp:
04/13/16 18:16:46 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Update syslog and mailNotify() calls to better match the new data
structures, and normalize their formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/main.cgi

    r839 r851  
    13171317
    13181318  if ($code eq 'FAIL') {
    1319     syslog "err", "$authuser could not update block/IP '$binfo->{block}' (id $webvar{block}): '$msg'";
     1319    syslog "err", "$authuser could not update block/IP $webvar{block} ($binfo->{block}): '$msg'";
    13201320    $page->param(err => "Could not update block/IP $binfo->{block}: $msg");
    13211321    return;
     
    13231323
    13241324  # If we get here, the operation succeeded.
    1325   syslog "notice", "$authuser updated $binfo->{block}";
     1325  syslog "notice", "$authuser updated $webvar{block} ($binfo->{block})";
    13261326##fixme:  log details of the change?  old way is in the .debug stream anyway.
    13271327##fixme:  need to wedge something in to allow "update:field" notifications
     
    17251725  }
    17261726  if ($code eq 'OK' || $code =~ /^WARN/) {
    1727     syslog "notice", "$authuser deallocated '".$blockinfo->{type}."'-type netblock $webvar{block} ".
    1728         $blockinfo->{custid}.", ".$blockinfo->{city}.", desc='".$blockinfo->{description}."'";
    1729     mailNotify($ip_dbh, 'da', "REMOVED: ".$disp_alloctypes{$blockinfo->{type}}." $webvar{block}",
    1730         $disp_alloctypes{$blockinfo->{type}}." $webvar{block} deallocated by $authuser\n".
    1731         "CustID: ".$blockinfo->{custid}."\nCity: ".$blockinfo->{city}.
    1732         "\nDescription: ".$blockinfo->{description}."\n");
     1727    syslog "notice", "$authuser deallocated '".$blockinfo->{type}."'-type netblock ID $webvar{block} ".
     1728        "($blockinfo->{block}), $blockinfo->{custid}, $blockinfo->{city}, desc='$blockinfo->{description}'";
     1729    mailNotify($ip_dbh, 'da', "REMOVED: $disp_alloctypes{$blockinfo->{type}} $blockinfo->{block}",
     1730# $webvar{block} useful?  do we care about the block ID here?
     1731        "$disp_alloctypes{$blockinfo->{type}} $blockinfo->{block} deallocated by $authuser\n".
     1732        "CustID: $blockinfo->{custid}\nCity: $blockinfo->{city}\n".
     1733        "Description: $blockinfo->{description}\n");
    17331734  } else {
    17341735    $page->param(failmsg => $msg);
    17351736    if ($webvar{alloctype} =~ /^.i$/) {
    1736       syslog "err", "$authuser could not deallocate static IP '$webvar{block}': '$msg'";
     1737      syslog "err", "$authuser could not deallocate static IP $webvar{block} ($blockinfo->{block}): '$msg'";
    17371738    } else {
    1738       syslog "err", "$authuser could not deallocate netblock '$webvar{block}': '$msg'";
     1739      syslog "err", "$authuser could not deallocate netblock $webvar{block} ($blockinfo->{block}): '$msg'";
    17391740      $page->param(netblock => 1);
    17401741    }
Note: See TracChangeset for help on using the changeset viewer.