here is the logon.cgi that i use on my board. and it works...
#!/usr/local/bin/perl
################################################################
# Logon System is copyright Vietmart Network, 2000.
#
# ------------ logon.cgi -------------
#
# This file contains the functionality for the UBB logon system.
#
# I offers no warranties on this script. The owner of the script is
# solely responsible for any problems caused by installation of
# the script or use of the script.
#
# All copyright notices regarding the Vietmart Network
# must remain intact on the scripts and in the HTML for the
# scripts. You may modify the code, but do not sell it.
#
# For more info on the Logon System,
# Contact me,
[email protected]################################################################
eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX / or Windows /
($0 =~ m,(.*)\[^\]+,) && unshift (@INC, "$1"); # Get the script location: Windows
require "UltBB.setup";
require "Styles.file";
require "ubb_library.pl";
};
#Active Redirect URL? Set 1 for yes, set 0 for no
$RedirectLogon = "1";
#Your Redirect URL (If you set 0 above. Leave it blank)
$RedirectLogonURL = "$CGIURL/Ultimate.cgi";
#Check Bans
$CheckBan = "1";
###################################
#No need to edit below
###################################
if ($CheckBan eq "1"){
&CheckBans;
}
if ($BGColor ne ""){
$BGColor = qq(bgcolor="$BGColor");
}
if ($AltColumnColor1 ne ""){
$AltColumnColor1 = qq(bgcolor="$AltColumnColor1");
}
if ($AltColumnColor2 ne ""){
$AltColumnColor2 = qq(bgcolor="$AltColumnColor2");
}
if ($CategoryStripColor ne ""){
$CategoryStripColor = qq(bgcolor="$CategoryStripColor");
}
if ($TableColorStrip ne ""){
$TableColorStrip = qq(bgcolor="$TableColorStrip");
}
if ($PageBackground ne ""){
$PageBackground = qq(background="$NonCGIURL/$PageBackground");
}
$LVersion = "1.2";
if ($TableBorderColor ne ""){
$TableWidth2 = "90%";
$BorderTop = qq(
);
} else {
$TableWidth2 = $TableWidth;
$BorderTop = "";
$BorderBottom = "";
}
&ReadParse;
use Socket;
if ($@) {
print ("Content-type: text/htmlnn");
print "Error including required files: $@n";
print "Make sure these files exist, permissions are set properly, and paths are set correctly.";
exit;
}
foreach $row(@in) {
($Name, $Value) = split ("=", $row);
$Name = &decodeURL($Name);
$Value = &decodeURL($Value);
if ($Name eq "UserName") {
$UserName = $Value;
$UserName = &UNHTMLIFY($UserName);
$UserNameFile = $UserName;
$UserNameFile =~ s/ /_/g; #remove spaces
}
if ($Name eq "PasswordConfirm") {
$PasswordConfirm = $Value;
}
} # end FOREACH $row
if ($VariablesPath eq "") {
$VariablesPath = $CGIPath;
}
print ("Content-type: text/htmlnn");
if ($in{'action'} eq "") {
&logon;
}
if ($in{'action'} eq "checkbioid") {
&CheckBioID;
}
## logonHTML ####
sub logon {
if ($DisplayRegistration eq "NO") {
$RegLinkHere = "";
} else {
$RegLinkHere = qq(
register |);
}
print<
$BBName - - Logon System
$HeaderInsert
Logon System. $LVersion
$Footer
logonHTML
}
##End logonHTML
sub GetBio {
$ProfileNumber = &GetUserNumber($UserName);
if ($ProfileNumber eq "") {
print<
$BBName - - Logon System
$HeaderInsert
Logon System. $LVersion
nolongerRG
exit;
}
@thisprofile = &OpenProfile("$ProfileNumber.cgi");
}
## END
sub CheckBioID {
if (($in{'UserName'} eq "") || ($in{'Password'} eq "")) {
if ($in{'UserName'} eq "") {
$RequireUserNameColor = "";
$ShowUserNameInBox = "";
$ErrorUFieldMessage = "username";
} else {
$RequireUserNameColor = "";
$ShowUserNameInBox = "value="$in{'UserName'}"";
}
if ($in{'Password'} eq "") {
$RequirePasswordColor = "";
$ShowPasswordInBox = "";
$ErrorPFieldMessage = "password";
} else {
$RequirePasswordColor = "";
$ShowPassowrdInBox = "value="$in{'Password'}"";
}
if (($in{'UserName'} eq "") && ($in{'Password'} eq "")) {
$ErrorAndMessage ="and";
} else {
$ErrorAndMessage = "";
}
print<
$BBName - Logon System
$HeaderInsert
Logon System. $LVersion
$Footer
notCL
} else {
$NameFound = "no";
$ProfileNumber = &GetUserNumber($UserName);
if ($ProfileNumber ne "") {
$NameFound = "yes";
} else {
$NameFound = "no";
}
if ($NameFound eq "yes") {
#Check Password Now
@thisprofile = &OpenProfile("$ProfileNumber.cgi");
if ($in{'Password'} eq "$thisprofile[1]") {
$pwmatch = "true";
$Password = $thisprofile[1];
if ($RedirectLogon == 1) {
&ProcessEditRedirect
} else {
&ProcessEdit;
}
}
} ## END IF MEMBER = Username.cgi condition
if ($NameFound ne "yes") {
print<
$BBName - Logon System
$HeaderInsert
Logon System. $LVersion
$Footer
wrongUN
}
if (($NameFound eq "yes") && ($pwmatch ne "true")) {
print<
$BBName - Logon System
$HeaderInsert
Logon System. $LVersion
$Footer
wrongPW
}
} # end check for missing fields
} ## END CheckBioID SR ###
sub ProcessEditRedirect {
$Login="yes";
print<
Thank you...
$HeaderInsert
$Footer
mainHTML
}
sub ProcessEdit {
print<
Thank you...
$HeaderInsert
This is where you put all the protected pages...
$Footer
mainHTML
}
sub CheckBans {
my @banlist = &OpenFile("$NonCGIPath/BanLists/EmailBan.cgi");
#get user's IP number:
my $IPNumber = $ENV{'REMOTE_ADDR'};
#Check IP Ban List--
my @IPbanlist = &OpenFile("$NonCGIPath/BanLists/IPBan.cgi");
if ($IPbanlist[0] ne "") {
my $bannum = "";
CheckIPBanList: for $bannum(@IPbanlist) {
chomp($bannum);
if ($IPNumber =~ m/$bannum/i) {
&StandardHTML("Sorry, but we are currently preventing anyone registering from your IP Number. Your IP Number is: $IPNumber.
Please feel free to email us at $BBEmail if you have any questions.");
$BannedEmail = "true";
exit;
last CheckIPBanList;
}
}
}
#if IPBan list is not empty
}
------------------
TyRaN