###############################################
# Greymatter 1.3.1 #
# Build 208 #
# Main Library #
# Copyright (c)2000-2005, The Greymatter team #
# http://www.greymatterforums.com/ #
###############################################
$cookiename = "gm_password";
# *** Your possession of this software indicates that you agree to the terms ***
# *** specified under the "Copyright & Usage" heading in the "manual.html" file. ***
# Patch for weekdayshort and monthwordshort variables
# provided by Rae (rae@tnir.org)
# c&p'ed in by domesticat
# (gmstuff@domesticat.net)
# -----------------
# program variables
# -----------------
$gmversion = "1.3.1";
$gmfonttag = qq();
$gmheadtag = qq#
$gmfonttaggreymatter $gmversion
);
$statusnote = "";
# ------------------
# emoticons subroutine
# ------------------
# added by flipped cracker 9/17/2003
# version 1.3
sub gm_emoticons {
&gm_readconfig;
$_ = shift;
if( (($emoticonsallowed eq "both") || ($emoticonsallowed eq $returnto)) && ($thisentryemoticonsallowed eq "yes") ) {
s/\:\)//g;
s/\:O//g;
s/\:\(//g;
s/\:D//g;
s/\:P//g;
s/\;\)//g;
s/\:angry://g;
s/\:blush://g;
s/\:confused://g;
s/\:cool://g;
s/\:crazy://g;
s/\:cry://g;
s/\:doze://g;
s/\:hehe://g;
s/\:laugh://g;
s/\:plain://g;
s/\:rolleyes://g;
s/\:satisfied://g;
}
return($_);
}
# merged in version 1.3
# ------------------
# emoticons code display subroutine
# ------------------
# added by flipped cracker 9/17/2003
# version 1.3
sub gm_emoticons_code {
&gm_readconfig;
$emoticonsmaincode = "";
if( ($emoticonsallowed eq "both") || ($emoticonsallowed eq "entries") ) {
$emoticonsmaincode = "
);
$gmframebottomtwo = qq($gmfonttag);
$gmframetoptwo = qq( $gmfonttag);
$gmframebottom = qq(
); }
&gm_readconfig;
if ($cookiesallowed eq "no") {
$getnameandpwcookie = "";
} else {
$getnameandpwcookie = "";
}
print< "Not knowing when the dawn will come, I open every door."Emily Dickinson
$getnameandpwcookie
$gmframebottom
GMLOGIN
exit;
}
# ------------------
# validate the login
# ------------------
sub gm_validate {
&gm_bancheck;
&gm_readconfig;
$gmvalidated = "no";
$gmentryaccess = "no";
$gmentryeditaccess = "no";
$gmconfigurationaccess = "no";
$gmtemplateaccess = "no";
$gmauthoraccess = "no";
$gmcplogaccess = "no";
$gmrebuildaccess = "no";
$gmbookmarkletaccess = "no";
$gmuploadaccess = "no";
$gmloginaccess = "no";
$IN{'authorname'} =~ s/\|//g;
$IN{'authorpassword'} =~ s/\|//g;
$IN{'authorname'} =~ s/^\s+//;
$IN{'authorname'} =~ s/\s+$//;
$IN{'authorpassword'} =~ s/^\s+//;
$IN{'authorpassword'} =~ s/\s+$//;
########################################################################
## gm_validate extension to allow a rebuild operation without a password
## by passing a token reference instead. added by linear 9/3/2003
########################################################################
# merged in 1.3
if (($IN{'authorname'} eq "") || ($IN{'authorpassword'} eq "")) {
unless($IN{'gmtoken'}) {
$loginnotice = qq(You left one or more of the fields blank. Please try again. );
&gm_writetocplog("Invalid login attempt: One or more fields left blank ($IN{'authorname'} $IN{'authorpassword'})");
&gm_login;
}
}
if ($IN{'gmtoken'} && $IN{'rebuilding'}) {
# read the token from the file where we persisted it
open (TOKENPLEASE, "$EntriesPath/gm-token.cgi") || &gm_dangermouse("Can't read the token file.");
@gmtoken = );
&gm_writetocplog("Invalid login attempt: Incorrect password ($IN{'authorpassword'}) for $IN{'authorname'}");
&gm_login;
}
if ($gmvalidated ne "yes") {
$loginnotice = qq(No such author is registered. Please try again. );
&gm_writetocplog("Invalid login attempt: No such author as $IN{'authorname'} ($IN{'authorpassword'}) registered");
&gm_login;
}
}
# --------------------------
# check if this IP is banned
# --------------------------
sub gm_bancheck {
open (FUNNYFEETBABY, "./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; also try running Diagnostics & Repair from the Configuration screen.");
@gmbanlist = $gmfonttag Author: $gmfonttag $gmfonttag Password: $gmfonttag