Bug 27653

Summary: Updates to send-pr.html to support MIME
Product: Documentation Reporter: arun <arun>
Component: Books & ArticlesAssignee: freebsd-doc (Nobody) <doc>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description arun 2001-05-26 07:40:00 UTC
The current web interface to submit PRs doesn't support patches
very well. The attached patch adds that feature. People can 
now send patches easily using a web based interface.

Fix: 

Apply the attached patch. Installed the following additional
ports:

$ pkg_info -xI p5
p5-IO-String-1.01_1 Simplified Perl5 module to handle I/O on in-core strings
p5-IO-stringy-1.220 Perl5 module for using IO handles with non-file objects
p5-MIME-Base64-2.12 Perl5 module for Base64 and Quoted-Printable encodings
p5-MIME-Tools-5.410 A set of perl5 modules for MIME
p5-Mail-Tools-1.15  Perl5 modules for dealing with Internet e-mail messages
p5-Net-1.0703       Perl5 modules to access and use network protocols


------------=_990858724-596-0
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: text/plain

+++ dosendpr.cgi	2001/05/26 06:23:57
 #     (http://www.gnu.ai.mit.edu/copyleft/gpl.html)
 # $FreeBSD: www/en/cgi/dosendpr.cgi,v 1.5 2001/05/07 19:28:09 wosch Exp $
+# MIME support: Arun Sharma <arun@sharmas.dhs.org>
 require "html.pl";
+# Requires p5-MIME-Tools port
+use MIME::Entity;
+
     &html_title ("Problem Report Error");
@@ -23,9 +30,11 @@
 
-&cgi_form_in();
+
 
+$gndb = $query->param('gndb');
   { require "$gndb.def"; }
@@ -52,8 +61,8 @@
 
-if (!$cgi_data{'email'} || !$cgi_data{'originator'} ||
+if (!$query->param('email') || !$query->param('originator') ||
     if ($gnsprepbad && -e $gnsprepbad )
     else {
 }
 # Build the PR.
-      "From: $cgi_data{'email'}\n" . 
-      "X-Send-Pr-Version: www-1.0\n\n" .
-      ">Originator:\t$cgi_data{'originator'}\n" .
-      ">Confidential:\t$cgi_data{'confidential'}\n" .
-      ">Severity:\t$cgi_data{'severity'}\n" .
-      ">Category:\t$cgi_data{'category'}\n" .
-      ">Release:\t$cgi_data{'release'}\n" .
-      ">Description:\n$cgi_data{'description'}\n" .
-      ">Fix:\n$cgi_data{'fix'}\n";
+      "From: " . $query->param('email') . "\n" . 
+      "X-Send-Pr-Version: www-1.0\n\n";
+$body = ">Submitter-Id:\t" . $query->param('submitterid') . "\n" .
+      ">Organization:\t" . $query->param('organization') . "\n" .
+      ">Synopsis:\t" . $query->param('synopsis'). "\n" .
+      ">Priority:\t" . $query->param('priority'). "\n" .
+      ">Class:\t\t" . $query->param('class'). "\n" .
+      ">Environment:\t" . $query->param('environment') . "\n" .
+      ">How-To-Repeat:\n" . $query->param('howtorepeat') . "\n" .
+
 
 $pr =~ s/\r//g;
+if ($query->param('attachment1 [details]') || $query->param('attachment2 [details]')) {
+    $top = MIME::Entity->build( Type     => "multipart/mixed",
+				-To      => $gnemail,
+
+
+    while (<$fh>) {
+    }
+    if ($query->param('attachment1 [details]')) {
+		    Encoding => 'text/plain');
+
+    while (<$fh>) {
+    }
+    # attachment #2 [details]
+       $top->attach(Data => $data2,
+    };
+    $io = IO::String->new($pr);
+}
 #print "<PRE>$submitprog\n\n$pr\n</PRE>";

+++ send-pr.html	Thu May 24 09:41:27 2001
       you fill in the "Environment" field as requested with the output from
 
+      <FORM ACTION="http://sharmas.dhs.org:81/cgi-bin/dosendpr.cgi" METHOD="POST" ENCTYPE="multipart/form-data">      
       <INPUT TYPE="HIDDEN" NAME="submitterid" VALUE="net">
       
       <B>Fix to the problem if known</B>: <BR>
 
+      <INPUT TYPE="FILE" NAME="attachment1 [details]"> <BR>
+      <P>
       <INPUT TYPE="SUBMIT" VALUE="Submit Problem Report">
+
     
-      form should not be used to submit code as plain text.</P>
       <HR NOSHADE>

------------=_990858724-596-0--
Comment 1 arun 2001-05-29 06:23:55 UTC
Please see 27654 for a followup.
Comment 2 Ceri Davies freebsd_committer freebsd_triage 2003-02-24 19:07:46 UTC
State Changed
From-To: open->closed

This was a nice idea, but send-pr.html is now disabled, and I don't 
see it coming back anytime soon.  Thanks for your efforts anyway.