<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/athena/bin/perl

unshift(@INC, '/var/www/cgi-bin/lib');

require 'parseform.pl';

$regfile = '/tmp/regfile';
$logfile = '/var/www/logs/reg_activity.log';

if (! $ENV{'QUERY_STRING'})
{
    print "Location: /doc/activity-guidelines.html\n\n";
    exit;
}

&amp;reg_activity();

sub reg_activity {
    local($query);

    $query = $ENV{'QUERY_STRING'};
    %form = &amp;parseform($query);

    while (-e $regfile) { sleep 3; }

    print "Content-Type: text/html\n\n";
    print "&lt;head&gt;\n";
    print "&lt;link rev=made href=\"tritan\@mit.edu\"&gt;\n";
    print "&lt;link rev=owns href=\"webmaster\@mit.edu\"&gt;\n";
    print "&lt;title&gt;register output&lt;/title&gt;\n";
    print "&lt;/head&gt;\n";
    print "&lt;body&gt;\n";

    if (!open(REGFILE, "&gt;$regfile")) {
      print "&lt;p&gt;Internal Error (1) processing request. Sorry.&lt;/p&gt;\n";
      print "&lt;p&gt;Try again later or send mail to ",
            "&lt;a href=\"mailto:webmaster\@mit.edu\"&gt;webmaster\@mit.edu&lt;/a&gt;.",
            "&lt;/p&gt;\n";
    } else {
      print "&lt;h1&gt;Activity Registered&lt;/h1&gt;\n";

      print "Your activity is now registered with the SIPB ";
      print "webmasters. Below is the information that you provided.";
      print "&lt;p&gt;\n";

      print "Please verify the correctness of the information below. ";
      print "If there are any errors, please re-submit your request.";
      print "&lt;p&gt;\n";

      print "Once your activity has been placed on the SIPB activities ";
      print "page, your contact person should receive email confimation.";
      print "&lt;p&gt;\n";

      print "If you have any questions, please send email to ";
      print "&lt;a href=\"mailto:webmaster\@mit.edu\"&gt;webmaster\@mit.edu&lt;/a&gt;.";
      print "&lt;p&gt;\n";

      print "&lt;hr&gt;\n";

      print "&lt;strong&gt;Activity name =&lt;/strong&gt; \"$form{'name'}\"&lt;br&gt;\n";
      print "&lt;strong&gt;Category      =&lt;/strong&gt; \"$form{'category'}\"&lt;br&gt;\n";
      print "&lt;strong&gt;Contact       =&lt;/strong&gt; \"$form{'contact'}\"&lt;br&gt;\n";
      print "&lt;strong&gt;Home page     =&lt;/strong&gt; \"$form{'location'}\" ";
      print "($form{'type'})&lt;br&gt;\n";
      print "&lt;strong&gt;Icon          =&lt;/strong&gt; \"$form{'icon'}\" ";
      print "($form{'icon_type'})&lt;br&gt;\n";
      print "&lt;strong&gt;Blurb:&lt;/strong&gt;&lt;br&gt;\n";
      print "&lt;blockquote&gt;\n";
      print $form{'blurb'};

      print "&lt;/blockquote&gt;\n";
    }

    print "&lt;hr&gt;\n";

    print "&lt;address&gt;\n";
    print "&lt;a href=\"/webmasters.html\"&gt;webmaster\@mit.edu&lt;/a&gt;\n";
    print "&lt;/address&gt;\n";
    print "&lt;/body&gt;\n";

    print REGFILE "From: webmaster\@mit.edu\n";
    print REGFILE "To: webmaster\@mit.edu\n";
    $new_name = $form{'name'};
    chomp($new_name);
    if (length($new_name) &gt; 80)
    {
	$new_name = "";
    }
    elsif ($new_name !~ /^[A-Za-z0-9!\@\$&amp;\*\(\)_\+:'",\.\?\/ \t-]+$/)
    {
        $new_name = "";
    }
    print REGFILE "Subject: Activity Registration Request from $new_name\n\n";
    print REGFILE "*** Activity Registration Request ***\n\n";
    print REGFILE "Activity name = $form{'name'}\n";
    print REGFILE "Category      = $form{'category'}\n";
    print REGFILE "Contact       = $form{'contact'}\n";
    print REGFILE "Location      = $form{'location'} ($form{'type'})\n";
    print REGFILE "Icon          = $form{'location'} ($form{'icon_type'})\n";
    print REGFILE "Blurb:\n";
    print REGFILE "$form{'blurb'}\n\n";

    print REGFILE "Semi-Automatic-Activity-HTML (void where prohibited):\n";
    print REGFILE "&lt;a href=\"$form{'location'}\"&gt; &lt;/a&gt; $form{'blurb'}\n";
    print REGFILE "&lt;!-- Contact=\"$form{'contact'}\" --&gt;\n";

    close(REGFILE);

    system("/usr/sbin/sendmail -t -fwebm-mtg\@charon.mit.edu &lt; $regfile");
    if (-e $logfile) {
      system("/usr/bin/tail +5 $regfile &gt;&gt; $logfile");
    } else {
      system("/usr/bin/tail +5 $regfile &gt; $logfile");
    }
    unlink($regfile);
}

1;
</pre></body></html>