UBB.Dev
Most forums probably don't have this problem, but at my UBB forums, it is common for users to register multiple times and post under different usernames. Often they use the same email address for these multiple usernames. Problem is, if they forget one of their passwords, the UBB auto-emailer doesn't work - it won't send out your username and password to your email address if you have more than one username associated with that email address.

I don't know why they coded it this way. But for my version 5.47d forums, the change was really easy to get it to work. The result is that if you do the forget password thing, it will email you all your usernames and passwords (each in a separate email). Here is what I did.

First make a backup of Ubbmisc.cgi
Then open Ubbmisc.cgi and find the PWRequest subroutine:

sub PWRequest {
.
.
.
} #end PWRequest sr


Replace that entire subroutine with the following:

sub PWRequest {
# Find the right registration
&GetMemberListArray;
&GetEmails; # returns @EmailList array
$Found = "";
$Foundonce = "";


#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;
$Foundonce = "yes";
$Found = "yes";

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. nn Your UserName is: $YourNamen Your Password is: $YourPassword nn This bulletin board is located at $CGIURL/Ultimate.cgi nnThank you!");
if ($SMTPEmail eq "On") {
&SendEmail;
} else {
&send_mail("$BBEmail", "$sendto", "$subject", "$message");
}

}


$Found = "";


}
}

if ($Foundonce eq "yes") {

#Notify user that email has been sent
&Forward("$CGIURL/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 page.");
} else {
&StandardHTML("We have no one registered with the email address you listed. Use your back button to try again.");
}
} #end PWRequest sr
© UBB.Developers