Changeset 275 for trunk/dns.cgi
- Timestamp:
- 03/15/12 15:34:38 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r274 r275 315 315 # hmm. seeing problems in some possibly-not-so-corner cases. 316 316 # this currently only handles "domain on", "domain off" 317 if (defined($webvar{ domstatus})) {317 if (defined($webvar{zonestatus})) { 318 318 # security check - does the user have permission to access this entity? 319 319 my $flag = 0; … … 322 322 } 323 323 if ($flag && ($permissions{admin} || $permissions{domain_edit})) { 324 my $stat = domStatus($dbh,$webvar{id},$webvar{domstatus});324 my $stat = zoneStatus($dbh,$webvar{id},'n',$webvar{zonestatus}); 325 325 ##fixme switch to more consise "Enabled <domain"/"Disabled <domain>" as with users? 326 326 logaction($webvar{id}, $session->param("username"), … … 332 332 $page->param(errmsg => "You are not permitted to view or change the requested domain"); 333 333 } 334 $uri_self =~ s/\& domstatus=[^&]*//g; # clean up URL for stuffing into templates334 $uri_self =~ s/\&zonestatus=[^&]*//g; # clean up URL for stuffing into templates 335 335 } 336 336 … … 434 434 435 435 $webvar{revrec} = 'y'; 436 437 if (defined($webvar{zonestatus})) { 438 # security check - does the user have permission to access this entity? 439 my $flag = 0; 440 foreach (@viewablegroups) { 441 $flag = 1 if isParent($dbh, $_, 'group', $webvar{id}, 'revzone'); 442 } 443 if ($flag && ($permissions{admin} || $permissions{domain_edit})) { 444 my $stat = zoneStatus($dbh,$webvar{id},'y',$webvar{zonestatus}); 445 ##fixme switch to more consise "Enabled <domain"/"Disabled <domain>" as with users? 446 logaction($webvar{id}, $session->param("username"), 447 parentID($dbh, (id => $webvar{id}, type => 'revzone', revrec => $webvar{revrec})), 448 "Changed ".revName($dbh, $webvar{id})." state to ".($stat ? 'active' : 'inactive')); 449 $page->param(resultmsg => "Changed ".revName($dbh, $webvar{id})." state to ". 450 ($stat ? 'active' : 'inactive')); 451 } else { 452 $page->param(errmsg => "You are not permitted to view or change the requested reverse zone"); 453 } 454 $uri_self =~ s/\&zonestatus=[^&]*//g; # clean up URL for stuffing into templates 455 } 436 456 437 457 if ($session->param('resultmsg')) { … … 1222 1242 $row{domain} = domainName($dbh,$webvar{$_}); 1223 1243 ##fixme: error handling on status change 1224 my $stat = domStatus($dbh,$webvar{$_},($webvar{bulkaction} eq 'activate' ? 'domon' : 'domoff'));1244 my $stat = zoneStatus($dbh,$webvar{$_},($webvar{bulkaction} eq 'activate' ? 'domon' : 'domoff')); 1225 1245 logaction($webvar{$_}, $session->param("username"), 1226 1246 parentID($dbh, (id => $webvar{$_}, type => 'domain', revrec => $webvar{revrec})), … … 1637 1657 my %row; 1638 1658 my ($code,$msg) = importAXFR($dbh, $webvar{ifrom}, $domain, $webvar{group}, 1639 $webvar{ domstatus}, $webvar{rwsoa}, $webvar{rwns});1659 $webvar{zonestatus}, $webvar{rwsoa}, $webvar{rwns}); 1640 1660 $row{domok} = $msg if $code eq 'OK'; 1641 1661 if ($code eq 'WARN') {
Note:
See TracChangeset
for help on using the changeset viewer.