Changeset 351 for trunk/cgi-bin
- Timestamp:
- 10/06/06 12:23:39 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/cgi-bin/search.cgi
r320 r351 37 37 38 38 # Global variables 39 my $RESULTS_PER_PAGE = 10;39 my $RESULTS_PER_PAGE = 25; 40 40 my %webvar = parse_post(); 41 41 cleanInput(\%webvar); … … 105 105 106 106 # First chunk of SQL. Filter on custid, description, and notes as necessary. 107 my $sql = "(select $cols from searchme where $webvar{custexclude} custid ilike '%$webvar{custid}%')". 108 " $sqlconcat $webvar{custexclude} oldcustid ilike '%$webvar{custid}%')". 107 my $sql = "(select $cols from searchme where". 108 " $webvar{custexclude} (custid ilike '%$webvar{custid}%'". 109 " OR $webvar{custexclude} oldcustid ilike '%$webvar{custid}%'))". 109 110 " $sqlconcat (select $cols from searchme where $webvar{descexclude} description ilike '%$webvar{desc}%')". 110 111 " $sqlconcat (select $cols from searchme where $webvar{notesexclude} notes ilike '%$webvar{notes}%')"; … … 141 142 ## CIDR query options. 142 143 $webvar{cidr} =~ s/\s+//; # Hates the nasty spaceseseses we does. 143 if ($webvar{cidr} =='') { # We has a blank CIDR. Ignore it.144 if ($webvar{cidr} eq '') { # We has a blank CIDR. Ignore it. 144 145 } elsif ($webvar{cidr} =~ /\//) { 145 146 # 209.91.179/26 should show all /26 subnets in 209.91.179 … … 149 150 # we'll be getting a class A anytime soon. <g> 150 151 $sql .= " $sqlconcat (select $cols from searchme where ". 151 "$webvar{cidrexclude} cidr ='$webvar{cidr}')";152 "$webvar{cidrexclude} cidr<<='$webvar{cidr}')"; 152 153 } else { 153 154 # Partial match; beginning of subnet and maskbits are provided 154 155 # Show any blocks with the leading octet(s) and that masklength 156 # Need some more magic for bare /nn searches: 157 my $condition = ($net eq '' ? 158 "masklen(cidr)=$maskbits" : "text(cidr) like '$net%' and masklen(cidr)=$maskbits"); 155 159 $sql .= " $sqlconcat (select $cols from searchme where $webvar{cidrexclude} ". 156 "( text(cidr) like '$net%' and masklen(cidr)=$maskbits))";160 "($condition))"; 157 161 } 158 162 } elsif ($webvar{cidr} =~ /^(\d{1,3}\.){3}\d{1,3}$/) { … … 429 433 "allcities=$webvar{allcities}&"; 430 434 foreach my $key (keys %webvar) { 431 if ($key =~ /^(?:type|city)\[/ ) {435 if ($key =~ /^(?:type|city)\[/ || $key =~ /exclude$/) { 432 436 print "$key=$webvar{$key}&"; 433 437 }
Note:
See TracChangeset
for help on using the changeset viewer.