source: branches/dns/cgi-bin/dns.cgi@ 263

Last change on this file since 263 was 263, checked in by Kris Deugau, 20 years ago

/branches/dns

Add/create dns.cgi stub

  • Property svn:executable set to *
  • Property svn:keywords set to Date Rev Author
File size: 1.1 KB
Line 
1#!/usr/bin/perl
2# ipdb/cgi-bin/dns.cgi
3###
4# SVN revision info
5# $Date: 2005-06-21 21:12:52 +0000 (Tue, 21 Jun 2005) $
6# SVN revision $Rev: 263 $
7# Last update by $Author: kdeugau $
8###
9# Copyright (C) 2004,2005 - Kris Deugau
10
11use strict;
12use warnings;
13use CGI::Carp qw(fatalsToBrowser);
14use DBI;
15use CommonWeb qw(:ALL);
16use MyIPDB;
17use POSIX qw(ceil);
18use NetAddr::IP;
19
20use Sys::Syslog;
21
22openlog "IPDB-dns","pid","local2";
23
24# Collect the username from HTTP auth. If undefined, we're in
25# a test environment, or called without a username.
26my $authuser;
27if (!defined($ENV{'REMOTE_USER'})) {
28 $authuser = '__temptest';
29} else {
30 $authuser = $ENV{'REMOTE_USER'};
31}
32
33# Why not a global DB handle? (And a global statement handle, as well...)
34# Use the connectDB function, otherwise we end up confusing ourselves
35my $ip_dbh;
36my $sth;
37my $errstr;
38($ip_dbh,$errstr) = connectDB_My;
39if (!$ip_dbh) {
40 printAndExit("Database error: $errstr\n");
41}
42initIPDBGlobals($ip_dbh);
43
44printHeader('test','<td>test again</td>');
45
46
47# Global variables
48my %webvar = parse_post();
49cleanInput(\%webvar);
50
51
52#main()
53
54if(!defined($webvar{action})) {
55 $webvar{action} = "<NULL>"; #shuts up the warnings.
56}
57
Note: See TracBrowser for help on using the repository browser.