#!/usr/local/bin/perl -- -*-perl-*- # ------------------------------------------------------------ # check-in.cgi # Interactive form # # ------------------------------------------------------------ # Define mail program $mailprog = '/usr/lib/sendmail'; # Recipient of form responses $recipient = 'hd@whoi.edu'; # Print out a content-type for HTTP/1.0 compatibility print "Content-type: text/html\n\n"; # Get the input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); # Un-Webify plus signs and %-encoding $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # Stop people from using subshells to execute commands # Not a big deal when using sendmail, but very important # when using UCB mail (aka mailx). # $value =~ s/~!/ ~!/g; # Uncomment for debugging purposes # print "Setting $name to $value

"; $FORM{$name} = $value; } # Print title and header info for user response &user_response; $date = `date`; # Now send mail to $recipient formatted in HTML # Note: MIME, Subject and Content lines must appear EXACTLY as they do below # (only one \n after Subject line!) open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n"; print MAIL "Reply-to: $FORM{'espr2'} $FORM{'estb'} $FORM{'espr'}\n"; print MAIL "MIME-Version: 1.0\n"; print MAIL "To: $recipient\n"; print MAIL "From: $FORM{'espr2'} $FORM{'estb'} $FORM{'espr'}\n"; print MAIL "Subject: ES Internal Routing Form> $FORM{'name'}: $FORM{'id'} \n"; print MAIL "Content-Type: text/html; charset=us-ascii\n"; print MAIL "Content-Transfer-Encoding: 7bit\n"; print MAIL "\n"; print MAIL "WHOI Human Resources Office: "; print MAIL "ES Internal Routing Form\n"; print MAIL "\n"; print MAIL "\n"; print MAIL "

"; print MAIL ""; print MAIL ""; print MAIL "
"; print MAIL ""; print MAIL "Human Resources Office
"; print MAIL "ES Internal Routing Form
"; print MAIL "
"; print MAIL "Processed By: $FORM{'espr2'} $FORM{'estb'} $FORM{'espr'}
"; print MAIL "Name: $FORM{'name'}
"; print MAIL "SS#: $FORM{'ss'}
"; print MAIL "ID#: $FORM{'id'}
"; print MAIL "Dept: $FORM{'deptnumber'}
"; print MAIL "Title: $FORM{'title'}
"; print MAIL "DOB: $FORM{'dob'}
"; print MAIL "US Citizen? $FORM{'ckusyes'} $FORM{'ckusno'}
"; print MAIL "If not, which country? $FORM{'country'}
"; print MAIL "Visa Type: $FORM{'visa'}
"; print MAIL "EEO Designation $FORM{'eeodesgination'}
"; print MAIL "Veteran: $FORM{'eeoveteran'}
"; print MAIL "Disabled: $FORM{'eeodisabled'}
"; print MAIL "
"; print MAIL "Employment Action
"; print MAIL "
"; print MAIL "Action: $FORM{'newhire'} $FORM{'rehire'} $FORM{'term'} $FORM{'LOA'} $FORM{'change'} $FORM{'promotion'} $FORM{'extension'}
"; print MAIL "Dept Transfer To: $FORM{'depttransfer'}
"; print MAIL "Effective Date: $FORM{'effectivedate'}
"; print MAIL "Expiration Date: $FORM{'expirationdate'}
"; print MAIL "Termination Date: $FORM{'terminationdate'}
"; print MAIL "Termination Reason: $FORM{'termreason'}
"; print MAIL "
"; print MAIL "Type/Status: $FORM{'ft'} $FORM{'threequarter'} $FORM{'half'} $FORM{'casual'} $FORM{'education'} $FORM{'guest'}
"; print MAIL "Reg/Temp: $FORM{'regular'} $FORM{'temporary'}
"; print MAIL "Graded/Exempt: $FORM{'graded'} $FORM{'exempt'}
"; print MAIL "
"; print MAIL "Annual Salary: $FORM{'annsalary'}
"; print MAIL "TRE: $FORM{'tre'}
"; print MAIL "Accrual Date: $FORM{'accrualdate'}
"; print MAIL "Supervisor: $FORM{'super'}
"; print MAIL "Office Address: $FORM{'whoiadd'}
"; print MAIL "Mail Stop: $FORM{'ms'}
"; print MAIL "Extension: $FORM{'extension'}
"; print MAIL "
"; print MAIL "Primary Address: $FORM{'primaryadd'}
"; print MAIL "Primary Phone: $FORM{'primaryphone'}
"; print MAIL "Publish in the WHOI Directory? "; print MAIL "$FORM{'pubaddry'} $FORM{'pubaddrn'}
"; print MAIL "
"; print MAIL "New Position: $FORM{'newposition'}
"; print MAIL "Job Code: $FORM{'jobcode'}
"; print MAIL "EEO Code: $FORM{'eeocode'}
"; print MAIL "Market Average: $FORM{'marketave'}
"; print MAIL "Additional Comments: $FORM{'comments'}
"; print MAIL "
"; print MAIL "Emergency Contact: $FORM{'emername'}
"; print MAIL "Relationship: $FORM{'emerrelate'}
"; print MAIL "Emergency Address: $FORM{'emeradd'}
"; print MAIL "Emergency Phone: $FORM{'emerphone'}
"; print MAIL "
"; print MAIL ""; close (MAIL);