#!/usr/local/bin/perl -- -*-perl-*- ### ### ### Time-stamp: <1998-10-11 16:46:08 -- Anders Berglund> ### Fileformat: Perl Script ### Built on a script written by Lars Talman ### Slightly modified by Mikael Boman, it95mib@minsk.docs.uu.se, 961006 ### Modified by Anders Berglund andersb@docs.uu.se, 970212 ### Johan har varit här och mipplat 1998-05-11 ### --------------------------------------------------------------------------- $mailprog = '/usr/lib/sendmail'; # Mail program on Web-system $recipient = 'johanb@docs.uu.se,andersb@docs.uu.se'; # Recipient of email about new entry print "Content-type: text/html\n\n"; # For HTTP/1.0 compatibility # 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; } # If the comments are blank, then give a "blank form" response &blank_response unless $FORM{'username1'} && $FORM{'realname1'} && $FORM{'projekt'}; ### --------------------------------------------------------------------------- ### Sending mail to $recipient ### --------------------------------------------------------------------------- open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n"; print MAIL "Reply-to: $FORM{'username1'} ($FORM{'realname1'})\n"; print MAIL "Anmälan fuko\n\n"; print MAIL "Namn1: $FORM{'Real name 1'} $FORM{'realname1'} "; print MAIL "\n"; print MAIL "E-mail1: $FORM{'username1'}"; print MAIL "\n"; print MAIL "Namn2: $FORM{'Real name 2'} $FORM{'realname2'} "; print MAIL "\n"; print MAIL "E-mail2: $FORM{'username2'}"; print MAIL "\n"; print MAIL "Projekt: $FORM{'projekt'}"; print MAIL "\n"; #print MAIL "Undervisar på eng: $FORM{'eng'}"; #print MAIL "\n"; print MAIL "Kommentar: $FORM{'kommentar'}"; print MAIL "\n"; print MAIL "Server protocol: $ENV{'SERVER_PROTOCOL'}\n"; print MAIL "Remote host: $ENV{'REMOTE_HOST'}\n"; print MAIL "Remote IP address: $ENV{'REMOTE_ADDR'}\n"; print MAIL "Homepage: $FORM{'url'}\n"; close (MAIL); ### --------------------------------------------------------------------------- ### Thank the student ### --------------------------------------------------------------------------- print "Tack!"; print "

Tack!

"; print " "; print "
Anders Berglund "; print "
"; print ""; ### --------------------------------------------------------------------------- ### Tell the student to give name ### --------------------------------------------------------------------------- sub blank_response { print "Anmaelan"; print "

Anmälan fuko

"; print "

Du måste ange ett namn, e-mail-adress och projektnamn.

"; print "
"; print "Försök igen"; print "
"; print "
Anders Berglund "; print "
"; exit; }