Changeset 151


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.

Location:
trunk
Files:
2 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 {
  • trunk/templates/reclist.tmpl

    r140 r151  
    55<td align="center" valign="top">
    66
    7  <TMPL_IF errmsg>
    8   <div class='errmsg'><TMPL_VAR NAME=errmsg></div>
    9  </TMPL_IF>
     7<TMPL_IF resultmsg>
     8<div class="result"><TMPL_VAR NAME=resultmsg></div>
     9</TMPL_IF>
     10<TMPL_IF errmsg>
     11<div class='errmsg'><TMPL_VAR NAME=errmsg></div>
     12</TMPL_IF>
    1013
    1114<TMPL_UNLESS perm_err>
Note: See TracChangeset for help on using the changeset viewer.