Changeset 243 for trunk/dns.cgi
- Timestamp:
- 02/24/12 15:35:07 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r242 r243 619 619 $page->param(id => $webvar{id}); 620 620 $page->param(defrec => $webvar{defrec}); 621 my $recdata = getRecLine($dbh, $webvar{defrec}, $webvar{id}); 621 $page->param(revrec => $webvar{revrec}); 622 my $recdata = getRecLine($dbh, $webvar{defrec}, $webvar{revrec}, $webvar{id}); 622 623 $page->param(name => $recdata->{host}); 623 624 $page->param(address => $recdata->{val}); … … 638 639 639 640 # get current/previous record info so we can log "updated 'foo A 1.2.3.4' to 'foo A 2.3.4.5'" 640 my $oldrec = getRecLine($dbh, $webvar{defrec}, $webvar{ id});641 my $oldrec = getRecLine($dbh, $webvar{defrec}, $webvar{revrec}, $webvar{id}); 641 642 642 643 my ($code,$msg) = updateRec($dbh,$webvar{defrec},$webvar{id}, … … 694 695 # This is a complete separate segment since it uses a different template from add/edit records above 695 696 696 changepage(page => "reclist", errmsg => "You are not permitted to delete records", id => $webvar{parentid}) 697 changepage(page => "reclist", errmsg => "You are not permitted to delete records", id => $webvar{parentid}, 698 revrec => $webvar{revrec}) 697 699 unless ($permissions{admin} || $permissions{record_delete}); 698 700 … … 704 706 $page->param(id => $webvar{id}); 705 707 $page->param(defrec => $webvar{defrec}); 708 $page->param(revrec => $webvar{revrec}); 706 709 $page->param(parentid => $webvar{parentid}); 707 710 # first pass = confirm y/n (sorta) 708 711 if (!defined($webvar{del})) { 709 712 $page->param(del_getconf => 1); 710 my $rec = getRecLine($dbh, $webvar{defrec},$webvar{id});713 my $rec = getRecLine($dbh, $webvar{defrec}, $webvar{revrec}, $webvar{id}); 711 714 $page->param(host => $rec->{host}); 712 715 $page->param(ftype => $typemap{$rec->{type}}); … … 714 717 } elsif ($webvar{del} eq 'ok') { 715 718 # get rec data before we try to delete it 716 my $rec = getRecLine($dbh, $webvar{defrec},$webvar{id});717 my ($code,$msg) = delRec($dbh, $webvar{defrec},$webvar{id});719 my $rec = getRecLine($dbh, $webvar{defrec}, $webvar{revrec}, $webvar{id}); 720 my ($code,$msg) = delRec($dbh, $webvar{defrec}, $webvar{revrec}, $webvar{id}); 718 721 if ($code eq 'OK') { 719 722 if ($webvar{defrec} eq 'y') { … … 725 728 my $restr = "Deleted record '$rec->{host} $typemap{$rec->{type}} $rec->{val}', TTL $rec->{ttl}"; 726 729 logaction($rec->{parid}, $session->param("username"), parentID($rec->{parid}, 'dom', 'group'), $restr); 727 changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, resultmsg => $restr); 730 changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, 731 revrec => $webvar{revrec}, resultmsg => $restr); 728 732 } 729 733 } else { … … 740 744 } 741 745 changepage(page => "reclist", id => $webvar{parentid}, defrec => $webvar{defrec}, 742 errmsg => "Error deleting record: $msg");746 revrec => $webvar{revrec}, errmsg => "Error deleting record: $msg"); 743 747 } 744 748 } else {
Note:
See TracChangeset
for help on using the changeset viewer.