#!/usr/local/dthink/perl/bin/perl ############################################################################### # ddt.cgi - a script to take a form and mail its contents to someone # # copyright digitalthink, inc. # ############################################################################### # RCS$Id$ # tabstop = 3 ############################################################################### # setup require 5.003; use CGI qw(:all); use strict; package main; # unbuffer my output $| = 1; $main::cgi = new CGI; #if ($main::cgi->request_method() ne "POST") #{ # Error("This is an invalid request."); #} #else { SendTheMail(); SendSuccessPage(); } exit (0); ############################################################################### # subroutines ############################################################################### # void SendSuccessPage (Scalar $message) # sends the success page back to the browser # uses $main::cgi sub SendSuccessPage { my ($location) = '/Templates/beta/beta_bugthanks.html'; print "Location: ${Globals::baseurl}$location\n\n"; exit (0); } # void SendTheMail (void) # sends the mail message # uses $main::cgi sub SendTheMail { my ($to) = '######@digitalthink.com'; ###removed names for privacy my ($cc) = '######@digitalthink.com'; my ($from) = '######@digitalthink.com'; my ($subject) = 'defect submit'; my ($type) = $main::cgi->param('Type'); my ($bugsubject) = $main::cgi->param('BugSubject'); my ($course) = $main::cgi->param('Course'); my ($hardware) = $main::cgi->param('Hardware'); my ($operatingsystem) = $main::cgi->param('OS'); my ($browser) = $main::cgi->param('Browser'); my ($modulenumber) = $main::cgi->param('ModuleNumber'); my ($lessonnumber) = $main::cgi->param('LessonNumber'); my ($description) = $main::cgi->param('Description'); my ($name) = $main::cgi->param('Name'); my ($email) = $main::cgi->param('EMail'); my ($priority) = $main::cgi->param('Priority'); my ($project) = $main::cgi->param('Project'); my ($subsystem) = $main::cgi->param('Subsystem'); my ($stage) = $main::cgi->param('Stage'); open (MAIL, "|/usr/lib/sendmail -t") || Error("Unable to run mail program"); print MAIL <param('Type')) { Error("Don't mess with my form!!!!\n"); } } # void Error (Scalar $message) # sends an error page to the browser # uses $main::cgi sub Error { my ($errorMessage) = @_; print $main::cgi->header(-"type" => 'text/html'); print $main::cgi->start_html( -"title" => 'Sorry! There was an error', -"text" => '#000000', -"bgcolor" => '#ffffff', ); print $main::cgi->strong("Error"); print "

$errorMessage

"; print $main::cgi->end_html; exit (1); }