######################################################################### # voh-lib.pl Version 4.1 January 22, 1997 w/departments # Copyright (c) 1996-1997 Matthew J. Walker # This is a library file with all the conserved routines of the three # VOH scripts. It is optimized for ease of use and maintenance. # It MUST be placed in a directory recognized as a library directory by # Perl (Which often includes .) ######################################################################### # Subroutine GetFormData adapted from code published in # Oreilly and Associates # "Managing Internet Information Services", # with a slight modification from Steven Brenner's cgi-lib.pl. ######################################################################### require 'ctime.pl'; #Standard Perl library ######################################################################### # SetupVOH # # Main routine of VOH scripts. # # Creates and initializes the following variables: # # $config_file # $warning # $root_path # $root_url # $cgi_url # $link_path # $time # $date # $admin_email # $questions_path # $HTTP_header # $SMTP_server # $HTML_footer # $HTML_title # $HTML_background # $HTML_bgcolor # $verification_string # $diagnositics # $system_type # $posted_from # *in # $posted_from ######################################################################### # Edit the following variables. ######################################################################### sub SetupVOH { #------------------------------------------------------------------------ # Convert the data from a form into %in #------------------------------------------------------------------------ &ConvertFormData; #------------------------------------------------------------------------ # Remember where you came from ... #------------------------------------------------------------------------ $posted_from = $ENV{'REMOTE_HOST'}; #------------------------------------------------------------------------ # Warning contains the string included on the CGI generated input form # to provide the individual with information about the submission. #------------------------------------------------------------------------ $warning = "Important: Once you submit this, it must be manually edited if corrections are needed." ; #------------------------------------------------------------------------ # root_path is the absolute path to the site's root in the file system # (the directory where the lecture directories are stored) #------------------------------------------------------------------------ $root_path ="/root_of_voh"; #------------------------------------------------------------------------ # Config_file is the absolute path and file name of the configuration file. # :'s for Mac /'s for Unix/NT #------------------------------------------------------------------------ $config_file = "$root_path/conf/voh.conf" ; #------------------------------------------------------------------------ # root_url is the URL path to the root of the voh files # (For use with relative links. http://server.ip/root_url/) # NOTE: If your voh is at your server root, do not include the leading # "/", ie set $root_url = ""; #------------------------------------------------------------------------ $root_url = "/VOH"; #------------------------------------------------------------------------ # cgi_url is the URL path to Perl cgi scripts # (For use with relative links. http://server.ip/cgi_url/scriptname) # Some servers like to use /scripts. This will break pre-written html # ie blanks/* will have to be modified! #------------------------------------------------------------------------ $cgi_url = "/cgi-bin"; #------------------------------------------------------------------------ # Get the system time and make the date string from it. #------------------------------------------------------------------------ $time = time; $date = &ctime($time); chomp($date); #------------------------------------------------------------------------ # admin_email is the email address to which queries about VOH are # to be sent. # @ must be backspaced! email\@u.edu #------------------------------------------------------------------------ $admin_email = "email\@u.edu"; #------------------------------------------------------------------------ # URL used for links to specific class directories. #------------------------------------------------------------------------ # Allows for encoding lecture:instructor otherwise no harm... ($temp_lecture = $in{lecture}) =~ tr#:#/#; #------------------------------------------------------------------------ $link_path = "$root_url/$temp_lecture" ; #------------------------------------------------------------------------ # Set up paths # questions_path is the full path to individual class questions directories. #------------------------------------------------------------------------ $questions_path = "$root_path/$in{lecture}/questions"; #------------------------------------------------------------------------ # HTTP header setup: #------------------------------------------------------------------------ $HTTP_header = &HTTP_Header; #------------------------------------------------------------------------ # The standard HTML for output back to the browser #------------------------------------------------------------------------ $HTML_footer = &HTML_Footer; $HTML_title = "VOH"; # Goes in the