Changeset 250 for trunk/dns.cgi


Ignore:
Timestamp:
02/29/12 12:54:56 (13 years ago)
Author:
Kris Deugau
Message:

/trunk

Fix navigation glitch on deleting a record; revrec wasn't
propagated causing you to land on the wrong record list.
See #26

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns.cgi

    r249 r250  
    709709        ($webvar{defrec} eq 'y' ? ($webvar{revrec} eq 'y' ? 'defrevrec' : 'defrec') : 'record'))) {
    710710    # redirect to domlist because we don't have permission for the entity requested
    711     changepage(page => 'domlist', errmsg => "You do not have permission to delete records in the requested ".
     711    changepage(page => 'domlist', revrec => $webvar{revrec},
     712        errmsg => "You do not have permission to delete records in the requested ".
    712713        ($webvar{defrec} eq 'y' ? 'group' : 'domain'));
    713714  }
     
    730731    if ($code eq 'OK') {
    731732      if ($webvar{defrec} eq 'y') {
     733        my $recclass = ($webvar{revrec} eq 'n' ? 'default record' : 'default reverse record');
    732734##fixme:  log distance for MX;  log port/weight/distance for SRV
    733         my $restr = "Deleted default record '$rec->{host} $typemap{$rec->{type}} $rec->{val}', TTL $rec->{ttl}";
     735        my $restr = "Deleted $recclass '$rec->{host} $typemap{$rec->{type}} $rec->{val}', TTL $rec->{ttl}";
    734736        logaction(0, $session->param("username"), $rec->{parid}, $restr);
    735         changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, resultmsg => $restr);
     737        changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec},
     738                revrec => $webvar{revrec}, resultmsg => $restr);
    736739      } else {
    737         my $restr = "Deleted record '$rec->{host} $typemap{$rec->{type}} $rec->{val}', TTL $rec->{ttl}";
     740        my $recclass = ($webvar{revrec} eq 'n' ? 'record' : 'reverse record');
     741        my $restr = "Deleted $recclass '$rec->{host} $typemap{$rec->{type}} $rec->{val}', TTL $rec->{ttl}";
    738742        logaction($rec->{parid}, $session->param("username"), parentID($rec->{parid}, 'dom', 'group'), $restr);
    739743        changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec},
     
    756760    }
    757761  } else {
    758     changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec});
     762    changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, revrec => $webvar{revrec});
    759763  }
    760764
Note: See TracChangeset for help on using the changeset viewer.