#!/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); } #### #!/usr/local/bin/perl -w ################################################################ #Code is to filter and change High Ascii to UTF-8 compliant ccs# # Written By. tdadis@digitalthink.com # ################################################################ require 5.003; use CGI qw(:all); use strict; package main; $OUTPUT_AUTOFLUSH = 1; $main::cgi = new CGI; ###################################################################### #if the FeatureName: $Course = to multilingual course code do this # ###################################################################### if (#######) { SendTheMulitibitMail(); SendSuccessPage(); Multilingual(); } else { SendTheMail(); SendSuccessPage(); } ####################################################################### # This Sub to change multibit ascii characters to UTF-8 compliant # ####################################################################### sub Multilingual { local ($_) =@_; return $_ < 0x80 ? chr($_): $_ < 0x800 ? chr($_>>6&0x3f|0xC0) . chr($_&0x80) : chr($_>>12&0x0F|0xE0) .chr($_>>6&0x3F|0x80) .chr($_&0x3F|0x80); } s//&utf8(hex($1))/gei; ############################################################################# #The sub SendTheMultibitMail is changed only in the to mail bucket # ############################################################################# sub SendTheMultibitMail { my ($to) = '####somemailbucket####'; 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 <