Ignore:
Timestamp:
07/26/10 17:00:00 (14 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Bring /branches/stable up to date with /trunk. See #13.

Location:
branches/stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/stable

    • Property svn:ignore
      •  

        old new  
        11local.css
         2*.tar.gz
    • Property svn:mergeinfo changed
      /trunkmerged: 415-420,​422-443
  • branches/stable/cgi-bin/search.cgi

    r395 r445  
    99# Last update by $Author$
    1010###
    11 # Copyright 2005,2006 Kris Deugau
     11# Copyright 2005-2010 - Kris Deugau
    1212
    1313use strict;             
     
    1616use DBI;
    1717use CommonWeb qw(:ALL);
    18 use MyIPDB;
    1918use POSIX qw(ceil);
    2019use NetAddr::IP;
    2120
    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
     24use MyIPDB;
     25
     26# Don't formally need a username or syslog here.  syslog left active for debugging.
    2327use Sys::Syslog;
    24 openlog "IPDBsearch","pid","local2";
     28openlog "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.
     33my $authuser;
     34if (!defined($ENV{'REMOTE_USER'})) {
     35  $authuser = '__temptest';
     36} else {
     37  $authuser = $ENV{'REMOTE_USER'};
     38}
    2539
    2640# Why not a global DB handle?  (And a global statement handle, as well...)
     
    4963}
    5064
    51 printHeader('Searching...');
     65# Headerize!  Make sure we replace the $$EXTRA0$$ bit as needed.
     66printHeader('', ($IPDBacl{$authuser} =~ /a/ ?
     67        '<td align=right><a href="/ip/cgi-bin/main.cgi?action=assign">Add new assignment</a></td>' : ''
     68        ));
    5269
    5370if ($webvar{stype} eq 'q') {
     
    148165  if ($webvar{cidr} eq '') { # We has a blank CIDR.  Ignore it.
    149166  } elsif ($webvar{cidr} =~ /\//) {
    150     # 209.91.179/26 should show all /26 subnets in 209.91.179
     167    # 192.168.179/26 should show all /26 subnets in 192.168.179
    151168    my ($net,$maskbits) = split /\//, $webvar{cidr};
    152169    if ($webvar{cidr} =~ /^(\d{1,3}\.){3}\d{1,3}\/\d{2}$/) {
     
    340357    $query =~ s/\s+//g;
    341358    if ($query =~ /\//) {
    342       # 209.91.179/26 should show all /26 subnets in 209.91.179
     359      # 192.168.179/26 should show all /26 subnets in 192.168.179
    343360      my ($net,$maskbits) = split /\//, $query;
    344361      if ($query =~ /^(\d{1,3}\.){3}\d{1,3}\/\d{2}$/) {
Note: See TracChangeset for help on using the changeset viewer.