Changeset 445 for branches/stable/cgi-bin/search.cgi
- Timestamp:
- 07/26/10 17:00:00 (14 years ago)
- Location:
- branches/stable
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/stable
- Property svn:ignore
-
old new 1 1 local.css 2 *.tar.gz
-
- Property svn:mergeinfo changed
/trunk merged: 415-420,422-443
- Property svn:ignore
-
branches/stable/cgi-bin/search.cgi
r395 r445 9 9 # Last update by $Author$ 10 10 ### 11 # Copyright 2005 ,2006Kris Deugau11 # Copyright 2005-2010 - Kris Deugau 12 12 13 13 use strict; … … 16 16 use DBI; 17 17 use CommonWeb qw(:ALL); 18 use MyIPDB;19 18 use POSIX qw(ceil); 20 19 use NetAddr::IP; 21 20 22 # Don't need a username or syslog here. syslog left active for debugging. 21 # don't remove! required for GNU/FHS-ish install from tarball 22 ##uselib## 23 24 use MyIPDB; 25 26 # Don't formally need a username or syslog here. syslog left active for debugging. 23 27 use Sys::Syslog; 24 openlog "IPDBsearch","pid","local2"; 28 openlog "IPDBsearch","pid","$IPDB::syslog_facility"; 29 30 # ... but we do *use* the username on ACLs now. 31 # Collect the username from HTTP auth. If undefined, we're in 32 # a test environment, or called without a username. 33 my $authuser; 34 if (!defined($ENV{'REMOTE_USER'})) { 35 $authuser = '__temptest'; 36 } else { 37 $authuser = $ENV{'REMOTE_USER'}; 38 } 25 39 26 40 # Why not a global DB handle? (And a global statement handle, as well...) … … 49 63 } 50 64 51 printHeader('Searching...'); 65 # Headerize! Make sure we replace the $$EXTRA0$$ bit as needed. 66 printHeader('', ($IPDBacl{$authuser} =~ /a/ ? 67 '<td align=right><a href="/ip/cgi-bin/main.cgi?action=assign">Add new assignment</a></td>' : '' 68 )); 52 69 53 70 if ($webvar{stype} eq 'q') { … … 148 165 if ($webvar{cidr} eq '') { # We has a blank CIDR. Ignore it. 149 166 } elsif ($webvar{cidr} =~ /\//) { 150 # 209.91.179/26 should show all /26 subnets in 209.91.179167 # 192.168.179/26 should show all /26 subnets in 192.168.179 151 168 my ($net,$maskbits) = split /\//, $webvar{cidr}; 152 169 if ($webvar{cidr} =~ /^(\d{1,3}\.){3}\d{1,3}\/\d{2}$/) { … … 340 357 $query =~ s/\s+//g; 341 358 if ($query =~ /\//) { 342 # 209.91.179/26 should show all /26 subnets in 209.91.179359 # 192.168.179/26 should show all /26 subnets in 192.168.179 343 360 my ($net,$maskbits) = split /\//, $query; 344 361 if ($query =~ /^(\d{1,3}\.){3}\d{1,3}\/\d{2}$/) {
Note:
See TracChangeset
for help on using the changeset viewer.