[%
my $str;
$str.="Forgot your username or password? All we need is one of the following blanks filled in correctly and you should be able to find the answers to your most perplexing question";
$str.=$query->start_form("POST", $ENV{SCRIPT_NAME});
$str.='';
$str.=$query->hidden('node_id',getId($NODE));
$str.="Your username:";
$str.=' ';
$str.="Your e-mail address:";
$str.=' ';
$str.=$query->submit("sexisgood", "Mail me my password, Cowboy!");
$str.=$query->end_form;
if($query->param('op') eq 'lostpasswd' and ($query->param('username') || $query->param('email'))){
my $haverow=0;
my $username=$query->param('username');
my $email=$query->param('email');
my @N;
if($username){
@N = getNode($username, getType('user'));
$haverow=$N[0];
}
if(!$haverow and $email){
@N=$DB->getNodeWhere ({email => $email}, $DB->getType('user'));
$haverow=$N[0];
}
if($haverow){
my ($n) = getNode('Password Mail', getType('mail'));
$$n{doctext} =~ s/\/$$haverow{realname}/;
$$n{doctext} =~ s/\/$$haverow{title}/;
$$n{doctext} =~ s/\/$$haverow{passwd}/;
$$n{doctext} =~ s/\/$HTMLVARS{site_name}/;
$$n{doctext} =~ s/\/$HTMLVARS{site_url}/;
use Everything::MAIL;
my $addr = node2mail($$haverow{email},$n);
$n = getNodeById(getId($n), 'force');
$str.="
Your password and username should be on its way
";
$str.= "Addr7: " . $addr;
print " $addr";
}
else{
$str="Couldn't find any info that matched what you gave us, make sure you typed in everything correctly!