Changeset 22
- Timestamp:
- 08/30/10 15:13:38 (14 years ago)
- Location:
- trunk/dnsbl
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dnsbl/dnsbl.cgi
r19 r22 89 89 $page->param(ip => $webvar{ip}); 90 90 $page->param(err => $err); 91 92 $page->param(browsebits => browse($dbh,$webvar{ip})); 91 93 } 92 94 print $page->output; … … 101 103 my $dbh = shift; 102 104 my $ip = shift; 105 my $ipcidr = new NetAddr::IP $ip; 103 106 104 107 my $basesql = "SELECT b.block,o.orgname,b.listme,o.listme,b.comments,o.comments ". … … 118 121 $sth0->execute($ip); 119 122 while (my ($block0,$org0,$listmeb0,$listmeo0,$bcomments0,$ocomments0) = $sth0->fetchrow_array) { 120 $tmpl0->param(lvlclass => 'lvl0'.($dnsbl->autolist_block($block0) ? ' auto0' : '')); 123 my $block0cidr = new NetAddr::IP $block0; 124 $tmpl0->param(lvlclass => 'lvl0'.($dnsbl->autolist_block($block0) ? ' auto0' : ''). 125 ( $ipcidr->within($block0cidr) ? ' inhere' : '')); 121 126 $tmpl0->param(netclass => ($listmeb0 ? 'b0list' : '')); 122 127 $tmpl0->param(net => $block0); … … 129 134 if ($sth1->rows > 0) { 130 135 while (my ($block1,$org1,$listmeb1,$listmeo1,$bcomments1,$ocomments1) = $sth1->fetchrow_array) { 136 my $block1cidr = new NetAddr::IP $block1; 131 137 my $tmpl1 = new HTML::Template(filename => 'templates/browse-block.tmpl'); 132 $tmpl1->param(lvlclass => 'lvl1'.($dnsbl->autolist_block($block1) ? ' auto1' : '')); 138 $tmpl1->param(lvlclass => 'lvl1'.($dnsbl->autolist_block($block1) ? ' auto1' : ''). 139 ( $ipcidr->within($block1cidr) ? ' inhere' : '')); 133 140 $tmpl1->param(netclass => ($listmeb1 ? 'b1list' : '')); 134 141 $tmpl1->param(net => $block1); … … 142 149 if ($sth2->rows > 0) { 143 150 while (my ($block2,$org2,$listmeb2,$listmeo2,$bcomments2,$ocomments2) = $sth2->fetchrow_array) { 151 my $block2cidr = new NetAddr::IP $block2; 144 152 my $tmpl2 = new HTML::Template(filename => 'templates/browse-block.tmpl'); 145 $tmpl2->param(lvlclass => 'lvl2'.($dnsbl->autolist_block($block2) ? ' auto2' : '')); 153 $tmpl2->param(lvlclass => 'lvl2'.($dnsbl->autolist_block($block2) ? ' auto2' : ''). 154 ( $ipcidr->within($block2cidr) ? ' inhere' : '')); 146 155 $tmpl2->param(netclass => ($listmeb2 ? 'b2list' : '')); 147 156 $tmpl2->param(net => $block2); … … 158 167 $iprow{ipcount} = $data4[1]; 159 168 $iprow{indent} = ' '; 169 $iprow{repeater} = 1 if $ip eq $data4[0]; 160 170 # ip | count | s4list | added 161 171 push @iprows, \%iprow; … … 175 185 $iprow{ipcount} = $data4[1]; 176 186 $iprow{indent} = ' '; 187 $iprow{repeater} = 1 if $ip eq $data4[0]; 177 188 # ip | count | s4list | added 178 189 push @iprows, \%iprow; … … 193 204 $iprow{ipcount} = $data4[1]; 194 205 $iprow{indent} = ''; 206 $iprow{repeater} = 1 if $ip eq $data4[0]; 195 207 # ip | count | s4list | added 196 208 push @iprows, \%iprow; -
trunk/dnsbl/templates/browse-block.tmpl
r20 r22 4 4 <TMPL_IF subs><TMPL_VAR NAME=subs> 5 5 </TMPL_IF><TMPL_IF iplist><TMPL_VAR NAME=indent> <div class=iplist> 6 <TMPL_LOOP NAME=iplist><TMPL_VAR NAME=indent> < TMPL_VAR NAME=ip> (<TMPL_VAR NAME=ipcount>)<br>6 <TMPL_LOOP NAME=iplist><TMPL_VAR NAME=indent> <span<TMPL_IF repeater> class="repeater"</TMPL_IF>><TMPL_VAR NAME=ip> (<TMPL_VAR NAME=ipcount>)</span><br> 7 7 </TMPL_LOOP> 8 8 <TMPL_VAR NAME=indent> </div></TMPL_IF> -
trunk/dnsbl/templates/dbreport.tmpl
r11 r22 2 2 <head> 3 3 <title>added <TMPL_VAR NAME=ip></title> 4 <link rel="stylesheet" type="text/css" href="templates/dnsbl.css" /> 4 5 </head> 5 6 <body> 7 <table><tr><td valign=top> 6 8 added <TMPL_VAR NAME=ip> 7 9 <TMPL_IF org0><br>added <TMPL_VAR NAME=org0></TMPL_IF> … … 13 15 <TMPL_IF err><hr><TMPL_VAR NAME=err></TMPL_IF> 14 16 <hr><a href="/">Back</a> 17 <TMPL_IF NAME=browsebits> 18 <td valign=top> 19 <TMPL_VAR NAME=browsebits> 20 </td> 21 </TMPL_IF> 22 </td></tr></table> 15 23 </body> 16 24 </html> -
trunk/dnsbl/templates/dnsbl.css
r19 r22 76 76 width: 150px; 77 77 } 78 /*.inhere { 79 font-weight: bold; 80 }*/ 78 81 .inhere { 82 border: 3px solid #ff0000; 83 } 84 .repeater { 79 85 font-weight: bold; 80 86 } -
trunk/dnsbl/templates/index.tmpl
r2 r22 6 6 <table> 7 7 <form action="dnsbl.cgi"><input type=hidden name=page value=report> 8 <tr><td> Enteran IP:</td>8 <tr><td>Add an IP:</td> 9 9 <td><input name=ip></td></tr> 10 10 <tr><td><input type=submit></td></tr>
Note:
See TracChangeset
for help on using the changeset viewer.