Changeset 274 for trunk/dns.cgi
- Timestamp:
- 03/14/12 18:01:42 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r272 r274 416 416 my $pargroup = parentID($dbh, (id => $webvar{id}, type => 'domain', revrec => $webvar{revrec})); 417 417 my $dom = domainName($dbh, $webvar{id}); 418 my ($code,$msg) = del Domain($dbh, $webvar{id});418 my ($code,$msg) = delZone($dbh, $webvar{id}, $webvar{revrec}); 419 419 if ($code eq 'OK') { 420 420 logaction($webvar{id}, $session->param("username"), $pargroup, "Deleted domain $dom"); … … 434 434 435 435 $webvar{revrec} = 'y'; 436 437 if ($session->param('resultmsg')) { 438 $page->param(resultmsg => $session->param('resultmsg')); 439 $session->clear('resultmsg'); 440 } 441 if ($session->param('errmsg')) { 442 $page->param(errmsg => $session->param('errmsg')); 443 $session->clear('errmsg'); 444 } 445 436 446 $page->param(curpage => $webvar{page}); 437 447 listzones(); … … 480 490 } 481 491 482 #} elsif ($webvar{page} eq 'delrevzone') { 492 } elsif ($webvar{page} eq 'delrevzone') { 493 494 changepage(page => "revzones", errmsg => "You are not permitted to delete reverse zones") 495 unless ($permissions{admin} || $permissions{domain_delete}); 496 497 # security check - does the user have permission to access this entity? 498 if (!check_scope(id => $webvar{id}, type => 'revzone')) { 499 changepage(page => "revzones", errmsg => "You do not have permission to delete the requested reverse zone"); 500 } 501 502 $page->param(id => $webvar{id}); 503 504 # first pass = confirm y/n (sorta) 505 if (!defined($webvar{del})) { 506 507 $page->param(del_getconf => 1); 508 $page->param(revzone => revName($dbh,$webvar{id})); 509 510 } elsif ($webvar{del} eq 'ok') { 511 my $pargroup = parentID($dbh, (id => $webvar{id}, type => 'revzone', revrec => $webvar{revrec})); 512 my $zone = revName($dbh, $webvar{id}); 513 my ($code,$msg) = delZone($dbh, $webvar{id}, 'y'); 514 if ($code eq 'OK') { 515 ##fixme: logaction needs to take "domid OR revid" and some way to know which it is 516 logaction($webvar{id}, $session->param("username"), $pargroup, "Deleted reverse zone $zone"); 517 changepage(page => "revzones", resultmsg => "Deleted reverse zone $zone"); 518 } else { 519 logaction($webvar{id}, $session->param("username"), $pargroup, "Failed to delete domain $zone ($msg)") 520 if $config{log_failures}; 521 #push @debugbits, "got back $code, $msg\n"; 522 changepage(page => "revzones", errmsg => "Error deleting reverse zone $zone: $msg"); 523 } 524 525 } else { 526 # cancelled. whee! 527 changepage(page => "revzones"); 528 } 483 529 484 530 } elsif ($webvar{page} eq 'reclist') { … … 1205 1251 my $pargroup = parentID($dbh, (id => $webvar{$_}, type => 'domain', revrec => $webvar{revrec})); 1206 1252 my $dom = domainName($dbh, $webvar{$_}); 1207 my ($code, $msg) = del Domain($dbh, $webvar{$_});1253 my ($code, $msg) = delZone($dbh, $webvar{$_}, 'n'); 1208 1254 if ($code eq 'OK') { 1209 1255 logaction($webvar{$_}, $session->param("username"), $pargroup, "Deleted domain $dom");
Note:
See TracChangeset
for help on using the changeset viewer.