#!/usr/bin/perl # ipdb/cgi-bin/dns.cgi ### # SVN revision info # $Date: 2005-06-21 21:12:52 +0000 (Tue, 21 Jun 2005) $ # SVN revision $Rev: 263 $ # Last update by $Author: kdeugau $ ### # Copyright (C) 2004,2005 - Kris Deugau use strict; use warnings; use CGI::Carp qw(fatalsToBrowser); use DBI; use CommonWeb qw(:ALL); use MyIPDB; use POSIX qw(ceil); use NetAddr::IP; use Sys::Syslog; openlog "IPDB-dns","pid","local2"; # Collect the username from HTTP auth. If undefined, we're in # a test environment, or called without a username. my $authuser; if (!defined($ENV{'REMOTE_USER'})) { $authuser = '__temptest'; } else { $authuser = $ENV{'REMOTE_USER'}; } # Why not a global DB handle? (And a global statement handle, as well...) # Use the connectDB function, otherwise we end up confusing ourselves my $ip_dbh; my $sth; my $errstr; ($ip_dbh,$errstr) = connectDB_My; if (!$ip_dbh) { printAndExit("Database error: $errstr\n"); } initIPDBGlobals($ip_dbh); printHeader('test','