#!/usr/local/bin/perl # ### PRIMARY UBB SCRIPT ## # # Ultimate Bulletin Board is copyright Infopop Corporation (formerly Madrona Park, Inc.), 1998. # # ------------ ubbmisc.cgi ------------- # # This file contains miscellaneous functionality for the UBB. # # Infopop Corporation (formerly Madrona Park, Inc.) 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. # # For more info on the Ultimate BB, # 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 "cookie-lib.pl"; require "Date.pl"; require "mods.file"; require "mail-lib.pl"; require "Styles.file"; require "ubb_library.pl"; require "ubb_library2.pl"; }; if ($@) { print ("Content-type: text/html\n\n"); print "Error including required files: $@\n"; print "Make sure these files exist, permissions are set properly, and paths are set correctly."; exit; } use Socket; &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; $UserName = &UNHTMLIFY($UserName); $UserNameFile = $UserName; $UserNameFile =~ s/ /_/g; #remove spaces } if ($Name eq "BypassCookie") { $BypassCookie = $Value; } if ($Name eq "category") { $category = $Value; } 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; } #create random numbers for headers/footers $RandomNumber = &MakeRandomNumber; $RandomNumber2 = $RandomNumber + 100074; if ($Header ne "") { $Header =~ s/UBBrandomX/$RandomNumber/isg; $Header =~ s/UBBrandomY/$RandomNumber2/isg; } if ($Footer ne "") { $Footer =~ s/UBBrandomX/$RandomNumber/isg; $Footer =~ s/UBBrandomY/$RandomNumber2/isg; } #adjust bgcolor variables 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"); } if ($TableBorderColor ne ""){ $TableWidth2 = "100%"; $BorderTop = qq(
); $BorderBottom = qq(
); } else { $TableWidth2 = $TableWidth; $BorderTop = ""; $BorderBottom = ""; } if ($BBStatus eq "OFF") { print ("Content-type: text/html\n\n"); &StandardHTML("Sorry, this bulletin board is temporarily unavailable, while we perform some routine maintenance. Please try back again later. Feel free to email us at $BBEmail."); exit; } $ReplyMessage = $in{'ReplyMessage'}; $Message = $in{'Message'}; $SubjectCoded = &HTMLIFY($TopicSubject); $SubjectCoded =~ tr/ /+/; if ($in{'action'} eq "findthread") { &FindThread; } print ("Content-type: text/html\n\n"); if ($in{'action'} eq "clearcookies") { &ClearCookies; } if ($in{'action'} eq "sockettest") { &SocketTest; } if ($in{'action'} eq "getannounce") { &GetAnnounce; } if ($in{'action'} eq "getbio") { &GetBio; } if ($in{'action'} eq "sendthread") { &SendThreadForm; } if ($in{'action'} eq "SubmitThreadEmail") { &SubmitThreadEmail; } if ($in{'action'} eq "editbio") { &EditBio; } if ($in{'action'} eq "setprefs") { &SetPrefs; } if ($in{'action'} eq "PrefsSubmit") { &PrefsSubmit; } if ($in{'action'} eq "getip") { &GetIP; } if ($in{'action'} eq "checkbioid") { &CheckBioID; } if ($in{'action'} eq "modifybio") { &ModifyBio; } if ($in{'action'} eq "RegSubmit") { &RegSubmit; } if ($in{'action'} eq "pwrequest") { &PWRequest; } sub ClearCookies { print< $HeaderInsert

Thank you. We have just deleted all cookies previously set from this forum. Note that you should reset your preferences now.

Click here to return to Preferences.

Click here to return to the forums.

COOKIES } sub FindThread { $number = $in{'number'}; @thisfor = &GetForumRecord($number); my $LWA = $thisfor[6]; my $PrivateMax = $thisfor[13]; chomp($PrivateMax); if (-e "$ForumsPath/$in{'forum'}/forum$in{'number'}.threads") { open(THREADLIST, "$ForumsPath/$in{'forum'}/forum$in{'number'}.threads"); my @thisthreadlist = ; close(THREADLIST); if ($in{'go'} eq "older") { @threadlist = reverse(@thisthreadlist); } else { @threadlist = @thisthreadlist; } my $Next = "false"; FINDIT: foreach $uno(@threadlist) { @topicarray = split(/\|\^\|/, $uno); if ($Next eq "true") { $RetrieveTopic = "$topicarray[1]"; last FINDIT; } if ($topicarray[1] eq "$in{'thisthread'}") { $Next = "true" } } if ($RetrieveTopic ne "") { if (($LWA eq "private") && ($PrivateMax eq "yes")) { &get_cookie; #retrieves all current cookies $PasswordPrivate = "$cookie{PasswordPrivate}"; $UserNamePrivate = "$cookie{UserNamePrivate}"; $NumbersPrivate = "$cookie{ForumNumberPrivate}"; &VerifyID; if ($ProceedNow ne "true") { print ("Content-type: text/html\n\n"); &StandardHTML("This is a private forum and you have not been properly authorized to view posts in this forum."); exit; } $GoTo = "$CGIURL/forumdisplay.cgi?action=displayprivate&number=$in{'number'}&topic=$RetrieveTopic"; } else { $GoTo = "$NonCGIURL/$in{'forum'}/HTML/$RetrieveTopic.html"; } print "Location: $GoTo\n\n"; exit; } else { print ("Content-type: text/html\n\n"); &StandardHTML("There are no topics $in{'go'} than this topic in this forum. Use your back button to return."); exit; } } else { print ("Content-type: text/html\n\n"); &StandardHTML("We cannot locate the next topic"); exit; } } sub GetBio { $ProfileNumber = &GetUserNumber($UserName); if ($ProfileNumber eq "") { &StandardHTML("Sorry, it appears that that user ($UserName) is no longer registered for our forums. No profile information is available for that user."); exit; } @thisprofile = &OpenProfile("$ProfileNumber.cgi"); $EmailView = $thisprofile[11]; $Signature = $thisprofile[12]; my $TheEmail = $thisprofile[2]; if (($EmailBlock eq "ON") || ($EmailView eq "no")) { $EmailField = "Not available."; } else { $EmailField = qq($TheEmail); } &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"; $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]; $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]; $Signature = $thisprofile[12]; $ICQnumber = $thisprofile[13]; $AllowMassMail = $thisprofile[14]; chomp($AllowMassMail); &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 ### sub ModifyBio { if (($Email eq "") || ($in{'NewPassword'} eq "") || ($Email !~ /\S+\@\S+\.\S+/)) { &StandardHTML("You did not complete all required form fields (or you did include a properly formatted email address)! Please go back and re-enter."); } else { ## Confirm UserName and Password to prevent hacking $ProfileNumber = &GetUserNumber($UserName); @profileinfo = &OpenProfile("$ProfileNumber.cgi"); $CurrentEmail = "$profileinfo[2]"; chomp($CurrentEmail); $Permissions = "$profileinfo[4]"; chomp($Permissions); $TotalPosts = "$profileinfo[7]"; $Status = "$profileinfo[8]"; $DateRegistered = "$profileinfo[10]"; if ($profileinfo[1] eq "$in{'Password'}") { ## check for duplicate email addresses, if applicable &GetMemberListArray; $GetEmails; if ($EmailCheck eq "true") { ### members, EmailList arrays... #Check For Duplicate Email my $duplicate = ""; $RegEmail = lc($Email); $CurrEmail = lc($CurrentEmail); #only check if email is being changed if ($RegEmail ne "$CurrEmail") { $UpdateEmailFile = "true"; if (-e "$MembersPath/temp.file") { &StandardHTML("We are temporarily upgrading our Memberships. This process only takes a minute or two. Please try changing your profile again in a couple of minutes. Thank you!"); exit; } unless ($Permissions =~ /Write/) { &StandardHTML("Sorry, we cannot process your profile change requst for the following reason:

We do not allow email address changes for users that are not permitted to post notes."); exit; } CHECKEMAIL: for $thisemail(@EmailList) { ($theemail, $junk) = split(/\?\?/, $thisemail); $checkemail = lc($theemail); if ($RegEmail eq "$checkemail") { $duplicate = "yes"; last CHECKEMAIL; } #end if regemail } # end foreach } #end regemail/curremail compare } #END if Email check eq TRUE if ($duplicate eq "yes") { &StandardHTML("You cannot use the email address you tried to use. Another registered user is already using it."); } else { # if email verify is on, then we can't let users change # email address without sending a new password generated # by system to them $Password = "$in{'NewPassword'}"; $ModifyWarning = ""; if (($CurrentEmail ne "$Email") && ($UseEmail eq "ON") && ($EmailVerify eq "ON")){ #generate new password $NewPassword = &GeneratePassword; $sendto = "$Email"; $from = "$BBEmail"; $subject = "$BBName Registration - Your New Password"; $message = "Hello!\n\r\nBecause you just modified your email address, we have sent you a new password to use for your registration on $BBName. Your registration information is provided below, including your new password. You will need this information in order to post any messages in our forums.\n\r\nYour UserName: $UserName\nYourPassword: $NewPassword\nYour Email Address of record is now: $Email"; $Password = "$NewPassword"; $ModifyWarning = "Note: Because you changed your email address, and because we require email verification, a new password has been issued to you. This new password has been sent to: $Email. You may change your password, but you may not change your password and email address at the same time. Thank you!"; if ($SMTPEmail eq "On") { &SendEmail; } else { &send_mail("$BBEmail", "$sendto", "$subject", "$message"); } } @amend = @blank; if ($UpdateEmailFile eq "true") { open (EMAILFILE, "$MembersPath/emailfile.cgi"); my @emailsfile = ; close (EMAILFILE); $CurrEmail =~ s/([\.|\@])/\\$1/isg; foreach $checker(@emailsfile) { chomp($checker); if ($checker =~ m/^$CurrEmail\|\|/i) { ($junk, $thisnum) = split(/\|\|/, $checker); $NewLine = "$RegEmail||$thisnum"; push(@amend, $NewLine); } else { push(@amend, $checker); } } &Lock("lock.file"); open(EMAILFILE, ">$MembersPath/emailfile.cgi"); foreach $dos(@amend) { chomp($dos); print EMAILFILE "$dos\n"; } close(EMAILFILE); &Unlock("lock.file"); chmod (0666, "$MembersPath/emailfile.cgi"); } $Signature = "$in{'Signature'}"; $Signature =~ s/()//isg; $Signature =~ s//>/g; $Signature =~ s/\s+$//g; $Signature = &ConvertReturns("$Signature"); $OverrideImages = "yes"; $Signature = &UBBCode("$Signature"); &Lock("lock.file"); ##print profile fields to file open (MEMBERSHIP, ">$MembersPath/$ProfileNumber.cgi") || die("Unable to open Members directory."); print MEMBERSHIP ("$profileinfo[0]\n"); print MEMBERSHIP ("$Password\n"); print MEMBERSHIP ("$Email\n"); print MEMBERSHIP ("$URL\n"); print MEMBERSHIP ("$Permissions\n"); print MEMBERSHIP ("$Occupation\n"); print MEMBERSHIP ("$Location\n"); print MEMBERSHIP ("$TotalPosts\n"); print MEMBERSHIP ("$Status\n"); print MEMBERSHIP ("$Interests\n"); print MEMBERSHIP ("$DateRegistered\n"); print MEMBERSHIP ("$in{'EmailView'}\n"); print MEMBERSHIP ("$Signature\n"); print MEMBERSHIP ("$in{'ICQnum'}\n"); print MEMBERSHIP ("$in{'AllowMassMail'}\n"); close (MEMBERSHIP); &Unlock("lock.file"); #confirm processing to user, provide links to other places &BioModifyConfirmHTML; } } else { &StandardHTML("Sorry, but you seem to be trying to hack into someone else's profile. You can not edit someone's profile without knowing their password."); } } } ## END Modify Bio SR sub GetAnnounce { $ForumNumber = $in{'ForumNumber'}; @thisforum = &GetForumRecord($ForumNumber); if ($thisforum[6] eq "private") { $ExactPath = "Forum$ForumNumber/private-$thisforum[7]"; } else { $ExactPath = "Forum$ForumNumber"; } opendir (GETANNC, "$ForumsPath/$ExactPath/ANNC"); my @forummsgs = readdir(GETANNC); closedir (GETANNC); my @announcements = grep(/annc/, @forummsgs); #now we have all announcements in the forum my $announce = ""; foreach $announce(@announcements) { my ($start, $end, $trash) = split("-", $announce); &DateCompare("$start", "$end"); if ($Live eq "true") { $sortline = ("$StartJulian|$announce"); push(@livelist, $sortline); } } #end foreach $announce $listtotal = @livelist; @sortlist = sort(@livelist); #the sorted list of announcements @sortlist = reverse(@sortlist); #now we need to print the announcements $Moderator = ("Forum" . "$ForumNumber" . "Moderator"); $Moderator = $$Moderator; @mods = split(/\|\|\^\|\|/, $Moderator); foreach $unomod(@mods) { chomp($unomod); $ModNumber = &GetUserNumber($unomod); if ($ModNumber ne "") { @theprofile = &OpenProfile("$ModNumber.cgi"); $ModeratorEmail = "$theprofile[2]"; if ($ModeratorLine ne "") { $ModeratorLine .= qq(, $unomod); } else { $ModeratorLine = qq($unomod); } } } $Forum = $thisforum[1]; $CustomTitle = $thisforum[9]; chomp($CustomTitle); if ($CustomTitle eq "") { $CustomTitle = "$BBTitle"; } $ForumCoded = &HTMLIFY($Forum); $ForumCoded =~ tr/ /+/; &AnnounceTopHTML; $AltColor = "$AltColumnColor1"; #print each announcement foreach $liveannounce(@sortlist) { ($StartCheck, $anncfile) = split(/\|/, $liveannounce); open (ANNC, "$ForumsPath/$ExactPath/ANNC/$anncfile"); @anncinfo = ; close (ANNC); #format end date ($startdate, $enddate, $trash2) = split("-", $anncfile); my $StartMonth = substr($startdate, 0, 2); my $StartDay = substr($startdate, 2, 2); my $StartYear = substr($startdate, 4, 4); my $EndMonth = substr($enddate, 0, 2); my $EndDay = substr($enddate, 2, 2); my $EndYear = substr($enddate, 4, 4); $DateStart = "$StartMonth-$StartDay-$StartYear"; $DateEnd = "$EndMonth-$EndDay-$EndYear"; if ($DateFormat eq "US") { $FormatStart = $DateStart; $FormatEnd = $DateEnd; } elsif ($DateFormat eq "Euro") { $FormatStart = &DateFormat("$DateStart", "Euro"); $FormatEnd = &DateFormat("$DateEnd", "Euro"); } elsif ($DateFormat eq "USX") { $FormatStart = &DateFormat("$DateStart", "USExpanded"); $FormatEnd = &DateFormat("$DateEnd", "USExpanded"); } else { $FormatStart = &DateFormat("$DateStart", "EuroExpanded"); $FormatEnd = &DateFormat("$DateEnd", "EuroExpanded"); } my $Author = $anncinfo[0]; my $Subject = $anncinfo[1]; my $Status = $anncinfo[2]; my $ForumList = $anncinfo[3]; my $Message = $anncinfo[4]; chomp($Author); chomp($Subject); chomp($Status); chomp($ForumList); chomp($Message); $StartCheck = ($StartCheck + .99); if ($StartCheck >= $in{'Session'}) { $NewGIF = "\"New"; } else { $NewGIF = "\"Old"; } print< $Subject $NewGIF posted by $Author     ($FormatStart through $FormatEnd)


$Message
LINE if ($AltColor eq "$AltColumnColor1") { $AltColor = "$AltColumnColor2" } else { $AltColor = "$AltColumnColor1" } } #end foreach $liveannounce print <
New Announcement  New Announcement (since you last visited)
New Announcement  Old Announcement

ALMOSTBOTTOM &PageBottomHTML; #in ubb_library.pl } #end GetAnnounce sr ## HTML CODE #### sub EditBio { print< $BBName - Edit Profile $HeaderInsert $Header Modify 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.

UserName
Password   Forget your password?

If you have previously registered, but forgotten your password, click here.

$Footer EDITbioHTML } ##END EDIT BIO SR sub BioModifyConfirmHTML { &GetCookieInfo; if ($SetCookies eq "DirectorySpecific") { $ExtraInfo = qq(domain=$TheDomain;path=/$ThePath;); } else { $ExtraInfo = ""; } print< Member Profile Modification Confirmation $HeaderInsert

Thank you, $UserName. Your profile has been successfully updated.

$ModifyWarning

Return to: Forums Summary Page
Edit Your Profile
Help/FAQ
HTML } ## END Bio Modify Confirmation sr sub SetPrefs { if ($DisplayRegistration eq "NO") { $StoreNameWording = qq(); $NameOption = ""; $NSCookieSlot = ""; } else { $StoreNameWording = qq% Store Username & Password in browser memory for 1 year (otherwise you will have to type your username and password once per browser session)

