#!/usr/bin/perl use English; require "/home/supadm/public_html/enlightenment/cgi-bin/cgi-lib.pl"; $ret=&ReadParse; # Get prayer data: ($pledge is the person's name) $pledge= $in{pledge}; ucfirst($pledge); $city=$in{city}; $state=$in{state}; $country=$in{country}; $verse=$in{verse}; $verselist="/home/supadm/public_html/enlightenment/services/verses.dat"; $versepage="/home/supadm/public_html/enlightenment/services/prayer.html"; $originalprayer="/home/supadm/public_html/enlightenment/services/originalprayer.dat"; # Call the subroutine to print the tops of cgi screens: &printHeader; # Keep showing the form until an email address is received: unless(defined($verse)) { &printAddForm; exit; } else { # Once we get the goods, say goodbye: &printGoodbye; # Now scrutinize the little bastard: #&runSecurityCheck; # If it's OK, then the routine didn't die, and we add or remove the address: if(exists($in{submitpassword})) { &addToVerseList; &makeHtmlPage; } if(exists($in{submitunsubscribe})) { &removeFromVerseList; &makeHtmlPage; } } ################################################ # SUBROUTINE DEFINITIONS sub makeHtmlPage { open (INFILE, "<$originalprayer") or print "
Can't see the original prayer
";
@original= ";
@stuff= ";
print OUTFILE " $verse
($pledge,
$city
$state
$country
)
We regret that so many must be left unnamed, but we are with you. This
is personal.
";
}
sub printAddForm
{
=pod
prints the html form that asks for the password and the username
=cut
print "
";
@pledgepeople= ";
#print back out the old verses:
foreach $person(@pledgepeople)
{
next if !($person=~/\S/);
chomp $person;
print OUTFILE "$person\n";
}
#put in the new verse:
$verse=~s/\n/ /g;
$verse=~s/ / /g;
print OUTFILE "$pledge|$city|$state|$country|$verse|\n";
close OUTFILE;
chmod (0666, "$verselist");
}
sub printHeader
{
## Print header:
print "Content-Type: text/html\n\n";
print "
think of our heroes and people lost
";
}
=cut
print" Read
Our
Prayer
";
}
";
foreach $thing (@stuff)
{
($pledge, $city, $state, $country, $verse) = split /\|/, $thing;
print OUTFILE "
\n";
}
print OUTFILE "
add
your expressions of gratitude, hope, or remembrance
Find Enlightenment
";
close OUTFILE;
chmod (0666, "$versepage");
}
sub runSecurityCheck
{
die if($email=~/\\/ ||$email=~/\// || $email=~/\s-/ ||
$email=~/\*/ || $email=~/http:/ || $email=~/\!/ || $email=~/\|/ ||
$email=~/\s/ || $email=~/\&/ || $email=~/\`/ || $email=~/\.\./);
# print "Ciao!
/ /g;
$verse=~s/