#!/usr/bin/perl
#
### FREEWARE UBB SCRIPT ##
#
# Ultimate Bulletin Board is copyright Infopop Corporation, 1998-2000.
#
# ------------ ubbmisc.cgi -------------
#
# This file contains functionality for the Freeware UBB.
#
# Infopop Corporation offers no
# warranties on this script. The owner/licensee of the script is
# solely responsible for any problems caused by installation of
# the script or use of the script, including messages that may be
# posted on the BB.
#
# All copyright notices regarding the Ultimate Bulletin Board
# must remain intact on the scripts and in the HTML
# for the scripts. These "powered by" and copyright notices MUST
# remain visible when the pages are viewed on the Internet.
#
# You may not SELL this script. You may offer it freely to others.
# It is freeware. You may not alter the code and then call it another
# name. You may not alter the code and then resell it under another
# name, either.
#
# For more info on the Ultimate BB, including licensing info,
# see http://www.UltimateBB.com
#
###############################################################
#
#If you are running UBB on IIS,
#you may need to add the following line
#if so, just remove the "#" sign before the print line below
#print "HTTP/1.0 200 OK\n";
eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX / or Windows /
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \
#substitute all require files here for the file
require "UltBB.setup";
require "Date.pl";
require "mods.file";
require "Styles.file";
require "ubb_library.pl";
require "ubb_library2.pl";
};
print ("Content-type: text/html\n\n");
if ($@) {
print "Error including required files: $@\n";
print "Make sure these files exist, permissions are set properly, and paths are set correctly.";
exit;
}
&ReadParse;
foreach $row(@in) {
($Name, $Value) = split ("=", $row);
$Name = &decodeURL($Name);
$Value = &decodeURL($Value);
if ($Name eq "forum") {
$Forum = $Value;
$Forum =~ s/\/\\//g;
$ForumCoded = &HTMLIFY($Forum);
$ForumCoded =~ tr/ /+/;
$Forum = &UNHTMLIFY($Forum);
}
if ($Name eq "TopicSubject") {
$TopicSubject = $Value;
$TopicSubject =~ s/<.+?>//g;
$TopicSubject = &UNHTMLIFY($TopicSubject);
}
if ($Name eq "UserName") {
$UserName = $Value;
$UserNameFile = $UserName;
$UserNameFile =~ s/ /_/g; #remove spaces
}
if ($Name eq "PasswordConfirm") {
$PasswordConfirm = $Value;
}
if ($Name eq "number") {
$number = $Value;
}
if ($Name eq "DaysPrune") {
$DaysPrune = $Value;
}
if ($Name eq "topic") {
$topic = $Value;
}
if ($Name eq "Email") {
$Email = $Value;
$Email =~tr/A-Z/a-z/;
}
if ($Name eq "URL") {
$URL = &CleanThis($Value);
$URL = &PipeCleaner($URL);
}
if ($Name eq "Permissions") {
$Permissions = $Value;
}
if ($Name eq "Occupation") {
$Occupation = &CleanThis($Value);
$Occupation = &PipeCleaner($Occupation);
}
if ($Name eq "Location") {
$Location = &CleanThis($Value);
$Location = &PipeCleaner($Location);
}
if ($Name eq "TotalPosts") {
$TotalPosts = $Value;
}
if ($Name eq "Status") {
$Status = $Value;
}
if ($Name eq "Interests") {
$Interests = &CleanThis($Value);
$Interests = &PipeCleaner($Value);
}
if ($Name eq "sendto") {
$sendto = $Value;
}
} # end FOREACH $row
if ($VariablesPath eq "") {
$VariablesPath = $CGIPath;
}
$ReplyMessage = $in{'ReplyMessage'};
$Message = $in{'Message'};
$SubjectCoded = &HTMLIFY($TopicSubject);
$SubjectCoded =~ tr/ /+/;
if ($in{'action'} eq "getbio") {
&GetBio;
}
if ($in{'action'} eq "editbio") {
&EditBio;
}
if ($in{'action'} eq "checkbioid") {
&CheckBioID;
}
if ($in{'action'} eq "modifybio") {
&ModifyBio;
}
if ($in{'action'} eq "RegSubmit") {
&RegSubmit;
}
sub GetBio {
@thisprofile = &OpenProfile("$UserName.cgi");
$EmailView = $thisprofile[11];
$Signature = $thisprofile[12];
chomp($Signature);
if (($EmailBlock eq "ON") || ($EmailView eq "no")) {
$EmailField = "Not available.";
} else {
$EmailField = "$thisprofile[2]";
}
&ViewBioHTML;
} ## END GET BIO sr
sub CheckBioID {
if (($in{'UserName'} eq "") || ($in{'Password'} eq "")) {
&StandardHTML("You did not complete all required form fields! Please go back and re-enter.");
} else {
$NameFound = "no";
if (-e "$MembersPath/$UserNameFile.cgi") {
$NameFound = "yes";
}
if ($NameFound eq "yes") {
#Check Password Now
@thisprofile = &OpenProfile("$UserName.cgi");
if ($in{'Password'} eq "$thisprofile[1]") {
$pwmatch = "true";
$Password = $thisprofile[1];
$Email = $thisprofile[2];
$URL = $thisprofile[3];
$Occupation = $thisprofile[5];
$Location = $thisprofile[6];
$Interests = $thisprofile[9];
$Status = $thisprofile[8];
$TotalPosts = $thisprofile[7];
$Permissions = $thisprofile[4];
$DateRegistered = $thisprofile[10];
$EmailView = $thisprofile[11];
&ProcessEdit;
}
} ## END IF MEMBER = Username.cgi condition
if ($NameFound ne "yes") {
&StandardHTML("We have no one registered with that user name. Use your back button to try again.");
}
if (($NameFound eq "yes") && ($pwmatch ne "true")) {
&StandardHTML("Sorry, but the password you entered was not correct. Please try again. Use your Back button.");
}
} # end check for missing fields
} ## END CheckBioID SR ###
## HTML CODE ####
sub EditBio {
print<$BBName - Edit ProfileModify Your Profile
It is your responsibility to keep your profile information up-to-date. Do not ask the administrator or moderators to do this for you.
To modify your current profile information, please identify yourself below.