Changeset 313 for trunk/dns.cgi
- Timestamp:
- 04/23/12 23:34:37 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r311 r313 984 984 } elsif ($webvar{page} eq 'bulkdomain') { 985 985 # Bulk operations on domains. Note all but group move are available on the domain list. 986 ##fixme: do we care about bulk operations on revzones? Move-to-group, activate, deactivate, 987 # and delete should all be much rarer for revzones than for domains. 986 988 987 989 changepage(page => "domlist", errmsg => "You are not permitted to make bulk domain changes") … … 990 992 fill_grouplist("grouplist"); 991 993 992 ##fixme 993 ##fixme push the SQL and direct database fiddling off into a sub in DNSDB.pm 994 ##fixme 995 996 my $sth = $dbh->prepare("SELECT count(*) FROM domains WHERE group_id=?"); 997 $sth->execute($curgroup); 998 my ($count) = ($sth->fetchrow_array); 994 my $count = getZoneCount($dbh, (revrec => 'n', curgroup => $curgroup) ); 999 995 1000 996 $page->param(curpage => $webvar{page}); … … 1003 999 $page->param(perpage => $perpage); 1004 1000 1005 my @domlist; 1006 my $sql = "SELECT domain_id,domain FROM domains". 1007 " WHERE group_id=?". 1008 " ORDER BY domain". 1009 ($offset eq 'all' ? '' : " LIMIT $perpage OFFSET ".$offset*$perpage); 1010 $sth = $dbh->prepare($sql); 1011 $sth->execute($curgroup); 1001 my $domlist = getZoneList($dbh, (revrec => 'n', curgroup => $curgroup) ); 1012 1002 my $rownum = 0; 1013 while (my @data = $sth->fetchrow_array) { 1014 my %row; 1015 $row{domid} = $data[0]; 1016 $row{domain} = $data[1]; 1017 $rownum++; # putting this in the expression below causes failures. *eyeroll* 1018 $row{newrow} = $rownum % 5 == 0; 1019 push @domlist, \%row; 1020 } 1021 $page->param(domtable => \@domlist); 1003 foreach my $dom (@{$domlist}) { 1004 delete $dom->{status}; 1005 delete $dom->{group}; 1006 $dom->{newrow} = (++$rownum) % 5 == 0; 1007 } 1008 1009 $page->param(domtable => $domlist); 1022 1010 # ACLs 1023 1011 $page->param(maymove => ($permissions{admin} || ($permissions{domain_edit} && $permissions{domain_create} && $permissions{domain_delete})));
Note:
See TracChangeset
for help on using the changeset viewer.