#!/usr/bin/perl
require './network.pl'; ## required for www.pl
require './www.pl'; ## main routines
require './filter.pl'; ## filter routines
require './config.pl'; ## Configuration file
#####################################################################
##guestpost.cgi v1.0 Copyright 1998, Tom and Linda Myro,
##all rights reserved. Permission granted to use and modify
##for any good use, as long as you agree to hold Tom and Linda
##Myro and cyber-nurse.com harmless, in the event of any disaster
##either real or imagined, resulting from the use of this software.
##Modification and/or installation of this software shall be
##considered agreement of you, the user with the above conditions.
#####################################################################
## Make any configuration changes in config.pl
##Fabrication
$title = $madmintitle;
$thisscripturl = $madminurl;
$password = $madminpass;
$urllist = $datadirectorypath . "/" . "urlbase\.dat";
#This business here was borrowed from Dave Palmer
read(STDIN, $input, $ENV{'CONTENT_LENGTH'});
# split the input
@pairs = split(/&/, $input);
# split the name/value pairs
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<([^>]|\n)*>//g;
$FORM{$name} = $value;
}
################Translation
$url = $FORM{ 'url' };
$action = $FORM{ 'action' };
$pass = $FORM{ 'pass' };
$deletethis = $FORM{ 'deletethis' };
if($action eq ""){
&starthtml;
print "
Start URL update engine\, which will access all of the pages in the URL list database\, and index their results\. \(NOTE\!\!\! Your Connection MAY time out during this operation\, if your URL list is Very Long. This has no effect on the updating itself\, You may simply continue using $title as if it never occured\. This is caused by slow network times during internet overcrowding\.
\n";
print "
\n";
&formstarter;
print "
\n";
print "
Add a URL to the List of URL\'s to access\, and define filter type\.
\n";
$webfile = $datadirectorypath . "/" . "webtestfile\.dat";
$filesize = -s $webfile;
if($filesize < 1000){
print "There seems to have been a problem in fetching your file\. It may have been entered incorrectly\, or other problems may have occured\. Use your Browser\'s Back button and check your entry\. \n";
}
else{
print "Your URL seems to have fetched correctly\. \n";
&formstarter;
print "\n";
print "\n";
print "Click \n";
print " to continue.\n";
}
&endhtml;
exit;
}
if($action eq "writefiltercondat"){
&passcheck;
$countfile = $datadirectorypath . "/" . "entrycount\.txt";
open(LISTCOUNT, "$countfile");
$urlcount = ;
++$urlcount;
open(URLBASE, ">>$urllist");
$entryline = "$urlcount\|$url\n";
print URLBASE ($entryline);
close(URLBASE);
close(LISTCOUNT);
open(LISTCOUNT, ">$countfile");
print LISTCOUNT ($urlcount);
close(LISTCOUNT);
&starthtml;
print "