open (FUNNYFEET, "$EntriesPath/$newcommententrynumberpadded.cgi") || &gm_dangermouse("Can't open $EntriesPath/$newcommententrynumberpadded.cgi. Please make sure your paths are configured correctly and that your entries/archives directory is CHMODed to 777.");
open (FUNNYFEET, "gm-banlist.cgi") || &gm_dangermouse("Can't read the banlist file. Please make sure that gm-banlist.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files.");
if (($keeplog eq "yes") && ($logkarmaandcomments eq "yes")) {
&date;
open (FUNNYFEET, ">>gm-cplog.cgi") || &gm_dangermouse("Can't write to the control panel log. Please make sure that gm-cplog.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files.");
print FUNNYFEET "<FONT SIZE=1>[$basedate] [$userip]</FONT> <FONT COLOR=\"#FF0000\"><B>A banned IP ($checkthisip/$checkthisiphost";
if ($checkthisperson ne "") { print FUNNYFEET ", \"$checkthisperson\""; }
if ($IN{'gmsearch'} ne "") {
print FUNNYFEET ") attempted to search for \"$IN{'gmsearch'}\"</FONT>\n";
} else {
print FUNNYFEET ") attempted to post a comment to entry #$IN{'newcommententrynumber'}</B> ($IN{'newcommentauthor'}: $IN{'newcommentbody'})</FONT>\n";
}
close (FUNNYFEET);
}
print "Content-type: text/html\n\n";
print<<GMBANNEDNOTICE;
$gmheadtag
$gmframetop
You have been banned from using this site.<BR>(IP: $userip)
$gmframebottom
</BODY>
</HTML>
GMBANNEDNOTICE
exit;
}
}
}
}
# -------------------------------
# check if comments can be posted
# -------------------------------
sub gm_allowedcheck {
if (($posttoarchives eq "no") && ($thisentrynumber <= $newarchivenumber)) {
if (($keeplog eq "yes") && ($logkarmaandcomments eq "yes")) {
&date;
open (FUNNYFEET, ">>gm-cplog.cgi") || &gm_dangermouse("Can't write to the control panel log. Please make sure that gm-cplog.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files.");
print FUNNYFEET "<FONT SIZE=1>[$basedate] [$userip]</FONT> A comment was blocked from being added to archived entry #$IN{'newcommententrynumber'} ($IN{'newcommentauthor'}: $IN{'newcommentbody'})\n";
close (FUNNYFEET);
}
print "Content-type: text/html\n\n";
print<<GMARCHIVEDISALLOWEDNOTICE;
$gmheadtag
$gmframetop
SorryĆ¹comments cannot be posted to archived entries. Please use your browser's Back button to return.
if (($keeplog eq "yes") && ($logkarmaandcomments eq "yes")) {
&date;
open (FUNNYFEET, ">>gm-cplog.cgi") || &gm_dangermouse("Can't write to the control panel log. Please make sure that gm-cplog.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files.");
print FUNNYFEET "<FONT SIZE=1>[$basedate] [$userip]</FONT> A comment was blocked from being added to entry #$IN{'newcommententrynumber'} ($IN{'newcommentauthor'}: $IN{'newcommentbody'})\n";
close (FUNNYFEET);
}
print "Content-type: text/html\n\n";
print<<GMCOMMENTBLOCKEDNOTICE;
$gmheadtag
$gmframetop
SorryĆ¹comments cannot be posted to this entry. Please use your browser's Back button to return.
$gmframebottom
</BODY>
</HTML>
GMCOMMENTBLOCKEDNOTICE
exit;
}
}
# ------------------------------
# check if subj or body is blank
# ------------------------------
sub gm_blankcheck {
if (($IN{'newcommentauthor'} eq "") || ($IN{'newcommentbody'} eq "")) {
print "Content-type: text/html\n\n";
print<<GMBLANKNOTICE;
$gmheadtag
$gmframetop
You left either your name or your comments blank. Please use your browser's Back button to return.
open (FUNNYFEET, ">$EntriesPath/$newcommententrynumberpadded.cgi") || &gm_dangermouse("Can't write to $EntriesPath/$newcommententrynumberpadded.cgi. Please make sure that your paths are configured correctly and that your entries/archives directory is CHMODed to 777.");
open (THISFILE, ">$EntriesPath/$thisentrynumberpadded.$entrysuffix") || &gm_dangermouse("Can't write to $EntriesPath/thisentrynumberpadded.$entrysuffix. Please make sure that your paths are configured correctly and that your entries/archives directory is CHMODed to 777.");;
print THISFILE $entryreturn;
close (THISFILE);
if ($thisentrynumber <= $newarchivenumber) {
&gm_readcounter;
$stoppednumber = $newarchivenumber;
do { &gm_generatearchive($stoppednumber); } until $stoppednumber <= 1;
} else {
&gm_generatemainindex;
}
&gm_readconfig;
if (($NotifyForStatus eq "comments") || ($NotifyForStatus eq "both")) {
open (MAIL, "|$sendithere") || &gm_dangermouse("Can't open the mail program at $mailprog. Please make sure you have this configured correctly.");
print MAIL <<__MAILNOTIFY__;
To: $destinationow
From: Greymatter <$destinationow>
Subject: [Greymatter] Notice: Comment Posted
A comment has just been posted to entry #$IN{'newcommententrynumber'} ($thisentrysubject).
Name: $IN{'newcommentauthor'} (IP: $userip)
E-Mail: $IN{'newcommentemail'}
Homepage: $IN{'newcommenthomepage'}
Comments: $formattedcomment
Posted to: $aftermath
-----
Greymatter $gmversion
http://noahgrey.com/greysoft/
__MAILNOTIFY__
close(MAIL);
}
}
}
if (($keeplog eq "yes") && ($logkarmaandcomments eq "yes")) {
&date;
open (FUNNYFEET, ">>gm-cplog.cgi") || &gm_dangermouse("Can't write to the control panel log. Please make sure that gm-cplog.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files.");
print FUNNYFEET "<FONT SIZE=1>[$basedate] [$userip]</FONT> <I>$IN{'newcommentauthor'} added a comment to entry #$IN{'newcommententrynumber'} ($thisentrysubject)</I>\n";
if (($keeplog eq "yes") && ($logkarmaandcomments eq "yes")) {
&date;
open (FUNNYFEET, ">>gm-cplog.cgi") || &gm_dangermouse("Can't write to the control panel log. Please make sure that gm-cplog.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files.");
print FUNNYFEET "<FONT SIZE=1>[$basedate] [$userip]</FONT> <I>A search was performed for \"$IN{'gmsearch'}\" ($searchmatchescount matches)</I>\n";
close (FUNNYFEET);
}
exit;
#### script kiddie check added by linear 2/10/2003
We don't take kindly to that sort of activity here. Your attempt to break the script has been logged and the administrators have been notified.
<br>[$basedate] [$userip]
$gmframebottom
</BODY>
</HTML>
GMHACKNOTICE
$keepphphackloglog = 1; # set to 0 if you just don't care
if ($keepphphacklog) {
open (BOZO, ">>gm-phphacklog.cgi") || &gm_dangermouse("Can't write to the dumbass h4x0r log. Please make sure that gm-dumbasslog.cgi is CHMODed to 666 and is in the same place as all your other Greymatter CGI files.");
print BOZO "[$basedate] [$userip] A hacker was blocked from a PHP attack against archived entry #$IN{'newcommententrynumber'} ($IN{'newcommentauthor'}: $IN{'newcommentbody'})\n";