Changeset 91 for trunk/dns.cgi
- Timestamp:
- 04/13/11 16:00:10 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dns.cgi
r90 r91 249 249 $page->param(curpage => $webvar{page}); 250 250 251 my $sth = $dbh->prepare("SELECT count(*) FROM ". 252 ($webvar{defrec} eq 'y' ? 'default_' : '')."records ". 253 "WHERE ".($webvar{defrec} eq 'y' ? 'group' : 'domain')."_id=? ". 254 "AND NOT type=$reverse_typemap{SOA}"); 255 $sth->execute($webvar{id}); 256 my ($count) = ($sth->fetchrow_array); 251 my $count = getRecCount($dbh, $webvar{defrec}, $webvar{id}); 257 252 258 253 # $sortby = 'host'; … … 919 914 $page->param(importdoms => $webvar{importdoms}) if $webvar{importdoms}; 920 915 921 ##fixme: check group too? 916 # shut up warning about uninitialized variable 917 $webvar{doit} = '' if !defined($webvar{doit}); 918 922 919 if ($webvar{doit} eq 'y' && !$webvar{ifrom}) { 923 920 $page->param(errmsg => "Need to set host to import from"); 924 921 } elsif ($webvar{doit} eq 'y' && !$webvar{importdoms}) { 925 922 $page->param(errmsg => "Need domains to import"); 926 } els e{923 } elsif ($webvar{doit} eq 'y') { 927 924 my @domlist = split /\s+/, $webvar{importdoms}; 928 925 my @results; 929 my $rnum = 0;930 926 foreach my $domain (@domlist) { 931 927 my %row; 932 928 my ($code,$msg) = importAXFR($dbh, $webvar{ifrom}, $domain, $webvar{group}, 933 929 $webvar{domstatus}, $webvar{rwsoa}, $webvar{rwns}); 934 ##fixme: log935 930 $row{domok} = $msg if $code eq 'OK'; 936 931 if ($code eq 'WARN') { … … 939 934 } 940 935 if ($code eq 'FAIL') { 941 $msg =~ s|\n|<br /> |g;936 $msg =~ s|\n|<br />\n|g; 942 937 $row{domerr} = $msg; 943 938 } 944 # do stuff! DNSDB::importAXFR($webvar{ifrom}, $webvar{rwsoa}, $webvar{rwns}, $domain, <flags>) 939 $msg = "<br />\n".$msg if $msg =~ m|<br />|; 940 logaction(domainID($dbh, $domain), $session->param("username"), $webvar{group}, 941 "AXFR import $domain from $webvar{ifrom} ($code): $msg"); 945 942 $row{domain} = $domain; 946 # $row{row} = $rnum++;947 943 push @results, \%row; 948 944 } … … 1224 1220 sub fill_recdata { 1225 1221 fill_rectypes($webvar{type}); 1222 1223 # le sigh. we may get called with many empty %webvar keys 1224 no warnings qw( uninitialized ); 1226 1225 1227 1226 $page->param(name => $webvar{name});
Note:
See TracChangeset
for help on using the changeset viewer.