Changeset 112 for trunk/dns.cgi
- Timestamp:
- 08/02/11 18:54:07 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r111 r112 37 37 38 38 my @debugbits; # temp, to be spit out near the end of processing 39 my $debugenv = 0;39 my $debugenv = 1; 40 40 41 41 # Let's do these templates right... … … 108 108 my $sortorder = "ASC"; 109 109 110 my ($dbh,$msg) = connectDB("dnsdb","dnsdb","secret","newdbhost"); 110 #my ($dbh,$msg) = connectDB("dnsdb","dnsdb","secret","newdbhost"); 111 # dbname, user, pass, host (optional) 112 my ($dbh,$msg) = connectDB("dnsdb", "dnsdb", "secret", "dnsdbhost"); 111 113 #my $dbh = DBI->connect("DBI:mysql:database=vegadns","vegadns","secret", 112 114 # { AutoCommit => 0 }) or die $DBI::errstr; … … 587 589 if ($code ne 'OK') { 588 590 # need to find failure mode 591 logaction(0, $session->param("username"), $webvar{curgroup}, "Failure deleting group $deleteme: $msg"); 589 592 changepage(page => "grpman", del_failed => 1, errmsg => $msg); 590 ##fixme: log591 593 } else { 592 594 ##fixme: need to clean up log when deleting a major container … … 642 644 643 645 ##fixme: un-hardcode the limit? 644 $perpage = 50;646 # $perpage = 50; 645 647 646 648 my $sth = $dbh->prepare("SELECT count(*) FROM domains WHERE group_id=?"); … … 651 653 fill_pgcount($count,'domains',groupName($dbh,$curgroup)); 652 654 fill_fpnla($count); 655 $page->param(offset => $offset); # since apparently this isn't set explicitly elsewhere. Who knew? 656 $page->param(perpage => $perpage); 653 657 654 658 my @domlist; … … 669 673 } 670 674 $page->param(domtable => \@domlist); 671 # ACLs675 # ACLs 672 676 $page->param(maymove => ($permissions{admin} || ($permissions{domain_edit} && $permissions{domain_create} && $permissions{domain_delete}))); 673 677 $page->param(maystatus => $permissions{admin} || $permissions{domain_edit}); 674 678 $page->param(maydelete => $permissions{admin} || $permissions{domain_delete}); 675 679 676 ##fixme: need to clean up status indicator/usage/inversion 680 } elsif ($webvar{page} eq 'bulkchange') { 681 682 if ($webvar{action} eq 'move') { 683 changepage(page => "domlist", errmsg => "You are not permitted to bulk-move domains") 684 unless ($permissions{admin} || ($permissions{domain_edit} && $permissions{domain_create} && $permissions{domain_delete})); 685 $page->param(action => $webvar{action}); 686 my $tmpstr = 'tmpstr: '; 687 my @bulkresults; 688 # nngh. due to alpha-sorting on the previous page, we can't use domid-numeric 689 # order here, and since we don't have the domain names until we go around this 690 # loop, we can't alpha-sort them here. :( 691 foreach (keys %webvar) { 692 my %row; 693 next unless $_ =~ /^dom_\d+$/; 694 $row{domain} = domainName($dbh,$webvar{$_}); 695 my ($code, $msg) = changeGroup($dbh, 'domain', $webvar{$_}, $webvar{destgroup}); 696 $row{domok} = ($code eq 'OK'); 697 $row{domerr} = $msg; 698 push @bulkresults, \%row; 699 } 700 $page->param(bulkresults => \@bulkresults); 701 702 } elsif ($webvar{action} eq 'deactivate') { 703 changepage(page => "domlist", errmsg => "You are not permitted to bulk-deactivate domains") 704 unless ($permissions{admin} || $permissions{domain_edit}); 705 } elsif ($webvar{action} eq 'activate') { 706 changepage(page => "domlist", errmsg => "You are not permitted to bulk-activate domains") 707 unless ($permissions{admin} || $permissions{domain_edit}); 708 } elsif ($webvar{action} eq 'delete') { 709 changepage(page => "domlist", errmsg => "You are not permitted to bulk-delete domains") 710 unless ($permissions{admin} || $permissions{domain_delete}); 711 } 712 # not going to handle the unknown $webvar{action} else; it should not be possible in normal 713 # operations, and anyone who meddles with the URL gets what they deserve. 677 714 678 715 } elsif ($webvar{page} eq 'useradmin') {
Note:
See TracChangeset
for help on using the changeset viewer.