yes no
%; $NameOption = qq%
  • the option to store your username and password in memory for one year (you won't have to type your name/password at all during that year). If you check no, your username and password will be saved after you type it once, but only for that browser session (no long-term memory)%; $NSCookieSlot = qq%if (NameStorage == "yes") { document.PREFS.NameStorage[0].checked = true; } else { document.PREFS.NameStorage[1].checked = true; }%; } print< $BBName Preferences $HeaderInsert $Header Forum Preferences

    We use cookies to store your preferences. Sometimes cookies become corrupted or deleted in your browser. If so, you may want to delete all cookies that have been set by this forum. This will mean that all previously saved cookie info will be lost, but it will also mean that any possible cookie problem may be fixed. Click here to delete all cookies set by this forum!

    $BorderTop $StoreNameWording
    You may customize this bulletin board to reflect your preferences. Below are your preference options.
      $NameOption
    • the standard number of days (history) for viewing topics

    Default Topic View:
    $BorderBottom




    Note: Your preferences are stored as cookies in your browser. Thus, you must be using a cookies-enabled browser (Netscape and Microsoft Internet Explorer both support cookies). If your browser does not support cookies or you have the cookies option turned off in your browser preferences, the settings you make above will not take affect. Also, please note that the settings are set to last for one year. After each year, you will have to reset your preferences.
    $Footer PrefsHTML } ## END Set Prefs SR ## sub PrefsSubmit { &GetCookieInfo; if ($SetCookies eq "DirectorySpecific") { $ExtraInfo = qq(domain=$TheDomain;path=/$ThePath;); } else { $ExtraInfo = ""; } print< $HeaderInsert

    CONFIRMHTML } sub ViewBioHTML { if ($thisprofile[3] eq "") { $thisprofile[3] = " "; } if ($thisprofile[5] eq "") { $thisprofile[5] = " "; } if ($thisprofile[6] eq "") { $thisprofile[6] = " "; } if ($thisprofile[7] eq "") { $thisprofile[7] = " "; } if ($thisprofile[9] eq "") { $thisprofile[9] = " "; } if ($thisprofile[10] eq "") { $DateRegistered = "Not available."; } else { $DateRegistered = "$thisprofile[10]"; #format date----------------------------------- if ($DateFormat eq "US") { $DateRegistered = $DateRegistered; } elsif ($DateFormat eq "Euro") { $DateRegistered = &DateFormat("$DateRegistered", "Euro"); } elsif ($DateFormat eq "USX") { $DateRegistered = &DateFormat("$DateRegistered", "USExpanded"); } else { $DateRegistered = &DateFormat("$DateRegistered", "EuroExpanded"); } } #end if/else thisprofile[10] if ($thisprofile[8] eq "Administrator") { $ThisStatus = "$AdminTitle"; } elsif ($thisprofile[8] eq "Moderator") { $ThisStatus = "$ModeratorTitle"; } elsif ($thisprofile[8] eq "Member") { $ThisStatus = "$MemberTitle"; } else { $ThisStatus = "$JrMemberTitle"; } $ICQline = "$thisprofile[13]"; if ($ICQline eq "") { $ICQline = " "; } $SearchName = "$thisprofile[0]"; $SearchName = &HTMLIFY($SearchName); $SearchName =~ tr/ /+/; print < $HeaderInsert $Header

    Profile for $thisprofile[0]

    Search: All posts by this registered user.

    $BorderTop
    Date Registered: $DateRegistered
    Status: $ThisStatus
    Total Posts: $thisprofile[7]
    Current Email: $EmailField
    Homepage: $thisprofile[3]
    Occupation: $thisprofile[5]
    Location: $thisprofile[6]
    Interests: $thisprofile[9]
    ICQ Number: $ICQline
    $BorderBottom

    $YourCopyrightNotice

    Powered by: Ultimate Bulletin Board
    © Infopop Corporation (formerly Madrona Park, Inc.), 1998-1999.

    $Footer BioHTML } ## END View BIO HTML sr sub ProcessEdit { if ($EmailView eq "no") { $EVno = "CHECKED"; } else { $EVyes = "CHECKED"; } if ($Status eq "Administrator") { $Status = "$AdminTitle"; } elsif ($Status eq "Moderator") { $Status = "$ModeratorTitle"; } elsif ($Status eq "Member") { $Status = "$MemberTitle"; } else { $Status = "$JrMemberTitle"; } if (($UseEmail eq "ON") && ($EmailVerify eq "ON")) { $WarningHTML = "Warning: Because we require email verification, if you change your email address, a new password will be created for you and emailed to the new email address you list. Thus, do not change your email address unless you can retrieve email from it to get your new password."; } else { $WarningHTML = ""; } $Signature = &EditUBBConvert("$Signature"); $Signature =~ s/

    /\n\r\n/isg; $Signature =~ s/
    /\n/isg; if ($AllowSignature eq "YES") { $SigStatus = "enabled"; } else { $SigStatus = "not enabled"; } if ($AllowMassMail eq "no") { $AllowMailNo = "CHECKED"; $AMM = qq(); } elsif ($AllowMassMail eq "") { $AllowMailYes = "CHECKED"; $AMM = qq(); } else { $AllowMailYes = "CHECKED"; $AMM = qq(); } print< $HeaderInsert $Header
    Modify Your Profile

    Thank you! We have confirmed your identity, $UserName ($Status).

    Feel free to modify any of the fields below.

    $WarningHTML

    $AMM $BorderTop
    Email Address
    Password
    Homepage
    Occupation
    City, State, Country
    Interests
    ICQ Number
    Signature
    Note: The Signature feature is currently $SigStatus by this bulletin board's administrator. You may use UBB Code in this field, but not HTML. The UBB Code Image tag is not permitted, however.
    Allow Bulletin Board Administrators and Moderators To Send You Email Notices?
    yes     no
    Keep your email address viewable to other users when you post notes?
    yes no
    $BorderBottom

    $Footer
    EditHTML } ##END Process Edit SR sub AnnounceTopHTML { print< $BBName Announcements $HeaderInsert $Header

    $Forum
    (moderated by $ModeratorLine)
      $BBName
      $Forum


    profile | register | preferences | faq | search

    Current Announcements: $listtotal
    Note: Announcements are made by bulletin board administrators and moderators only. You may not reply to these announcements.

    TOP } #end AnnounceTopHTML sr sub RegSubmit { if ($SuspendRegister eq "true") { &StandardHTML("Sorry, we are not accepting new registrations currently."); exit; } #get user's IP number: my $IPNumber = $ENV{'REMOTE_ADDR'}; unless (-e "$MembersPath/emailfile.cgi") { &StandardHTML("We are upgrading our software at the moment and cannot process new registrations. Please try registering again in a little while. Thank you!"); exit; } if (-e "$MembersPath/temp.file") { &StandardHTML("We are temporarily upgrading our Memberships. This process only takes a minute or two. Please try registering again in a couple of minutes. Thank you!"); exit; } if (-e "$CGIPath/temp.file") { &StandardHTML("We are temporarily upgrading our Memberships. This process only takes a minute or two. Please try registering again in a couple of minutes. Thank you!"); exit; } #Check Email Ban List-- my @banlist = &OpenFile("$NonCGIPath/BanLists/EmailBan.cgi"); if ($banlist[0] ne "") { my $banword = ""; CheckBanList: for $banword(@banlist) { chomp($banword); $banword2 = quotemeta($banword); if ($Email =~ m/$banword2/i) { &StandardHTML("Sorry, you have attempted to register with an email address that has been banned. We are not currently allowing the following email address to be registered:

    $banword

    Please feel free to email us at $BBEmail if you have any questions."); $BannedEmail = "true"; last CheckBanList; } } } #if EmailBan list is not empty #Check IP Ban List-- my @IPbanlist = &OpenFile("$NonCGIPath/BanLists/IPBan.cgi"); if ($IPbanlist[0] ne "") { my $bannum = ""; CheckIPBanList: for $bannum(@IPbanlist) { chomp($bannum); $bannum2 = quotemeta($bannum); if ($IPNumber =~ m/$bannum2/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"; last CheckIPBanList; } } } #if IPBan list is not empty ## Check to make sure censored words are not used in username if ($Censor eq "ON") { @censored = split(/ /, $censorwords); $BadWord = "false"; CHECKCENSORLIST: for (@censored) { if (m/({)(.*)(})/) { $_ = ("$2"); } if ($UserName =~ $_) { $BadWord = "true"; $CensorWord = $_; last CHECKCENSORLIST; } } #end for checkcensorlist if ($BadWord eq "true") { $RejectUserName = "true"; &StandardHTML("Sorry, you have attempted to register a name that includes a word (\"$CensorWord\") that has been censored on this bulletin board."); } } #end if censor is on if (($BannedEmail ne "true") && ($RejectUserName ne "true")){ if (($UseEmail eq "ON") && ($EmailVerify eq "ON")) { if ( ($UserName eq "") || ($Email !~ /\S+\@\S+\.\S+/) ) { &StandardHTML("You did not properly complete all required form fields! Remember that you must enter a valid email address. Please go back and re-enter."); } else { &GoAhead; } } else { if ( ($UserName eq "") || ($Email !~ /\S+\@\S+\.\S+/) || ($in{'Password'} eq "") || ($PasswordConfirm eq "") ) { &StandardHTML("You did not properly complete all required form fields! Remember that you must enter a valid (properly formatted) email address. Please go back and re-enter."); } else { if ($in{'Password'} eq "$PasswordConfirm") { &GoAhead; } else { &StandardHTML("Registration Failed!

    You failed to type the same password twice on the registration form. Please go back and try again.

    Use your back button to try again."); } } } } # end if banned email ne true } ## END RegSubmit SR ## sub GoAhead { #check for illegal (non alphanumeric characters) if (($UserName =~ m/^\s/) || ($UserName =~ m/\ /) || ($UserName =~ m/\s$/) || ($UserName =~ m/\s{2,}/) || ($UserName =~ m/\|\!/) || ($UserName =~ m/\|\|/) || ($UserName =~ m/\|$/) || ($UserName =~ m/^\|/) || ($UserName =~ m/\"/) || ($Email =~ m/\s/) || ($UserName =~ m/>

    1. You may not begin or end a User Name with a space.

    2. You may not have two or more consecutive spaces.

    3. You may not use a name with a pipestem followed by an exclamation point.

    4. You may not use a name with a two consecutive pipestems.5. You may not use any quotation marks.

    6. Your email address must not contain any spaces.

    7. You may not use a name that contains a < and a > .

    8. You may not use a name that contains memberslist or emailfile.

    9. You must start and end your username with an English letter or number or one of the following symbols: !, ?, #, $, @, *, &, ^, +, -, ~, :, ], [, '.

    10. You may not include a semicolon.

    Use your back button to try again.
    "); exit; } else { #check to make sure Username is unique #determine EmailList array, members array & LastNumber $UserName =~ s/\s+/ /g; $Email =~ s/\s+//g; &GetMemberListArray; &GetEmails; # LastNumber = last number used in members file my $LastNum = $LastNumber; $AddOne = $LastNum + 1; $NextNumber = sprintf("%8d", $AddOne); $NextNumber =~ tr/ /0/; $duplicate = "no"; $LCusername = lc($UserName); CHECKDUPES: for $checkthis(@members) { $LCcheckthis = lc($checkthis); if ($LCcheckthis eq "$LCusername") { $duplicate = "yes"; &StandardHTML("Someone else has already registered that UserName. Please try again. Use your back button."); last CHECKDUPES; } } #CHECK to make sure email isn't a duplicate too $RegEmail = lc($Email); if (($duplicate ne "yes") && ($EmailCheck eq "true")) { # @EmailList contains all registered emails CHECKEMAIL: foreach $thisemail(@EmailList) { ($theemail, $junk) = split(/\?\?/, $thisemail); $checkemail = lc($theemail); if ($RegEmail eq "$checkemail") { $duplicate = "yes"; &StandardHTML("Someone else has already registered that email address. Please try again. Use your back button."); last CHECKEMAIL; } } } #END if duplicate ne yes if ($duplicate ne "yes") { if (($UseEmail eq "ON") && ($EmailVerify eq "ON")) { #generate password $Password = &GeneratePassword; } else { $Password = "$in{'Password'}"; } # Get Today's Date so we can log the date of registration &GetDateTime; #Prepare Signature - prevent HTML, strip returns, do UBB Code @censored = split(/ /, $censorwords); $Signature = &CensorCheck("$in{'Signature'}"); $Signature =~ s/()//isg; $Signature =~ s//>/g; $SignatureHTML = &ConvertReturns("$Signature"); $OverrideImages = "yes"; $SignatureHTML = &UBBCode("$SignatureHTML"); #Create Registration File &Lock ("lock.file"); open (MEMBERSHIP, ">$MembersPath/$NextNumber.cgi") or die("Unable to open Members directory."); print MEMBERSHIP ("$UserName\n"); print MEMBERSHIP ("$Password\n"); print MEMBERSHIP ("$RegEmail\n"); print MEMBERSHIP ("$URL\n"); print MEMBERSHIP ("Write\n"); print MEMBERSHIP ("$Occupation\n"); print MEMBERSHIP ("$Location\n"); print MEMBERSHIP ("0\n"); print MEMBERSHIP ("Junior Member\n"); print MEMBERSHIP ("$Interests\n"); print MEMBERSHIP ("$HyphenDate\n"); print MEMBERSHIP ("$in{'EmailView'}\n"); print MEMBERSHIP ("$SignatureHTML\n"); print MEMBERSHIP ("$in{'ICQnum'}\n"); print MEMBERSHIP ("$in{'AllowMassMail'}\n"); close (MEMBERSHIP); &Unlock ("lock.file"); chmod (0777, "$MembersPath/$NextNumber.cgi"); ## APPEND NEW REGISTRATION TO REG FILE &Lock ("lock.file"); open (LIST, ">>$MembersPath/memberslist.cgi"); print LIST "$UserName|!!|$NextNumber\n"; close (LIST); &Unlock ("lock.file"); chmod (0666, "$MembersPath/memberslist.cgi"); &Lock ("lock.file"); open (LIST, ">>$MembersPath/emailfile.cgi"); print LIST "$RegEmail||$NextNumber\n"; close (LIST); &Unlock ("lock.file"); chmod (0666, "$MembersPath/emailfile.cgi"); if (($UseEmail eq "ON") && ($EmailVerify eq "ON")) { $sendto = "$Email"; $from = "$BBEmail"; $subject = "$BBName Registration - Your Password"; $message = "Hello!\n\r\nThank you for registering on $BBName ($CGIURL/Ultimate.cgi). Your registration is provided below, including your new password. You will need this information in order to post any messages in our forums at $CGIURL/Ultimate.cgi .\n\r\nYour UserName: $UserName\nYourPassword: $Password\nYour Email Address of record is: $RegEmail\n\r\nNote that you change this password online using the \"edit profile\" button on our bulletin board. If you change your registered email address, however, a new random password will be emailed to you so that we can verify any new email address you use.\n\r\nAgain, thank you for registering."; if ($SMTPEmail eq "On") { &SendEmail; } else { &send_mail("$BBEmail", "$sendto", "$subject", "$message"); } $RegWording1 = "You have successfully registered your User Name for $BBName. "; $RegWording2 = "Your password has been emailed to you at $Email"; &PrintRegistrationHTML; } else { $RegWording1 = "You have successfully registered your User Name and Password for $BBName. "; $RegWording2 = "$in{'Password'}"; &PrintRegistrationHTML; } # end use email/verify on check } ### end if dupe ne yes } # end if/else /m } # end GoAhead subroutine sub PrintRegistrationHTML { &GetCookieInfo; if ($SetCookies eq "DirectorySpecific") { $ExtraInfo = qq(domain=$TheDomain;path=/$ThePath;); } else { $ExtraInfo = ""; } print < User Registration Confirmation $HeaderInsert $Header
    Subject Announcement
    Congratulations!

    $RegWording1 Feel free to post messages on any of our forums. Your registration information is listed below.

    User Name $UserName
    Password $RegWording2
    Email $Email
    City, State, Country $Location
    Occupation $Occupation
    Interests $Interests
    Homepage $URL
    Signature $SignatureHTML

    Click here to enter the Bulletin Board now!





    . $Footer
    HTML } ## END Print Registration sr sub PWRequest { # Find the right registration &GetMemberListArray; &GetEmails; # returns @EmailList array $Found = ""; #lowercase the email input $sendto = lc($in{'sendto'}); $CountIt = 0; foreach $emailline(@EmailList) { ($theemail, $thenumber) = split(/\?\?/, $emailline); $theemail = lc("$theemail"); if ($theemail eq "$sendto") { chomp($thenumber); @thisprofile = &OpenProfile("$thenumber.cgi"); $YourName = "$thisprofile[0]"; $YourPassword = "$thisprofile[1]"; $CountIt = $CountIt + 1; $Found = "yes"; } } if ($CountIt >= 2) { &StandardHTML("Sorry, we cannot process your request because more than one person is using that email address."); exit; } if ($Found eq "yes") { #Send the Email $from = "$BBEmail"; $subject = "Your UserName and Password - $BBName"; $message = ("Here is the registration information you requested for $BBName. \n\n Your UserName is: $YourName\n Your Password is: $YourPassword \n\n This bulletin board is located at $CGIURL/Ultimate.cgi \n\nThank you!"); if ($SMTPEmail eq "On") { &SendEmail; } else { &send_mail("$BBEmail", "$sendto", "$subject", "$message"); } #Notify user that email has been sent &Forward("Ultimate.cgi?action=intro&BypassCookie=true", "Your username and password for this bulletin board have just been emailed to you!

    You are now being automatically returned to the main forums page."); } else { &StandardHTML("We have no one registered with the email address you listed. Use your back button to try again."); } } #end PWRequest sr sub SocketTest { &StandardHTML("The Socket module is installed on your web server. You may use the Socket option for performing UBB email functions.

    Use your back button to return to the Variables page."); } sub SendThreadForm { $Subject = &UNHTMLIFY($in{'Subject'}); print< $HeaderInsert $Header

    UBBFriend Send This Page To A Friend

    $BorderTop
    Your Name:
    Your Email (so your friend can reply to you):
    Send To (Person's Name):
    Send To (Email Address):
    Subject:
    Message:
    $BorderBottom

    SendThread &PageBottomHTML; } #end SendThreadForm sub SubmitThreadEmail { ## $CheckRefer = $ENV{HTTP_REFERER}; unless ($CheckRefer =~ /^$CGIURL/i) { my $HackerIPNumber = $ENV{'REMOTE_ADDR'}; &StandardHTML("We have noted your attempt to hack this forum. Your IP number ($HackerIPNumber) has been logged. Your ISP will be notified if you persist."); exit; } ## #validate required fields if (($in{'FromName'} eq "") || ($in{'EmailMessage'} eq "") || ($in{'SendToEmail'} !~ m/\S+\@\S+\.\S+/) || ($in{'EmailSubject'} eq "") || ($in{'FromEmail'} !~ m/\S+\@\S+\.\S+/) || ($in{'SendToName'} eq "") ) { &StandardHTML("You failed to complete all required fields, or you failed to provide a proper email address. Please use your back button to try again."); } else { $ReplyTo = "$in{'FromName'}<$in{'FromEmail'}>"; $sendto = $in{'SendToEmail'}; $subject = "$in{'EmailSubject'}"; $message = "$in{'EmailMessage'}"; if ($SMTPEmail eq "On") { &SendEmail; } else { &send_mail("$ReplyTo", "$sendto", "$subject", "$message"); } &Forward("$in{'ForwardURL'}", "We have sent your email to $in{'SendToEmail'}. You are now being taken back to the page from which you sent the email."); } #end if/else form validation } #end SubmitThreadEmail sub VerifyID { $NameFound = "no"; $ProfileNumber = &GetUserNumber($UserNamePrivate); if ($NumbersPrivate ne "") { if ($NumbersPrivate =~ /B/) { @CheckAccess = split("B", $NumbersPrivate); } else { @CheckAccess = $NumbersPrivate; } CHECKER: foreach $checker(@CheckAccess) { chomp($checker); if ($checker eq "$number") { $ProceedNow = "true"; last CHECKER; } } } if ($ProceedNow ne "true") { if ($ProfileNumber ne "") { $NameFound = "yes"; } else { $NameFound = "no"; } @thisprofile = &OpenProfile("$ProfileNumber.cgi"); if ($PasswordPrivate eq "$thisprofile[1]") { $Permission = "$thisprofile[4]"; $Status = $thisprofile[8]; ($GenPerms, $SpecificPerms) = split(/\&/, $Permission); if (($Status eq "Administrator") || ($Status eq "Moderator")) { $ProceedNow = "true"; } if (($SpecificPerms ne "") && ($ProceedNow ne "true")){ chomp($specificPerms); @accessarray = split(",", $SpecificPerms); CHECKARRAY: foreach $uno(@accessarray) { if ($uno eq "$number") { $ProceedNow = "true"; last CHECKARRAY; } } } } } } #end VerifyID sub GetIP { #print authorization screen- must be admin or mod my $IPTitle = qq($BBName - Show Logged IP Number For This Post); my $IPRunner = qq(I P      L O G      D I S P L A Y); my $IPIntro = qq(To view the logged IP number for this post, identify yourself below.); $IPHidden = qq(
    ); &AuthorizeCheck($IPTitle, $IPIntro, $IPHidden, $IPRunner); }