Changeset 151 for trunk/dns.cgi


Ignore:
Timestamp:
10/20/11 18:15:32 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Add/update/delete record now produces the same consistent nifty
green-bordered box confirming that the action was successful.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r148 r151  
    358358    }
    359359
     360    $page->param(resultmsg => $webvar{resultmsg}) if $webvar{resultmsg};
    360361    $page->param(errmsg => $webvar{errmsg}) if $webvar{errmsg};
    361362
     
    394395    if ($code eq 'OK') {
    395396      if ($webvar{defrec} eq 'y') {
    396         logaction(0, $session->param("username"), $webvar{parentid},
    397                 "Added default record '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl}");
     397        my $restr = "Added default record '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl}";
     398        logaction(0, $session->param("username"), $webvar{parentid}, $restr);
     399        changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, resultmsg => $restr);
    398400      } else {
    399         logaction($webvar{parentid}, $session->param("username"), parentID($webvar{parentid}, 'dom', 'group'),
    400                 "Added record '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl}");
    401       }
    402       changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec});
     401        my $restr = "Added record '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl}";
     402        logaction($webvar{parentid}, $session->param("username"), parentID($webvar{parentid}, 'dom', 'group'), $restr);
     403        changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, resultmsg => $restr);
     404      }
    403405    } else {
    404406      $page->param(failed       => 1);
     
    457459##log
    458460      if ($webvar{defrec} eq 'y') {
    459         logaction(0, $session->param("username"), $webvar{parentid},
    460                 "Updated default record '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl}");
     461        my $restr = "Updated default record '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl}";
     462        logaction(0, $session->param("username"), $webvar{parentid}, $restr);
     463        changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, resultmsg => $restr);
    461464      } else {
    462         logaction($webvar{parentid}, $session->param("username"), parentID($webvar{id}, 'rec', 'group'),
    463                 "Updated record '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl}");
    464       }
    465       changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec});
     465        my $restr = "Updated record '$webvar{name} $typemap{$webvar{type}} $webvar{address}', TTL $webvar{ttl}";
     466        logaction($webvar{parentid}, $session->param("username"), parentID($webvar{id}, 'rec', 'group'), $restr);
     467        changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, resultmsg => $restr);
     468      }
    466469    } else {
    467470      $page->param(failed       => 1);
     
    529532    } else {
    530533      if ($webvar{defrec} eq 'y') {
    531         logaction(0, $session->param("username"), $rec->{parid},
    532                 "Deleted default record '$rec->{host} $typemap{$rec->{type}} $rec->{val}', TTL $rec->{ttl}");
     534        my $restr = "Deleted default record '$rec->{host} $typemap{$rec->{type}} $rec->{val}', TTL $rec->{ttl}";
     535        logaction(0, $session->param("username"), $rec->{parid}, $restr);
     536        changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, resultmsg => $restr);
    533537      } else {
    534         logaction($rec->{parid}, $session->param("username"), parentID($rec->{parid}, 'dom', 'group'),
    535                 "Deleted record '$rec->{host} $typemap{$rec->{type}} $rec->{val}', TTL $rec->{ttl}");
    536       }
    537       changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec});
     538        my $restr = "Deleted record '$rec->{host} $typemap{$rec->{type}} $rec->{val}', TTL $rec->{ttl}";
     539        logaction($rec->{parid}, $session->param("username"), parentID($rec->{parid}, 'dom', 'group'), $restr);
     540        changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, resultmsg => $restr);
     541      }
    538542    }
    539543  } else {
Note: See TracChangeset for help on using the changeset viewer.