Changeset 47 for trunk/dns.cgi
- Timestamp:
- 12/10/09 13:29:16 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r44 r47 154 154 listdomains(); 155 155 156 } elsif ($webvar{page} eq 'reclist') {157 158 # Handle record list for both default records (per-group) and live domain records159 160 $page->param(defrec => $webvar{defrec});161 $page->param(id => $webvar{id});162 $page->param(curpage => $webvar{page});163 164 # select count(*) from (default_)?records where (group|domain)_id=?165 my $sth = $dbh->prepare("SELECT count(*) FROM ".166 ($webvar{defrec} eq 'y' ? 'default_' : '')."records ".167 "WHERE ".($webvar{defrec} eq 'y' ? 'group' : 'domain')."_id=? ".168 "AND NOT type=$reverse_typemap{SOA}");169 $sth->execute($webvar{id});170 my ($count) = ($sth->fetchrow_array);171 172 # fill the page-count and first-previous-next-last-all details173 fill_pgcount($count,"records",domainName($dbh,$webvar{id}));174 fill_fpnla($count); # should put some params on this sub...175 176 $page->param(defrec => $webvar{defrec});177 if ($webvar{defrec} eq 'y') {178 ##fixme: hardcoded group179 showdomain('y',$curgroup);180 } else {181 showdomain('n',$webvar{id});182 }183 184 156 } elsif ($webvar{page} eq 'newdomain') { 185 157 … … 211 183 # cancelled. whee! 212 184 changepage(page => "domlist"); 185 } 186 187 } elsif ($webvar{page} eq 'reclist') { 188 189 # Handle record list for both default records (per-group) and live domain records 190 191 $page->param(defrec => $webvar{defrec}); 192 $page->param(id => $webvar{id}); 193 $page->param(curpage => $webvar{page}); 194 195 # select count(*) from (default_)?records where (group|domain)_id=? 196 my $sth = $dbh->prepare("SELECT count(*) FROM ". 197 ($webvar{defrec} eq 'y' ? 'default_' : '')."records ". 198 "WHERE ".($webvar{defrec} eq 'y' ? 'group' : 'domain')."_id=? ". 199 "AND NOT type=$reverse_typemap{SOA}"); 200 $sth->execute($webvar{id}); 201 my ($count) = ($sth->fetchrow_array); 202 203 # fill the page-count and first-previous-next-last-all details 204 fill_pgcount($count,"records",domainName($dbh,$webvar{id})); 205 fill_fpnla($count); # should put some params on this sub... 206 207 $page->param(defrec => $webvar{defrec}); 208 if ($webvar{defrec} eq 'y') { 209 ##fixme: hardcoded group 210 showdomain('y',$curgroup); 211 } else { 212 showdomain('n',$webvar{id}); 213 213 } 214 214 … … 639 639 } 640 640 641 } elsif ($webvar{page} eq 'whois') { 642 643 } elsif ($webvar{page} eq 'log') { 644 645 ##fixme put in some real log-munching stuff 646 ##fixme need to add bits to *create* log entries... 647 my $sth = $dbh->prepare("SELECT * FROM log"); 648 $sth->execute; 649 my @logbits; 650 while (my @data = $sth->fetchrow_array) { 651 my %row; 652 # (1,1,1,'test@test','Test','frobbed the whatsit',now()); 653 $row{userfname} = $data[4]; 654 $row{userid} = $data[1]; 655 $row{useremail} = $data[3]; 656 $row{logentry} = $data[5]; 657 $row{logtime} = $data[6]; 658 push @logbits, \%row; 659 } 660 $page->param(logentries => \@logbits); 661 641 662 } 642 663 … … 927 948 fill_colheads(\@cols, \%colheads); 928 949 929 $page->param(sortorder => $sortorder);950 # $page->param(sortorder => $sortorder); 930 951 # hack! hack! pthbttt. have to rethink the status column storage, 931 952 # or inactive comes "before" active. *sigh*
Note:
See TracChangeset
for help on using the changeset viewer.