#!/usr/bin/perl # # Send-pr perl script to send a pr. # # Copyright (c) 1996 Free Range Media # # Copying and distribution permitted under the conditions of the # GNU General Public License Version 2. # (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 $ require "html.pl"; sub prerror { &html_title ("Problem Report Error"); &html_body(); print "There is an error in the configuration of the problem\n", "report form genator. Please back up one page and report\n", "the problem to the owner of that page. Report @_[0]."; &html_end(); exit (1); } &www_content ("text","html"); &cgi_form_in(); $gndb = $cgi_data{'gndb'}; if ($gndb =~ /^[a-z]+$/ && -e "$gndb.def") { require "$gndb.def"; } else { &prerror("gndb problem"); } &prerror("request method problem") if $ENV{'REQUEST_METHOD'} eq 'GET'; # Configuration if ($gnhow eq "mail") { if (-e "/usr/lib/sendmail") { $submitprog = "/usr/lib/sendmail -t" }; if (-e "/usr/sbin/sendmail") { $submitprog = "/usr/sbin/sendmail -t" }; } else { if (-e "$gnroot/queue-pr") { $submitprog = "$gnroot/queue-pr -q" }; } if (!$submitprog) { &prerror("submit program problem"); } &html_title ($gnspreptitle); &html_body ($gnsprepbody); # Verify the data ... if (!$cgi_data{'email'} || !$cgi_data{'originator'} || !$cgi_data{'synopsis'}) { if ($gnsprepbad && -e $gnsprepbad ) { print `cat $gnsprepbad`; } else { print "
$submitprog\n\n$pr\n"; if (open (SUBMIT, "|$submitprog")){ print SUBMIT $pr; close (SUBMIT); if ($gnspreppage && -e $gnspreppage ) { print `cat $gnspreppage`; } else { print "