Removed unused cgi scripts

This commit is contained in:
Jonas Oberg committed 2017-11-21 09:46:59 +01:00
1 parent b67c64da4a
commit 1fadbdfdc6
12 files changed
+1 -1064

No files matched your search

-20
View File
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<textset>
<errors>
<text id="error">An error occured when attempting to send your
message.</text>
<text id="missing_first_name">Please specify your name.</text>
<text id="missing_family_email">Please specify your e-mail.</text>
<text id="missing_tel_gsm">Please specify your phone number.</text>
<text id="invalid_email">This e-mail is not valid.</text>
<text id="invalid_invoice_address">The invoice is too long.</text>
<text id="invalid_comment">The comment is too long.</text>
</errors>
<response>
<text id="1">
Your reservation was successful!
You will recieve a confirmation per email soon.
</text>
</response>
</textset>
-75
View File
@@ -1,75 +0,0 @@
#!/usr/bin/perl
use utf8;
use strict;
use warnings;
use File::Basename;
use Cwd "abs_path";
use CGI;
use POSIX qw(strftime);
use Text::Wrap;
$Text::Wrap::columns = 72;
our $base_directory;
BEGIN { $base_directory = dirname(abs_path("../tools/WebBuild")); }
use lib $base_directory;
use WebBuild::FormValidation;
use WebBuild::DynamicContent;
my $form = WebBuild::FormValidation->new;
my $content = WebBuild::DynamicContent->new;
my $query = new CGI;
$form->validates_presence_of("first_name");
$form->validates_presence_of("family_name");
$form->validates_presence_of("tel_gsm");
$form->validates_format_of("email", type => "email");
$content->layout("../events/clt/clt-bus.de.html");
if ($form->has_errors) {
$content->content($form->get_errors);
$content->render;
exit;
}
my $date = strftime "%Y-%m-%d", localtime;
my $time = strftime "%s", localtime;
open(MAIL, "|/usr/lib/sendmail -t -f birgit.huesken\@fsfe.org");
print MAIL "Reply-To: " . $query->param("email") . "\n";
print MAIL "From: office\@fsfeurope.org\n";
print MAIL "To: birgit.huesken\@fsfe.org\n";
print MAIL "Cc: dus\@office.fsfeurope.org\n";
my $subject = "New reservation for the CLT Bus from " . $query->param("first_name") . " " . $query->param("family_name");
print MAIL "Subject: $subject" . "\n";
print MAIL "Content-Type: text/plain; charset=UTF-8\n\n";
print MAIL "We have received a new reservation for the CLT Bus.\n\n";
print MAIL "Name: " . $query->param("first_name") . " " . $query->param("family_name") . "\n";
print MAIL "Phone: " . $query->param("tel_gsm") . "\n";
print MAIL "E-mail: " . $query->param("email") . "\n\n";
print MAIL "Station: " . $query->param("station") . "\n\n";
print MAIL "---\nInvoice address:\n";
print MAIL wrap('','',$query->param("invoice_address")) . "\n";
print MAIL "---\nComment:\n";
print MAIL wrap('','',$query->param("comment")) . "\n";
print MAIL "---\n\n";
my $output = <<ENDHTML;
<div id="flash">
<p>
Deine Daten wurden gesendet. Wir werden uns schnellstmoeglich mit
Dir in Verbindung setzen.
</p>
</div>
ENDHTML
$content->content($output);
$content->render;
-20
View File
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<textset>
<errors>
<text id="error">An error occured when attempting to send your
message.</text>
<text id="missing_first_name">Please specify your name.</text>
<text id="missing_family_email">Please specify your e-mail.</text>
<text id="missing_tel_gsm">Please specify your phone number.</text>
<text id="invalid_email">This e-mail is not valid.</text>
<text id="invalid_invoice_address">The invoice is too long.</text>
<text id="invalid_comment">The comment is too long.</text>
</errors>
<response>
<text id="1">
Your reservation was successful!
You will recieve a confirmation per email soon.
</text>
</response>
</textset>
-110
View File
@@ -1,110 +0,0 @@
#!/usr/bin/perl
use utf8;
use strict;
use warnings;
use File::Basename;
use Cwd "abs_path";
use CGI;
use POSIX qw(strftime);
use Text::Wrap;
$Text::Wrap::columns = 72;
our $base_directory;
BEGIN { $base_directory = dirname(abs_path("../tools/WebBuild")); }
use lib $base_directory;
use WebBuild::FormValidation;
use WebBuild::DynamicContent;
my $form = WebBuild::FormValidation->new;
my $content = WebBuild::DynamicContent->new;
my $query = new CGI;
# <input size="35" name="first_name" type="text">
# <input size="35" name="family_name" type="text">
# <input size="5" name="fellowship_no" type="text">
# <select size="3" name="room">
# <option>Doppelzimmer, Kat.1, 40,- EUR pro Nacht</option>
# <option>Einzelzimmer, Kat.1, 30,- EUR pro Nacht</option>
# <option>Doppelzimmer, Kat.3, 30,- EUR pro Nacht</option>
# <option>Einzelzimmer, Kat.3, 22,- EUR pro Nacht</option>
# </select>
#
# <input size="35" name="second_bed_name" type="text">
#
# <input name="like_to_share" value="yes" type="checkbox">
# <input name="sponsor_second_bed" value="yes" type="checkbox">
#
# <input name="breakfast_sa" value="yes" type="checkbox">
# <input name="breakfast_sa_no" value="yes" type="checkbox">
# <input name="breakfast_su" value="yes" type="checkbox">
# <input name="breakfast_su_no" value="yes" type="checkbox">
#
# <textarea cols="35" rows="5" name="invoice_address"> </textarea>
#
# <input size="35" name="tel_gsm" type="text">
# <input size="35" name="email" type="text">
#
# <textarea cols="60" rows="5" name="comment"> </textarea>
#
# <input name="send" value="Daten absenden" type="submit">
$form->validates_presence_of("first_name");
$form->validates_presence_of("family_name");
$form->validates_format_of("email", type => "email");
$content->layout("../events/clt/clt-hotel.de.html");
if ($form->has_errors) {
$content->content($form->get_errors);
$content->render;
exit;
}
my $date = strftime "%Y-%m-%d", localtime;
my $time = strftime "%s", localtime;
open(MAIL, "|/usr/lib/sendmail -t -f birgit.huesken\@fsfe.org");
print MAIL "Reply-To: " . $query->param("email") . "\n";
print MAIL "From: office\@fsfeurope.org\n";
print MAIL "To: birgit.huesken\@fsfe.org\n";
my $subject = "New reservation for the CLT Hotel from " . $query->param("first_name") . " " . $query->param("family_name");
print MAIL "Subject: $subject" . "\n";
print MAIL "Content-Type: text/plain; charset=UTF-8\n\n";
print MAIL "We have received a new reservation for the CLT Hotel.\n\n";
print MAIL "Name: " . $query->param("first_name") . " " . $query->param("family_name") . "(Fellowhsip Nummer: " . $query->param("fellowship_no") . ")\n";
print MAIL "Phone: " . $query->param("tel_gsm") . "\n";
print MAIL "E-mail: " . $query->param("email") . "\n\n";
print MAIL "Room: " . $query->param("room") . "\n";
print MAIL "---\nDoppelzimmer?\n";
print MAIL "Second bed name: " . $query->param("second_bed_name") . "\n";
print MAIL "Like to share?: " . $query->param("like_to_share") . "\n";
print MAIL "Sponsor second bed: " . $query->param("sponsor_second_bed") . "\n";
print MAIL "Breakfast Samstag?: " . $query->param("breakfast_sa") . "\n";
print MAIL "Breakfast Samstag number: " . $query->param("breakfast_sa_no") . "\n";
print MAIL "Breakfast Samstag?: " . $query->param("breakfast_su") . "\n";
print MAIL "Breakfast Samstag?: " . $query->param("breakfast_su_no") . "\n";
print MAIL "---\nInvoice address:\n";
print MAIL wrap('','',$query->param("invoice_address")) . "\n";
print MAIL "---\nComment:\n";
print MAIL wrap('','',$query->param("invoice_address")) . "\n";
print MAIL "---\n\n";
my $output = <<ENDHTML;
<div id="flash">
<p>
Your message was sent, and we will get in touch with you very
soon.
</p>
</div>
ENDHTML
$content->content($output);
$content->render;
-18
View File
@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<textset>
<errors>
<text id="error">An error occured when attempting to send your
message.</text>
<text id="missing_name">Please specify your name.</text>
<text id="missing_email">Please specify your e-mail.</text>
<text id="missing_message">Please specify a message.</text>
<text id="invalid_email">This e-mail is not valid.</text>
<text id="invalid_message">This message is too short.</text>
</errors>
<response>
<text id="1">Your message has been dispatched! You will recieve a
reply from our office soon.</text>
</response>
</textset>
-73
View File
@@ -1,73 +0,0 @@
#!/usr/bin/perl
use utf8;
use strict;
use warnings;
use File::Basename;
use Cwd "abs_path";
use CGI;
use POSIX qw(strftime);
use Text::Wrap;
$Text::Wrap::columns = 72;
our $base_directory;
BEGIN { $base_directory = dirname(abs_path("../tools/WebBuild")); }
use lib $base_directory;
use WebBuild::FormValidation;
use WebBuild::DynamicContent;
my $form = WebBuild::FormValidation->new;
my $content = WebBuild::DynamicContent->new;
my $query = new CGI;
$form->validates_presence_of("name");
$form->validates_format_of("email", type => "email");
$form->validates_length_of("message", min => 5, max => 2500);
$content->layout("../contact/contact.en.html");
if ($form->has_errors) {
$content->content($form->get_errors);
$content->render;
exit;
}
my $date = strftime "%Y-%m-%d", localtime;
my $time = strftime "%s", localtime;
open(MAIL, "|/usr/lib/sendmail -t -f ato\@fsfe.org");
print MAIL "Reply-To: " . $query->param("email") . "\n";
print MAIL "From: office\@fsfeurope.org\n";
print MAIL "To: office\@fsfeurope.org,nicoulas\@fsfe.org\n";
print MAIL "Cc: ato\@fsfe.org\n";
my $subject = $query->param("subject");
if ($subject eq "") {
$subject = "New message from website from " . $query->param("name");
}
print MAIL "Subject: $subject" . "\n";
print MAIL "Content-Type: text/plain; charset=UTF-8\n\n";
print MAIL "We have received a new message from our website contact form.\n\n";
print MAIL "Name: " . $query->param("name") . "\n";
print MAIL "E-mail: " . $query->param("email") . "\n\n";
print MAIL "---\n";
print MAIL wrap('','',$query->param("message")) . "\n";
print MAIL "---\n\n";
my $output = <<ENDHTML;
<div id="flash">
<p>
Your message was sent, and we will get in touch with you very
soon.
</p>
</div>
ENDHTML
$content->content($output);
$content->render;
-446
View File
@@ -1,446 +0,0 @@
#!/usr/bin/perl -w
# Copyright (C) 2001 Cyril Bouthors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# $Id: coposys,v 1.4 2003-02-01 15:24:12 jonas Exp $
#
use integer;
use diagnostics;
use sigtrap qw(SEGV BUS);
use strict qw(subs vars refs);
use subs qw(afunc blurfl);
use CGI qw/:standard/;
# people in the database
my %people;
# directory containing the marker files for xplanet
# named thecommunity.mark
my $markerdir='/home/www/var/coposys';
# markerfile
# format :
# latitude longitude "name" #password, date, email
my $filename;
#
# Syntax of CGI calls :
#
# coposys?community='thecommunity' : displays main form
# coposys?add&name=&password=&password2=&latitude=&longitude=&email=&community=
# coposys?update&name=&password=&latitude=&longitude=&email=&community=
# coposys?delete&name=&del_password=&community=
#
print header;
if (param('community')) {
$filename = $markerdir . '/' . param('community') . '.mark';
print '<b>Coposys $Revision: 1.4 $ </b>' , "\n\n",
"Manage members of a community </b>\n\n";
# form for adding a new member of the community
display_add_update_forms();
# display a refresh button
display_list_form();
treat_args();
# displays a list of members of the community, with a password field next to each to allow modifications
display_community();
}
else {
print start_html('error'), 'You need the community argument';
}
print end_html;
################################################################
sub display_add_update_forms {
my $date = localtime();
print start_html('Coposys.');
# Add part of the form
print "<table border=\"1\">\n";
print " <tr><td>",
"<b>Use this form to register in the community <i>".
param('community'). "</i></b> \n",
start_form,
" Full Name ", textfield('name'), "\n ", p,
"Password ",
password_field({name=>'password',size=>'8',maxlength=>8}), "\n ", p,
"Password (again) ",
password_field({name=>'password2',size=>8,maxlength=>8}), "\n ", p,
"Latitude ", textfield('latitude'), "\n ", p,
"Longitude ", textfield('longitude'), "\n ", p,
hidden({name=>'community'}), "\n ",
hidden({name=>'date',default=>$date}), "\n",
" Email ", textfield('email'), "\n ", p,
submit({name=>'add'}), "\n",
end_form, "\n\n";
print "</td>";
# Update part of the form
print "<td>",
"<b>Use this form to update your registration in the community <i>".
param('community'), "</i></b> \n",
start_form,
" Full Name ", textfield('name'), "\n ", p,
"Password ",
password_field({name=>'password',size=>'8',maxlength=>8}), "\n ", p,
"Latitude ", textfield('latitude'), "\n ", p,
"Longitude ", textfield('longitude'), "\n ", p,
hidden({name=>'community'}), "\n ",
hidden({name=>'date',default=>$date}), "\n",
" Email ", textfield('email'), "\n ", p,
submit({name=>'update'}), "\n",
"</td></tr>\n",
"</table>\n";
}
# displays an HTML form containing the refresh button
sub display_list_form {
print start_form, "\n ",
hidden({name=>'community'}), "\n ",
# displays a refresh button
submit({name=>'refresh'}), "\n",
end_form, "\n";
}
# execute actions depending on the form called
sub treat_args {
if ( param('add') ) {
if (
param('name') &&
param('password') &&
param('password2') &&
param('latitude') &&
param('longitude') &&
param('email') &&
param('community')
)
{
add_name();
}
else {
html_error('Missing argument !');
}
}
elsif ( param('update') ) {
if (
param('name') &&
param('password') &&
param('latitude') &&
param('longitude') &&
param('email') &&
param('community')
)
{
update_name();
}
else {
html_error('Missing argument or password entered twice for update !');
}
}
elsif ( param('delete') ) {
delete_name();
}
}
sub update_name {
my ($latitude, $longitude, $name, $password, $date, $email);
load_data();
# check if the name already exists..
if (!defined $people{param('name')} ) {
html_error(param('name') . ' I don\'t know you. ' .
'Please register first.');
}
# Check if password is correct...
my $crypted_passwd = (split /,/ , $people{param('name')})[3];
# get the salt from crypted_passwd
my $salt = $crypted_passwd;
$salt =~ s/^(..).*/$1/;
# and check for good pass...
if (crypt (param('password'), $salt) ne $crypted_passwd) {
html_error('Incorrect password !');
return;
}
# check if latitude is valid
unless ( param('latitude') =~ /^[\d\+\-\.]+$/ ) {
html_error('Invalid latitude: The format is +-DDD.DDDDDDDDDDDDDDD. ' .
'This is the format programs like xearth use and the ' .
'format that many positioning web sites use. However ' .
'typically the precision is limited to 4 or 5 decimals.');
return;
}
# check if longitude is valid
unless ( param('longitude') =~ /^[\d\+\-\.]+$/ ) {
html_error('Invalid longitude: The format is +-DDD.DDDDDDDDDDDDDDD. ' .
'This is the format programs like xearth use and the ' .
'format that many positioning web sites use. However ' .
'typically the precision is limited to 4 or 5 decimals.');
return;
}
# Now, write marker file with modifications
unless (open (CFG, ">$filename")) {
html_error("Unable to open marker file ($filename) !");
print end_html;
die;
}
foreach my $name (keys %people) {
if ($name eq param('name')) {
# the new value... No check is made, but it's not a good idea...
print CFG param('latitude') . ' ' .
param('longitude') .' "' . $name . '" #' .
$crypted_passwd . ',' . localtime() . ',' . param('email') . "\n";
next;
}
($latitude, $longitude, $crypted_passwd, $date, $email) =
(split /,/ , $people{$name})[0,1,3,4,5];
print CFG $latitude . ' '
. $longitude . ' "'
. $name . '" #' .
$crypted_passwd . ',' .
$date . ',' .
$email . "\n";
}
close CFG;
}
sub add_name {
load_data();
# check if we don't already have it
if ( defined $people{param('name')} ) {
html_error(param('name') . ' already exists !');
return;
}
# check if passwords match
if (param('password') ne param('password2')) {
html_error('Password mismatch !');
return;
}
# check if password is valid
unless ( param('password') =~ /^[\w\d]+$/ ) {
html_error('Invalid password: it should only contain alphanumerics !');
return;
}
# crypt password
my $randletter = "(int (rand (26)) + (int (rand (1) + .5) % 2 ? 65 : 97))";
my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
my $crypted_passwd = crypt (param('password'), $salt);
my $name=param('name');
$name=~s/"//g; #"
# check if latitude is valid
unless ( param('latitude') =~ /^[\d\+\-\.]+$/ ) {
html_error('Invalid latitude: The format is +-DDD.DDDDDDDDDDDDDDD. ' .
'This is the format programs like xearth use and the ' .
'format that many positioning web sites use. However ' .
'typically the precision is limited to 4 or 5 decimals.');
return;
}
# check if longitude is valid
unless ( param('longitude') =~ /^[\d\+\-\.]+$/ ) {
html_error('Invalid longitude: The format is +-DDD.DDDDDDDDDDDDDDD. ' .
'This is the format programs like xearth use and the ' .
'format that many positioning web sites use. However ' .
'typically the precision is limited to 4 or 5 decimals.');
return;
}
unless (open (CFG, ">>$filename")) {
html_error("Unable to open marker file ($filename) !");
print end_html;
die;
}
print CFG param('latitude') . ' ' . param('longitude') .
' "' . $name . '" #' .
$crypted_passwd .
',' . param('date') .
',' . param('email') . "\n";
close CFG;
}
sub display_community {
my ($latitude, $longitude, $name, $password, $date, $email);
load_data();
Delete('name');
print "<b>Members of the community <i>". param('community'). "</i> :</b> \n";
print "<table border=\"1\">\n";
print " <tr><td>Name</td><td>Latitude</td><td>Longitude</td>" ;
print "<td>Last update</td><td>Email</td></tr>\n";
foreach my $key (sort keys %people) {
($latitude, $longitude, $name, $password, $date, $email) =
split /,/ , $people{$key};
$email =~ s/\@/ AT /g;
$email =~ s/\./ DOT /g;
print " <tr>\n";
print " <td>$key</td>\n";
print " <td>$latitude</td>\n";
print " <td>$longitude</td>\n";
print " <td>$date</td>\n";
print " <td>$email</td>\n";
# print the piece of form allowing deletion of the name
print " <td>\n " . start_form, " ",
"password: ",
password_field({name=>'del_password',size=>8,maxlength=>8}), "\n ",
hidden({name=>'community'}), "\n ",
hidden({name=>'name', default=>$key}), "\n ",
submit({name=>'delete'}), "\n ",
end_form, "\n </td>\n";
print " </tr>\n";
}
print "</table>\n";
}
sub load_data {
my ($latitude, $longitude, $name, $password, $date, $email);
unless (open (CFG, $filename)) {
html_error("Unable to open marker file ($filename)!");
print end_html;
die;
}
while (<CFG>) {
s/^(.*) (.*) "(.*)" #(.*),(.*),(.*)$//;
($latitude, $longitude, $name, $password, $date, $email)
=($1,$2,$3,$4,$5,$6);
$people{$name}="$latitude,$longitude,$name,$password,$date,$email";
}
close CFG;
}
sub delete_name {
my ($latitude, $longitude, $name, $crypted_passwd, $date, $email);
load_data();
# check if password match
($crypted_passwd) = (split /,/ , $people{param('name')})[3];
# get the salt from crypted_passwd
my $salt = $crypted_passwd;
$salt =~ s/^(..).*/$1/;
if (crypt (param('del_password'), $salt) ne $crypted_passwd) {
html_error('Password mismatch when trying to delete !');
return;
}
unless (open (CFG, ">$filename")) {
html_error("Unable to open marker file ($filename) !");
print end_html;
die;
}
foreach my $name (keys %people) {
if ($name eq param('name')) {
delete $people{$name};
next;
}
($latitude, $longitude, $crypted_passwd, $date, $email) =
(split /,/ , $people{$name})[0,1,3,4,5];
print CFG $latitude . ' '
. $longitude . ' "'
. $name . '" #' .
$crypted_passwd . ',' .
$date . ',' .
$email . "\n";
}
close CFG;
}
sub html_error {
my $message = shift;
print '<p><font color="#FF0000">' . $message . "</font>\n";
}
-133
View File
@@ -1,133 +0,0 @@
#!/usr/bin/perl
use CGI qw(:standard escapeHTML);
use POSIX qw(strftime);
require "SpammerChk.pl";
# A form calling this CGI must have the following field:
# - eventid: a hidden field with the unique ID for the event. This is used for mapping below.
# - fullname: The full name of the registrant
# - email: The e-mail address of the registrant
# - comment: A textarea for comments from the registrant
# - The following paragraph for spam protection:
# <p class="n">
# Please do not put anything in here:
# <input type="text" size="40" name="link"/>
# </p>
# -----------------------------------------------------------------------------
# List of events
# -----------------------------------------------------------------------------
my %events = (
"sfd2011vienna" => "SFD 2011 Vienna",
);
# -----------------------------------------------------------------------------
# List of recipients for registration e-mails for events
# -----------------------------------------------------------------------------
my %recipient = (
"sfd2011vienna" => "sfd11vienna\@gollo.at",
);
# -----------------------------------------------------------------------------
# Get parameters
# -----------------------------------------------------------------------------
my $query = new CGI;
# Check if the script was called with an event ID
if ($query->param("eventid") eq '') {
goto OK;
}
my $eventid = $query->param("eventid");
my $fullname = escapeHTML($query->param("fullname"));
my $email = escapeHTML($query->param("email"));
my $comment = escapeHTML($query->param("comment"));
my $date = strftime "%Y-%m-%d", localtime;
my $time = strftime "%s", localtime;
my $eventname = $events{$eventid};
my $reference = "$eventid.$date." . substr $time, -3;
my $to1 = $recipient{$eventid};
my $subject = "$eventname registration $reference";
# -----------------------------------------------------------------------------
# Prevent SPAM
# -----------------------------------------------------------------------------
# Spam bots will be tempted to fill in this actually invisible field
if ($query->param("link")) {
goto OK;
}
$spamresult = SpammerChk::isSpammerEmail($email);
if ($spamresult) {
goto OK;
}
# -----------------------------------------------------------------------------
# Generate mail to responsible person
# -----------------------------------------------------------------------------
my $boundary = "NextPart$reference";
open(MAIL, "|/usr/lib/sendmail -t -f web\@fsfeurope.org");
print MAIL "From: web\@fsfeurope.org\n";
print MAIL "To: $to1\n";
print MAIL "Cc: ".$email."\n";
print MAIL "Subject: $subject\n";
print MAIL "Mime-Version: 1.0\n";
print MAIL "Auto-submitted: auto-generated\n";
print MAIL "Precedence: bulk\n";
print MAIL "Content-Type: multipart/mixed; boundary=$boundary\n";
print MAIL "Content-Transfer-Encoding: 8bit\n\n\n";
print MAIL "--$boundary\n";
print MAIL "Content-Type: text/plain; charset=utf-8\n";
print MAIL "Content-Transfer-Encoding: 8bit\n\n";
print MAIL "This registration for the event \"$eventname\" was sent via web interface\n\n";
print MAIL "--$boundary\n";
print MAIL "Content-Type: text/plain; charset=utf-8\n";
print MAIL "Content-Disposition: attachment; filename=$reference.txt\n";
print MAIL "Content-Description: Event registration\n";
print MAIL "Content-Transfer-Encoding: 8bit\n\n";
print MAIL "Registrant name: ".$fullname."\n\n";
print MAIL "E-mail address: ".$email."\n\n";
print MAIL "Comment: ".$comment."\n\n";
print MAIL "--$boundary--\n";
close MAIL;
# -----------------------------------------------------------------------------
# Inform user that everything was ok
# -----------------------------------------------------------------------------
OK:
print "Content-type: text/html\n\n";
print "<html>";
print "<head><title>Registration sent successfully</title></head>";
print "<body>";
print "<h1>Registration completed</h1>";
print "<p>";
print "Your registration $reference was sent. Thank you.<br /><br />";
print "Name: ".$fullname."<br />\n\n";
print "E-mail: ".$email."<br />\n\n";
print "Comment: ".$comment."<br />\n\n";
print "</p>";
print "</body>";
print "</html>";
-78
View File
@@ -1,78 +0,0 @@
#!/usr/bin/perl
use CGI;
use POSIX qw(strftime);
my $query = new CGI;
my $date = strftime "%Y-%m-%d", localtime;
my $time = strftime "%s", localtime;
my $reference = "nomination.$date." . substr $time, -5;
# technically we only need the last name for shipping
my $firstname = $query->param("firstname");
my $lastname = $query->param("lastname");
my $email = $query->param("email");
my $phone = $query->param("phone");
my $website = $query->param("website");
my $street = $query->param("street");
my $city = $query->param("city");
my $country = $query->param("country");
#my $address = $query->param("address");
my $biography = $query->param("biography");
my $motivation = $query->param("motivation");
my $lang = $query->param("language");
if (
# validate input (more or less)
$firstname and $lastname and
( $email
or $phone
or ($street
and $city
and $country)
)
and $website
and $biography and $motivation
and not $query->param("url")
) {
#send mail
open(MAIL, "|/usr/lib/sendmail -t -f noreply\@fsfe.org");
print MAIL
"Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
From: noreply\@fsfe.org
To: award\@fscons.org
Subject: [NFSA Nomination] $reference $firstname $lastname
This person was just nominated for a Nordic Free Software Award:
First Name: $firstname
Last Name: $lastname
EMail: $email
Phone: $phone
Website: $website
Address:
$street
$city
$country
Biography:
$biography
Motivation:
$motivation
Preferred language was: $lang
";
close MAIL;
print "Location: http://fsfe.org/activities/nordic-free-software-award/nfsa-nominate-thanks.$lang.html\n\n";
} else {
#something was wrong with the input
print "Location: http://fsfe.org/activities/nordic-free-software-award/nfsa-nominate-error.$lang.html\n\n";
}
-16
View File
@@ -1,16 +0,0 @@
#! /usr/bin/perl
use CGI;
if ($ENV{HTTP_REFERER} !~ /\.fsfeurope\.org/) {
print "HTTP/1.0 403 Forbidden\n";
print "Content-type: text/html\n\n";
print "Permission denied for referer $ENV{HTTP_REFERER}.\n";
exit 0;
}
my $q = new CGI;
print "HTTP/1.0 301 Moved\n";
print "Content-type: text/html\n";
print "Location: ".$q->param('address')."\n\n";
exit 0;
+1
View File
@@ -78,6 +78,7 @@ function send_registration_mail() {
$subject = "event registration: " . $_POST['name'];
$headers = "From: no-reply@fsfe.org\n"
. "MIME-Version: 1.0\n"
. "X-OTRS-Responsible: eal\n"
. "Content-Type: multipart/mixed; boundary=boundary";
mail($to, $subject, $message, $headers);
-75
View File
@@ -1,75 +0,0 @@
#!/usr/bin/perl
use CGI;
use POSIX qw(strftime);
use Digest::SHA1 qw(sha1_hex);
# -----------------------------------------------------------------------------
# Get parameters
# -----------------------------------------------------------------------------
my $query = new CGI;
my $amount = $query->param("amount");
if ($amount == "other") {
$amount = $query->param("amount_other");
}
my $language = $query->param("language");
my $text = $query->param("text");
my $amount100 = $amount * 100;
my $date = strftime("%Y-%m-%d", localtime);
my $time = strftime("%s", localtime);
my $reference = "elnticket.$date." . substr($time, -5);
# -----------------------------------------------------------------------------
# Generate form to forward payment request to PayPal or Concardis
# -----------------------------------------------------------------------------
print "Content-type: text/html\n\n";
open TEMPLATE, "/home/www/html/global/activities/ftf/tickets/tmpl-buy.$language.html";
while (<TEMPLATE>) {
if (/:FORM:/) {
my $passphrase = "Only4TestingPurposes";
my $shastring =
"ACCEPTURL=http://www.fsfe.org/activities/ftf/tickets/thankyou.$language.html$passphrase" .
"AMOUNT=$amount100$passphrase" .
"CANCELURL=http://www.fsfe.org/activities/ftf/tickets/cancel.$language.html$passphrase" .
"COM=$text$passphrase" .
"CURRENCY=EUR$passphrase" .
"LANGUAGE=$language$passphrase" .
"ORDERID=$reference$passphrase" .
"PMLISTTYPE=2$passphrase" .
"PSPID=40F00871$passphrase" .
"TP=http://www.fsfe.org/activities/ftf/tickets/tmpl-concardis.$language.html$passphrase";
my $shasum = uc(sha1_hex($shastring));
print " <form name=\"donate\" action=\"https://secure.payengine.de/ncol/prod/orderstandard.asp\" method=\"post\">\n";
print " <!-- payment parameters -->\n";
print " <input type=\"hidden\" name=\"PSPID\" value=\"40F00871\"/>\n";
print " <input type=\"hidden\" name=\"orderID\" value=\"$reference\"/>\n";
print " <input type=\"hidden\" name=\"com\" value=\"$text\"/>\n";
print " <input type=\"hidden\" name=\"amount\" value=\"$amount100\"/>\n";
print " <input type=\"hidden\" name=\"currency\" value=\"EUR\"/>\n";
print " <input type=\"hidden\" name=\"language\" value=\"$language\"/>\n";
print " <!-- interface template -->\n";
print " <input type=\"hidden\" name=\"TP\" value=\"http://www.fsfe.org/activities/ftf/tickets/tmpl-concardis.$language.html\"/>\n";
print " <input type=\"hidden\" name=\"PMListType\" value=\"2\"/>\n";
print " <!-- post-payment redirection -->\n";
print " <input type=\"hidden\" name=\"accepturl\" value=\"http://www.fsfe.org/activities/ftf/tickets/thankyou.$language.html\"/>\n";
print " <input type=\"hidden\" name=\"cancelurl\" value=\"http://www.fsfe.org/activities/ftf/tickets/cancel.$language.html\"/>\n";
print " <!-- SHA1 signature -->\n";
print " <input type=\"hidden\" name=\"SHASign\" value=\"$shasum\"/>\n";
print " <!-- Javascript submit() method only works if no submit button is active -->\n";
print " <noscript>\n";
print " <!-- submit button -->\n";
print " <input type=\"submit\" name=\"submit\" value=\"OK\"/>\n";
print " </noscript>\n";
print " </form>\n";
print " <script type=\"text/javascript\">document.donate.submit()</script>";
} else {
print;
}
}
close TEMPLATE;