#!/usr/local/bin/perl
#
# ngb-confirm.pl
# The "Confirmation" half of the Nizkor Guest Book
$version = "1.01";
# Requires perl 5; tested only with perl5.001m.
#
# Written by Jamie McCarthy (jamie@nizkor.almanac.bc.ca)
# for the Nizkor Project (http://www.almanac.bc.ca/).
# Copyright 1995 Jamie McCarthy.
# Available from
#
# This source code may be publicly distributed by any means,
# as long as the above authorship, copyright, and availability
# notices are kept intact. If you distribute a modified version,
# please explain what changes have been made.
#
# Changes in 1.01:
#
# Removed simple boolean check of $!, since $! returns boolean true on
# some systems even when no error occurred.
# Guest book file and special guest book file are properly created now.
# Minor textual changes.
# Time zone correction variable. You'd think someone would have put
# this into a standard perl CGI library by now...
# If you don't have cgi-lib.pl, check out
# http://www.bio.cam.ac.uk/web/form.html
require "cgi-lib.pl";
###################################################################
###################################################################
# CONSTANTS
###################################################################
###################################################################
###################################################################
# constants you can change if you want
###################################################################
# This value is only valid if you're using UnixWare 2.0 (and,
# obviously, if you're in Canada's Pacific time zone!). This
# format is more common: "PST8PDT". To find the appropriate
# value for your site, 'echo $TZ' at your shell prompt.
# $ENV{"TZ"} = ":Canada/Pacific";
# If you'd prefer not to have horizontal rules between entries,
# simply make this variable empty. Or if you prefer double
# rules, or blockquoted rules, or a special graphic that you
# use for a rule, or whatever, just put its HTML tag here.
$entrySeparator = "
";
# Feel free to localize to your own language.
@monthFullName = (
"January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"
);
###################################################################
# constants you should leave alone
###################################################################
$todaysDate = $monthFullName[(localtime)[4]] . " "
. (localtime)[3]
. ", 19" . (localtime)[5];
# I'd appreciate it if you left this as is. Thanks.
$ngbCredits = <Nizkor
$version
END_OF_NGB_CREDITS
###################################################################
# constants you must modify for your web site
###################################################################
$upToLink = <[ return to Alumni Home Page ]
END_OF_UP_TO_LINK
$addressInformation = <Webster University Alumni Office webmaster\@webster2.websteruniv.edu
END_OF_ADDRESS_INFORMATION
# This directory must be readable and writable by the scripts,
# which means the user/guest that is running your http daemon
# must have read/write permission to it. Usually you'll want
# to keep prying eyes out of this directory; for information
# on NCSA httpd's authentication, for example, see
# http://hoohoo.ncsa.uiuc.edu/docs/setup/admin/UserManagement.html
$guestBookPrivateDir = "/usr/local/etc/httpd/htdocs/temp/guest-book/";
# This is the URL for that private directory.
$guestBookPrivateDirURL = "http://www.websteruniv.edu/temp/guest-book/";
# This is the filename of the special guest book, which always
# goes in that private directory.
$specialGuestBookFilename = "alumni-guest-book-special.html";
# Permissions for the special guest book.
$specialGuestBookPermissions = 0600;
# This is the directory of the normal guest book.
$guestBookDir = "/usr/local/etc/httpd/htdocs/alumni/";
# This is the URL for the directory of the normal guest book.
$guestBookDirURL = "http://www.websteruniv.edu/alumni/";
# This is the filename of the guest book, which always goes in
# that directory.
$guestBookFilename = "alumni-guest-book.html";
# Permissions for the guest book.
$guestBookPermissions = 0644;
# Your email contact address.
$emailContact = "webmaster\@webster2.websteruniv.edu";
# The text of the guest book file.
$emptyGuestBookText = <Webster University Alumni Guest Book
Alumni Guest Book
These comments were left by alumni visiting this site.
You are welcome to
add
your own.
$upToLink
$todaysDate
$ngbCredits
END_OF_EMPTY_GUEST_BOOK_TEXT
# The text of the special guest book file.
$emptySpecialGuestBookText = <Webster Alumni Special Guest Book
Webster Alumni Special Guest Book
This is the "special" guest book, where we decide what to do with
entries that we don't want to go to the
main guest book.
October 28, 1995
END_OF_EMPTY_SPECIAL_GUEST_BOOK_TEXT
###################################################################
###################################################################
# SUBROUTINES
#
# subroutines are:
#
# printHTMLTop - print the code for the top of the HTML page
# printHTMLBot - print the code for the bottom of the HTML page
#
# readEntries - read in list of entries' filenames
# loadEntries - read entry files and load associative arrays
# getBlurb - given info about an entry, return an identifying comment
#
# printPotentialProblems - check for and print any potential problems
# createGuestBook - create guest book file
# createSpecialGuestBook - create special guest book file
#
# printForm - output HTML for form to choose what to do with entries
# processForm - handle the choices made on that form
###################################################################
###################################################################
###################################################################
# printHTMLTop
#
# Print the code for the top of the HTML page.
#
# You're welcome to change this to suit yourself.
###################################################################
sub printHTMLTop
{
print &PrintHeader(); # from cgi-lib.pl
print <Webster Alumni Guest Book Entry Confirmation
Alumni Guest Book Entry Confirmation
END_OF_HTML_TOP
}
###################################################################
# printHTMLBot
#
# Output the code for the bottom of the HTML page.
#
# You're welcome to change this to suit yourself.
###################################################################
sub printHTMLBot
{
print <
$upToLink