coar 97/05/01 03:39:51
Modified: . bugdb.cgi Log: Enhancements to bug reporting WWW form: o add warning about public nature of PR db o add searchability by PR class and severity o add ability to change both of above when editing o add PR # to HTML <TITLE> and <H1> on full display o translate CRs into newlines in multi-line fields o force flush of HTTP headers o request "uname -a" on entry form o require non-blank values for Environment, email, Category, and Description o fix '@' escaping bug Reviewed by: Roy Fielding, Dean Gaudet Revision Changes Path 1.2 +89 -13 apache-site/bugdb.cgi Index: bugdb.cgi =================================================================== RCS file: /export/home/cvs/apache-site/bugdb.cgi,v retrieving revision 1.1 retrieving revision 1.2 diff -C3 -r1.1 -r1.2 *** bugdb.cgi 1997/03/25 04:43:15 1.1 --- bugdb.cgi 1997/05/01 10:39:49 1.2 *************** *** 87,107 **** --- 87,114 ---- # The first field is the restriction, the second field is the default option %quickrestr = ( "Category", "any", + "Severity", "any", "Responsible", "any", # "Originator", "any", + "Class", "any", "State", "open", ); # Defines order of quick output restrictions @quickrestr = ( "Category", + "Severity", "Responsible", # "Originator", + "Class", "State", ); #################### Main routine # Main Program + select (STDOUT); + $| = 1; print "Content-type: text/html\n\n"; + $| = 0; print "<HTML>\n"; #&read_originator; *************** *** 166,172 **** ### Main menu } elsif ($PATH_INFO eq "") { &main_menu(); ! print"<HR><SMALL>Version: 24 Aug 96<BR>Authors: <A HREF=\"http://alumni.caltech.edu/~dank\">Dan Kegel</A> [EMAIL PROTECTED] & <A HREF=\"http://alumni.caltech.edu/~huyle/\">Huy Le</A> [EMAIL PROTECTED], with revamp work by <A HREF=\"http://www.organic.com\">Brian Behlendorf</A> [EMAIL PROTECTED]</SMALL>\n"; } else { print "<head><title>SPR Front End</title></head> <H1>SPR Front End</H1> --- 173,179 ---- ### Main menu } elsif ($PATH_INFO eq "") { &main_menu(); ! print"<HR><SMALL>Version: 24 Aug 96<BR>Authors: <A HREF=\"http://alumni.caltech.edu/~dank\">Dan Kegel</A> [EMAIL PROTECTED] & <A HREF=\"http://alumni.caltech.edu/~huyle/\">Huy Le</A> [EMAIL PROTECTED], with revamp work by <A HREF=\"http://www.organic.com\">Brian Behlendorf</A> [EMAIL PROTECTED]</SMALL>\n"; } else { print "<head><title>SPR Front End</title></head> <H1>SPR Front End</H1> *************** *** 250,256 **** # Sends the new PR sub handle_send_pr { # Display title ! print "<head><title>New Problem Report submission</title></head><body>"; # Get arguments local($_)=scalar(<STDIN>); --- 257,263 ---- # Sends the new PR sub handle_send_pr { # Display title ! print "<head><title>Apache: New Problem Report Submission</title></head><body>"; # Get arguments local($_)=scalar(<STDIN>); *************** *** 263,282 **** $value = &cgi_trans($value); # By convention, multi-line fields have newlines at end of # each line. I think some browsers forget the last newline? ! if ($fieldnames_multi{$key} > 0 && $value !~ /\n$/) { ! $value .= "\n"; } $fieldvalues{$key}=$value; } # Verify arguments ! local($field); ! foreach $field ("Category") { ! if ($fieldvalues{$field} eq "") { ! print "<H3>Your problem report has not been sent.</H3>\n"; ! print "You must select a $field.\n"; ! return; } } # kludge --- 270,309 ---- $value = &cgi_trans($value); # By convention, multi-line fields have newlines at end of # each line. I think some browsers forget the last newline? ! if ($fieldnames_multi{$key} > 0) { ! # ! # Convert any CR-LFs or CRs to \n (different browsers use ! # different line terminators). ! # ! $value =~ s/\r\n/\n/g; ! $value =~ s/\r/\n/g; ! if ($value !~ /\n$/) { ! $value .= "\n"; ! } } $fieldvalues{$key}=$value; } # Verify arguments ! local($field, $ok, @emsgs) = (0, 1); ! foreach $field ("Synopsis", "emailaddr", "Environment", "Category", "Description") { ! local ($fieldval) = $fieldvalues{$field}; ! $fieldval =~ s/\s//g; ! if ($fieldval eq "") { ! push (@emsgs, $field); ! $ok = 0; ! } ! } ! if (! $ok) { ! print "<H3>Problem report not sent!</H3>\n"; ! print "Your problem report is missing required information:\n"; ! print "<UL>\n"; ! foreach $field (@emsgs) { ! print " <LI>$field\n </LI>\n"; } + print "</UL>"; + print "<P>Please go back to the form and correct this.</P>\n"; + return; } # kludge *************** *** 307,315 **** sub send_pr { # Display title ! print "<head><title>New Problem Report submission</title></head> <H2>New Problem Report form:</H2> <body> "; print "<FORM METHOD=\"POST\" ACTION=\"$SCRIPT_NAME/handle_send_pr\">\n"; --- 334,350 ---- sub send_pr { # Display title ! print "<head><title>Apache: New Problem Report submission</title></head> <H2>New Problem Report form:</H2> <body> + <BLOCKQUOTE> + <STRONG> + Please be aware that the Apache problem report database is PUBLICLY + ACCESSIBLE. The information you submit on this form will be available to + anyone on the Internet. Do not send information that you wish to remain + private. + </STRONG> + </BLOCKQUOTE> "; print "<FORM METHOD=\"POST\" ACTION=\"$SCRIPT_NAME/handle_send_pr\">\n"; *************** *** 363,369 **** print <<EOM <P> ! <B>Environment</B> - What operating system, at what patchlevel? What compiler? Etc.<BR> <TEXTAREA NAME="Environment" COLS=$width ROWS=$height></TEXTAREA><BR> <B>Synopsis</B> - a brief description of the problem at hand.<BR> <INPUT NAME="Synopsis" SIZE=$width><BR> --- 398,405 ---- print <<EOM <P> ! <B>Environment</B> - What operating system, at what patchlevel? ! What compiler? Etc. (The output from <CODE>uname -a</CODE> is very useful.)<BR> <TEXTAREA NAME="Environment" COLS=$width ROWS=$height></TEXTAREA><BR> <B>Synopsis</B> - a brief description of the problem at hand.<BR> <INPUT NAME="Synopsis" SIZE=$width><BR> *************** *** 488,493 **** --- 524,547 ---- $fieldvalues{'State'} = $input{'State'}; } + if ($input{"Class"} ne $fieldvalues{'Class'}) { + $change_msg .= "Class-Changed-From-To: $fieldvalues{'Class'}-$input{'Class'} + Class-Changed-By: $input{'Editor'} + Class-Changed-When: $date + "; + $to_old = $to_subm = 1; + $fieldvalues{'Class'} = $input{'Class'}; + } + + if ($input{"Severity"} ne $fieldvalues{'Severity'}) { + $change_msg .= "Severity-Changed-From-To: $fieldvalues{'Severity'}-$input{'Severity'} + Severity-Changed-By: $input{'Editor'} + Severity-Changed-When: $date + "; + $to_old = $to_subm = 1; + $fieldvalues{'Severity'} = $input{'Severity'}; + } + #print "if ($input{'Responsible'} ne $oldresp)\n"; if ($input{'Responsible'} ne $oldresp) { if ($input{'ResponsibleReason'} eq "") { *************** *** 633,638 **** --- 687,694 ---- local($oldsyn) = $fieldvalues{"Synopsis"}; local($oldstate) = $fieldvalues{"State"}; local($oldresp) = $fieldvalues{"Responsible"}; + local($oldclass) = $fieldvalues{"Class"}; + local($oldsev) = $fieldvalues{"Severity"}; $oldresp =~ s/\s*\(.*$//; # Get rid of comment in responsible party name local($timestamp)=×tamp($fullpr); *************** *** 662,667 **** --- 718,743 ---- } print "</SELECT><BR>\n"; + print " + <dt>Class: + <dd><SELECT NAME=\"Class\">\n"; + for (sort (@nClass)) { + $sel = ""; + $sel = " SELECTED" if ($_ eq $oldclass); + print "<OPTION$sel> $_\n"; + } + print "</SELECT><BR>\n"; + + print " + <dt>Severity: + <dd><SELECT NAME=\"Severity\">\n"; + for (sort (@nSeverity)) { + $sel = ""; + $sel = " SELECTED" if ($_ eq $oldsev); + print "<OPTION$sel> $_\n"; + } + print "</SELECT><BR>\n"; + print "<dt>New <a href=\"$GNUINFOSCRIPT?(gnats.info)States\">state</a>:\n"; print "<dd>"; print "<SELECT NAME=\"State\">\n"; *************** *** 1062,1068 **** sub query_full { local($pr) = $_[0]; ! print "<head><title>Full Problem Report Text</title></head> <body> "; if ($pr eq "") { --- 1138,1144 ---- sub query_full { local($pr) = $_[0]; ! print "<head><title>Full Problem Report Text for PR#$pr</title></head> <body> "; if ($pr eq "") {