#!/usr/pkg/bin/perl
# $Id: log.cgi,v 1.21 2000/12/05 12:25:45 tom Exp $
################################################################


use strict;
use lib qw(../lib);
use CGI::QueryString;
use CGI::Tools;

use TDS;
use TDS::AccessLog::Analysis;
use TDS::Admin::Authorize;

$| = 1;

################
my $anal;

$anal = new TDS::AccessLog::Analysis(year=>param('year'),
				     month=>param('month'),
				     chase_id=>param('id'));

################
# authorization
#$anal->PrintHTTPHeader;
TDS::Admin::Authorize->PrintHTTPHeader;
$anal->CheckAuthorized;


$anal->Read;
$anal->ReadLogFile(param('tail_days'));
print $anal->AsHTML;
untie %{$anal->accounted_referer};    # should be TDS::Accesslog::Analysis::DESTORY, but it doesn't work...

# end of log
