Your hosting subscription has expired.
Please contact Jaywil Software to renew.
Thank-you.
Invalid Password";
}
&PrintLoginForm;
} else {
# Get the number of fields in database. Newer db's have 21 fields instead of 14.
# The extra search boxes are only displayed if fields are present on file.
foreach (@{$DbLineNames[$in{'dbNum'}]}) {
$LibName=$_;
open(LIBRARY_FILE, $LibDef{$LibName}[2]);
$filerecord= Unrecognized number of data fields in database file: $NumDbFields";
print " Please contact Jaywil Software at support\@resourcemate.com for an update or to resolve this problem.
terminator:$LibDef{$LibName}[4]
";
$NumDbFields = scalar(split(/\t/,
Lib Name:$LibName, Lib Filename:$LibDef{$LibName}[2] - $NumDbFields
";
if (($NumDbFields != 14) && ($NumDbFields != 21) && ($NumDbFields != 22)) {
print "
(Database filename: $LibDef{$LibName}[2])";
print "\n
";
if ($ConfigIn{'SHOW_VISITOR_NUMBER'} =~ /^y/i) {
print " $ConfigIn{'TEXT_VISITOR_NUMBER'} " . &getCounterValue("count-lib-$databasedata[$in{'dbNum'}*10].txt");
}
print " ";
# Print alternate search link
if ($SearchType ne '') {
print "$AltSearchText";
}
print " \n
$ConfigIn{'SEARCHPAGE_TEXT_SEARCH'} "; if ($ConfigIn{'SEARCHPAGE_TEXT_LIBRARY_NAME'} eq '') { print $databasedata[$in{'dbNum'}*10]; } else { print $ConfigIn{'SEARCHPAGE_TEXT_LIBRARY_NAME'}; } print "
"; } if ($ConfigIn{'SEARCHPAGE_SHOW_ENTER_FIELDS'} =~ /^y/i) { print "$ConfigIn{'SEARCHPAGE_TEXT_ENTER_FIELDS'}
"; } print <                         | \n"; } print "" . eval("\$SearchFieldLabel$i") . ": | \n"; print "   | \n"; if (defined $ConfigIn{'SEARCHPAGE_MATCH_LIST_DEFAULT'}) { print "\n"; print " | \n"; } if ($ConfigIn{'SEARCHPAGE_SHOW_WHOLE_WORD_CHECKBOX'} =~ /^y/i) { print "$ConfigIn{'SEARCHPAGE_TEXT_WHOLE_WORD_MATCH'} | \n"; $ConfigIn{'SEARCHPAGE_TEXT_WHOLE_WORD_MATCH'} = ""; # Only print this text onscreen once. } print "
  | \n";
for ($i=1; $i<=10 ; $i++) {
if ((eval("\$ConfigIn{'ADDITIONAL_LINK_LABEL$i'}") ne "")
&& (eval("\$ConfigIn{'ADDITIONAL_LINK_URL$i'}" ) ne "")) {
print " ";
print eval("\$ConfigIn{'ADDITIONAL_LINK_LABEL$i'}");
print " "; if ($ConfigIn{'ADDITIONAL_LINK_DOUBLESPACE'} =~ /^y/i) {print ' '} print "\n"; } } print " |   |
$ConfigIn{'TEXT_VISITOR_NUMBER'} ".&getCounterValue("count-list-libs.txt")."
\n"; } if ($ConfigIn{'SHOW_TOTAL_LIBRARY_DATABASES'} =~ /^y/i) { print "$ConfigIn{'TEXT_TOTAL_LIBRARY_DATABASES'} $NumDbLineNames
\n"; } for ($a=1;$a<=$NumDbLineNames;$a++) { my $action = 2; if (($databasedata[($a*10)+2] eq "*") || ($databasedata[($a*10)+2] eq "")) { $action = 3; } print "$databasedata[($a*10)+0]";
if (($ConfigIn{'SHOW_NUM_DATABASE_ITEMS'} eq "Y") || ($ConfigIn{'SHOW_PASSWORD_REQUIRED'} eq "Y")) {
print " -";
}
if ($ConfigIn{'SHOW_PASSWORD_REQUIRED'} eq "Y") {
print " (";
if (($databasedata[($a*10)+2] ne "*") && ($databasedata[($a*10)+2] ne "")) {
#mail link is in unicode so that isn't as easy for spam bots to id (hopefully), email in variable is also
print "$ConfigIn{'TEXT_PASSWORD_REQUIRED'}";
}
else {
print $ConfigIn{'TEXT_NO_PASSWORD_REQUIRED'};
}
print ")";
}
if ($ConfigIn{'SHOW_NUM_DATABASE_ITEMS'} eq "Y") {
print " [$databasedata[($a*10)+6] item(s)]";
}
}
}
############################################
# MakeRequest
# Purpose: Request Item(s)
#
############################################
sub MakeRequest {
&SearchDatabase;
$selected = 0;
for($a=1;$a<=$NumBooksFound;$a++) {
if ($in{$a} eq "on") {
$selected++;
}
}
my $errMsg;
if ($selected==0) {
$errMsg = "No Items Selected!";
}
if ($in{'txtName'} eq '') {
$errMsg = "Missing Name for Request!"
}
if ($in{'txtEmailPhone'} eq '') {
$errMsg = "Missing Email/Phone Number for Request!"
}
if (defined $errMsg) {
print "
$errMsg\n";
print "
Please press the back button on your browser and make the necessary corrections.\n";
return;
}
print "$databasedata[($in{'dbNum'}*10)+0]
";
print "$ConfigIn{'REQUESTPAGE_TEXT_REQUESTING'}
";
$i=0;
for($a=1;$a<=$NumBooksFound;$a++) {
if ($in{$a} eq "on") {
print " $SearchResults[($a*$NumArrayFields+1)]
";
}
}
foreach $LibName (@{$DbLineNames[$in{'dbNum'}]}) {
$FoundOne = "N";
for($a=1;$a<=$NumBooksFound;$a++) {
if (($in{$a} eq "on") && ($SearchResults[($a*$NumArrayFields)] eq $LibDef{$LibName}[0])) {
$FoundOne = "Y";
#print "
Found: $a, $SearchResults[($a*$NumArrayFields)]";
}
}
next if $FoundOne eq "N";
#Validate email
if ($in{'txtEmailPhone'} =~ /^(\w|\-|\_|\.)+\@((\w|\-|\_)+\.)+[a-zA-Z]{2,}$/gi) {
$emailFrom = $in{'txtEmailPhone'};
} else {
$emailFrom = $adminEmail;
}
unless (defined $ConfigIn{'SENDMAIL'}) {
# Use SMTP for email unless a Sendmail server declaration is made
use Net::SMTP;
$SMTPServer = 'localhost' unless (defined $SMTPServer);
$NetSMTP = Net::SMTP->new($SMTPServer, Timeout => 60 ) || die "Unable to open connection to SMTP server named '$SMTPServer'.\nError Message: $! \n";
$NetSMTP->mail($emailFrom);
$NetSMTP->to($LibDef{$LibName}[1]);
# print "sending from [$emailFrom] to [$LibDef{$LibName}[1]]";
$NetSMTP->data();
} else {
# Sendmail
open (MAIL, "|$ConfigIn{'SENDMAIL'}") || die "Can't open connection to sendmail! (path: $ConfigIn{'SENDMAIL'})\nPlease contact Jaywil Software at support\@resourcemate.com for assistance.\n";
print MAIL "Date: $mailheader_date -0500\n";
}
# Print only the email address, if so requested from lib.conf. Some servers don't handle the
# presence of the person's real-life name very well. May 18/2004-M.Whiting
if ($SmblatEmailOnly =~ /^Y/i) {
&MakeRequest_Subloop("To: $LibDef{$LibName}[1]\n");
&MakeRequest_Subloop("From: $emailFrom\n");
} else {
&MakeRequest_Subloop("To: Libary Admin <$LibDef{$LibName}[1]>\n");
&MakeRequest_Subloop("From: $adminName <$emailFrom>\n");
}
&MakeRequest_Subloop("Date: $mailheader_date -0500\n");
&MakeRequest_Subloop("Subject: $ConfigIn{'EMAIL_TEXT_BORROW'}\n");
&MakeRequest_Subloop("Organization: $orgName\n");
&MakeRequest_Subloop("\n");
&MakeRequest_Subloop("$ConfigIn{'EMAIL_TEXT_TITLE1'}\n");
&MakeRequest_Subloop("$ConfigIn{'EMAIL_TEXT_TITLE2'}\n");
&MakeRequest_Subloop("$ConfigIn{'EMAIL_TEXT_TITLE3'}\n");
&MakeRequest_Subloop("$ConfigIn{'EMAIL_TEXT_TITLE4'}\n");
&MakeRequest_Subloop("$ConfigIn{'EMAIL_TEXT_LIBRARY'}$LibDef{$LibName}[0]\n");
&MakeRequest_Subloop("$ConfigIn{'EMAIL_TEXT_NAME'}$in{'txtName'}\n");
&MakeRequest_Subloop("$ConfigIn{'EMAIL_TEXT_EMAIL'}$in{'txtEmailPhone'}\n");
&MakeRequest_Subloop("$ConfigIn{'EMAIL_TEXT_DATE'}$mailheader_date\n");
&MakeRequest_Subloop("$ConfigIn{'EMAIL_TEXT_FOOTER1'}\n");
&MakeRequest_Subloop("$ConfigIn{'EMAIL_TEXT_COMMENTS'}$in{'txtComments'}\n");
for($a=1;$a<=$NumBooksFound;$a++) {
if (($in{$a} eq "on") && ($SearchResults[($a*$NumArrayFields)] eq $LibDef{$LibName}[0])) {
&MakeRequest_Subloop("\n$ConfigIn{'EMAIL_TEXT_REQUESTED_ITEM'}\n");
for ($i=1; $i<=14; $i++) {
$FieldNum = eval("\$ConfigIn{'EMAIL_FIELD_DETAIL_LINE$i'}");
if ($FieldNum > 0) {
if ($FieldNum == 1) {$ArrayPosition = 1;}
if ($FieldNum == 2) {$ArrayPosition = 4;}
if ($FieldNum == 3) {$ArrayPosition = 8;}
if ($FieldNum == 4) {$ArrayPosition = 11;}
if ($FieldNum == 5) {$ArrayPosition = 9;}
if ($FieldNum == 6) {$ArrayPosition = 10;}
if ($FieldNum == 7) {$ArrayPosition = 7;}
if ($FieldNum >= 8) {$ArrayPosition = $FieldNum+7;}
&MakeRequest_Subloop(eval("\$SearchFieldLabel$FieldNum") . " : $SearchResults[($a*$NumArrayFields)+$ArrayPosition]\n");
}
}
}
}
&MakeRequest_Subloop("\n\n(c) copyright $cpr_year $orgName.\n");
# Close the email
unless (defined $ConfigIn{'SENDMAIL'}) {
$NetSMTP->dataend();
$NetSMTP->quit;
} else {
#Sendmail
close (MAIL);
}
}
print "
$ConfigIn{'REQUESTPAGE_TEXT_THANKYOU'}";
print "
$ConfigIn{'RESULTSPAGE_TEXT_RETURN'}
Login To $databasedata[($in{'dbNum'}*10)+0]
Password:
NCP } ############################################ # getCounterValue("filename") # # Increment and return the counter in "filename" in the counter directory. ############################################ sub getCounterValue { local $count = 0; open (COUNTER, "+>>".$countpath.$dirsep.$_[0]); flock(COUNTER, $LOCK_EX); seek(COUNTER, 0, 0); $count =Note: This page is for debugging purposes by Jaywil Software.
";
print "Please copy and paste this page into your email program
";
print "and send it to Jaywil Software. Thank-you.
Start of Environment Variables:
"; foreach $key (sort keys(%ENV)) { print "$key = $ENV{$key}End of Environment Variables
"; exit; } ############################################ # GetQueryData # Purpose: To Get Information From The Query # String passed from The WWW ############################################ sub GetQueryData { if ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); } else { @pairs = split(/&/, $ENV{'QUERY_STRING'}); } # Now digest the data, putting it into a more useful format. foreach $pair (@pairs) { ($key, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/\cM//; # print "$key = $value(You can contact Jaywil Software at support\@resourcemate.com if you need assistance)
"; exit; } } else { if (defined $DbLineNames[$DbLineNum][1]) { print "Please contact Jaywil Software about the multi-library version of Web Search.
"; exit; } else { # convert db name to uppercase to use as the key in the hash. Note that element 0 # of the hash is the same name in mixed case. ($Keyname = $databasedata[$DbLineNum*10]) =~ tr/a-z/A-Z/; ($LibDef{$Keyname}[0] = $databasedata[$DbLineNum*10]) =~ s/(^\s+|\s+$)//g; # library name ($LibDef{$Keyname}[1] = $databasedata[$DbLineNum*10+4]) =~ s/(^\s+|\s+$)//g; # email ($LibDef{$Keyname}[2] = $_) =~ s/(^\s+|\s+$)//g; # library data location $DbLineNames[$DbLineNum][$DbLineFileNum] = $Keyname; } } } } # Run through all the Library Definitions, downloading remote files & assigning local filenames $iTemp = 0; foreach $LibName (keys %LibDef) { $_ = $LibDef{$LibName}[2]; # put the file location into $_ if ($_ !~ /^(www|http)/i ) { #If no www/http reference, it's a local file if (!(-e $_)) { print "File not found for library named '$LibName'";
print "
(filename: $_)";
exit;
}
} else {
if ($_ =~ /^www/i ) {$_ = "http://" . $_;}
($DestFilename = $_) =~ s/^.+\///; # remove the path before the filename.
$DestFilename = $LocalDataPath."RemoteFile".++$iTemp."-".$DestFilename;
if (-e $DestFilename) {
$returncode = mirror($_, $DestFilename);
} else {
$returncode = getstore($_, $DestFilename); #one server had trouble with mirroring if file didn't already exist
}
if (is_error($returncode)) {
print "
Problem getting remote database file: $_"; print "
Transfer Error Message: ";
print status_message($returncode);
print "
(HTTP error code # $returncode)";
print "Please contact Jaywil Software for assistance.
";
print
exit;
}
#print "
done ... " .status_message($returncode);
$LibDef{$LibName}[2] = $DestFilename; #Reassign remote library path with local path
}
}
# Set password timeout, now that any default override has been read in from lib.conf
if (defined $session and defined $ConfigIn{'PASSWORD_TIMEOUT'}) {
$session->expire($ConfigIn{'PASSWORD_TIMEOUT'});
}
# Set search type for future screens, if not already set.
$SearchType = ($in{'Type'}) || $ConfigIn{'SEARCHPAGE_SEARCH_DEFAULT'} ; #could be set by url parameters or lib.conf, or just the script default
$SearchType = uc(substr($SearchType,0,1));
if ($SearchType eq "A") {
$AltSearchType = "B";
$AltSearchText = $ConfigIn{'SEARCHPAGE_TEXT_BASIC_LINK'};
} else {
$AltSearchType = "A";
$AltSearchText = $ConfigIn{'SEARCHPAGE_TEXT_ADVANCED_LINK'};
}
}
sub EncryptEmailAddress {
$_ = $_[0];
print "Content-type: text/html\n\n";
print "
This is a simple screen to show you what the encrypted form of an email
";
print "address should be. Copy & paste the encrypted text below into your lib.conf file.
";
print "Please contact Jaywil Software for assistance.
";
print "
Starting email is: $_";
my $ascii_offset = 10;
my @text_as_arr=split(//,$_);
my @newarr = undef;
#designed to handle ascii codes 33 through 126
foreach $character (@text_as_arr) {
# print "
[$character]";
if (ord($character)<=(126-$ascii_offset)) {
push @newarr, chr(ord($character)+$ascii_offset);
# print ",[",chr(ord($character)+$ascii_offset),"],",ord($character)+$ascii_offset;
} else {
push @newarr, chr(ord($character)+$ascii_offset-94);
# print ",[",chr(ord($character)+$ascii_offset-94),"],",ord($character)+$ascii_offset-94;
}
}
my $newstring = join "", @newarr;
($displaystring = $newstring) =~ s/</g; # convert the less than symbol to html-friendly code for display only
print "
New encrypted text for lib.conf:
$displaystring";
exit;
}
sub DecryptEmailAddress {
my $plain_text_address = undef;
my $ascii_offset = 10;
my $encrypted_email = $_[0];
my @encrypted_as_single_chars=split(//,$encrypted_email);
my @newarr = undef;
#designed to handle ascii codes 33 through 126
foreach $character (@encrypted_as_single_chars) {
#print "
[$character]";
if (ord($character)>=(33+$ascii_offset)) {
push @newarr, chr(ord($character)-$ascii_offset);
# print ",[",chr(ord($character)-$ascii_offset),"],",ord($character)-$ascii_offset;
} else {
push @newarr, chr(ord($character)-$ascii_offset+94);
# print ",[",chr(ord($character)-$ascii_offset+94),"],",ord($character)-$ascii_offset-94;
}
}
$plain_text_address = join "", @newarr;
}
sub TextToUnicode {
$plain_text_address = $_[0];
# print "
plain_text_address:",$plain_text_address,"";
# Take the (decrypted) email address & change to unicode characters, they display fine on
# the browser but don't look like anything useful in the source code (anti-spam bot method).
my @plaintext_as_single_chars=split(//,$plain_text_address);
@newarr = undef;
foreach $character (@plaintext_as_single_chars) {
# print "
[$character]";
push @newarr, "".ord($character).";";
# print ",[",$character,"],"," ".ord($character).";";
}
my $unicode_address = join "", @newarr;
# print "
unicode_address:",$unicode_address,"
"; # print "----------------------------------
"; return $unicode_address; }