diff --git a/en/cgi/reg.cgi b/en/cgi/reg.cgi index 93064cc8c0..3e8fe5724c 100755 --- a/en/cgi/reg.cgi +++ b/en/cgi/reg.cgi @@ -1,107 +1,113 @@ #!/usr/bin/perl # # Perl program to send mail. # -# $FreeBSD$ +# $FreeBSD: www/en/cgi/reg.cgi,v 1.7 2000/04/03 08:45:51 phantom Exp $ + +sub do_header; +sub close_body; $mailprog = '/usr/sbin/sendmail'; print "Content-type: text/html\n\n"; if ($ENV{'REQUEST_METHOD'} eq "get") { $buffer = $ENV{'QUERY_STRING'}; } else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } @nvpairs = split(/&/, $buffer); foreach $pair (@nvpairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } if ($FORM{"emaila"} eq "") { print "\n"; print "\n"; print "Entry Error: Email Field Blank\n"; print "\n"; print "\n"; print "\n"; print "

Your email address was left blank. Please enter it.\n"; print "\n"; print "\n"; exit(0); } $recipient = $FORM{'recipient'}; exit(0) if $recipient !~ /^[a-z_\.\-]+\@freebsd\.org$/io; $sub_recipient = "majordomo\@FreeBSD.org"; # # format the mail file format MAIL = ~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $value . -# Open the mail file and write to it -open (MAIL, "|$mailprog $recipient") || die "$mailprog not available.\n"; -print MAIL "From: $FORM{'emaila'}\n"; -print MAIL "Subject: FreeBSD Registration from $FORM{'emaila'}\n\n"; - -print MAIL "\n"; -print MAIL "$FORM{'First'}\n"; -print MAIL "$FORM{'Last'}\n"; -print MAIL "$FORM{'emaila'}\n"; -print MAIL "

$FORM{'Address'}
\n"; -print MAIL "$FORM{'City'}\n"; -print MAIL "$FORM{'State'}\n"; -print MAIL "$FORM{'Zip'}\n"; -print MAIL ""; -print MAIL " \n"; -print MAIL "$FORM{'version'}\n"; -print MAIL "\n"; -print MAIL "\n"; -close (MAIL); +my ($sub_announce, $sub_security, $unsub_announce, $unsub_security) = (); +$sub_announce = 1 if $FORM{"announce"} eq "yes"; +$unsub_announce = 1 if $FORM{"announce"} eq "no"; +$sub_security = 1 if $FORM{"security-notifications"} eq "yes"; +$unsub_security = 1 if $FORM{"security-notifications"} eq "no"; # Open the mail file and write to it # if user is subscribing to maillist -if ($FORM{"announce"} eq "yes") { +# which they should be, otherwise why did they hit submit ? +if ( $sub_announce || $sub_security || $unsub_announce || $unsub_security ) { open (MAIL, "|$mailprog $sub_recipient") || die "$mailprog not available.\n"; print MAIL "From: $FORM{'emaila'}\n"; -print MAIL "Subject: subscribe freebsd-announce $FORM{'emaila'}\n\n"; +print MAIL "Subject: \n\n"; -print MAIL "subscribe freebsd-announce $FORM{'emaila'}\n"; +$sub_announce and print MAIL "subscribe freebsd-announce $FORM{'emaila'}\n"; +$unsub_announce and print MAIL "unsubscribe freebsd-announce $FORM{'emaila'}\n"; +$sub_security and print MAIL "subscribe freebsd-security-notifications $FORM{'emaila'}\n"; +$unsub_security and print MAIL "unsubscribe freebsd-security-notifications $FORM{'emaila'}\n"; close (MAIL); +} else { + &do_header("No action"); + print "

No action chosen, hence no action taken.

"; + &close_body; + exit; } -print "\n"; -print "\n"; -print "Mail Sent\n"; -print "\n"; -print "\n"; -print " \n"; -print "
\n"; -print "\n"; -print "\n"; -print "\n"; -print "\n"; -print "\n"; -print "\n"; -print "\n"; -print "\n"; -print "\n"; -print "\n"; -print "\n"; -print "\n"; -print "

Thank you, $FORM{'First'} $FORM{'Last'}, for your registration.\n"; -print "
It has been submitted.\n"; -if ($FORM{"announce"} eq "yes") { -print "
As you requested, you have also been subscribed to announce\@FreeBSD.org.\n"; + +&do_header("Subscription processed"); +print "

Thank you, $FORM{'emaila'}, for your submission.\n"; +print "
The request will need to be authenticated; check your mailbox "; +print "for instructions on how to do this.\n"; +&close_body; + +sub do_header { + my $title = @_; + print "\n"; + print "\n"; + print "$title\n"; + print "\n"; + print "\n"; + print " \n"; + print "

\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; } -print "
\n"; -print "\n"; +sub close_body { + print "
\n"; + print "\n"; + print "\n"; +} 1; + diff --git a/en/register.sgml b/en/register.sgml index a5d358d0f6..a2e448882f 100644 --- a/en/register.sgml +++ b/en/register.sgml @@ -1,119 +1,59 @@ + %includes; ]> &header; -
Register to receive the FreeBSD Newsletter and - subscribe to the announce@FreeBSD.org mailing list.
+
Subscribe to the announce@FreeBSD.org and + security-announce@FreeBSD.org mailing lists.
-
+
- - - - - - - - - - - - - - +
First Name:
Last Name:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - +
Email Address:
Address:
City:
Country/U.S. State: Country/Zip Code:
Do you wish to receive FreeBSD related - commercial email? - -
Subscribe listed email address to the - announce@FreeBSD.org mailing list? + Options for the + announce@FreeBSD.org mailing list: Subscribe
+ Unsubscribe
Sign up for FreeBSD Newsletter? + Options for the + security-notifications@FreeBSD.org mailing list: Subscribe
+ Unsubscribe

-

Preview a copy of the newsletter in Adobe - PDF format. A help - file is available to assist you in selecting and using a PDF - viewer.

- &footer;