function form_switch()
{
var form = document.getElementById('preview');
form.action='send.bml?action=edit';
form.submit();
}
function fill_subject()
{
var request = document.getElementById('request');
var subject = document.getElementById('subject');
var id = request.value;
subject.value = 'Your Account [##-'+id+']';
}
<=head
body<=
If you need to file an abuse request, please do so at:
$LJ::SITEROOT/abuse/report.bml
If you need to file a support request, please do so at:
$LJ::SITEROOT/support/submit.bml p?>";
}
my $compose = sub {
my $edit_mode = shift;
$body .= "\n";
$body .= "
From: | "; my $from = LJ::trim($POST{'from'}); if ($cansend{$from}) { $body .= "$from\@$LJ::DOMAIN"; } else { $errors = 1; $body .= "Invalid address chosen"; } $body .= " |
---|---|
To: | "; my @to; if (LJ::trim($POST{'user'}) ne '') { my $u = LJ::load_user($POST{'user'}); unless ($u) { $errors = 1; $body .= "Invalid username $POST{user}"; } else { push @to, $u->{'email'}; $body .= LJ::ljuser($u) . " ($u->{email})";; } } elsif (LJ::trim($POST{'maints'}) ne '') { my $u = LJ::load_user($POST{'maints'}); if ($u->{journaltype} ne 'C') { $body .= "Community specified is not a community"; } else { my $ids = LJ::load_rel_user($u->{userid}, 'A'); foreach (@$ids) { my $maint = LJ::load_userid($_); push @to, $maint->{'email'} } $body .= "Maintainers of "; $body .= LJ::ljuser($u) . " ("; $body .= join(", ", @to) . ")"; } } elsif (LJ::trim($POST{'email'}) ne '') { my $addr = LJ::trim($POST{'email'}); my @email_errors; LJ::check_email($addr, \@email_errors); if (@email_errors) { $errors = 1; $body .= ""; $body .= join(", ", @email_errors); $body .= ""; } else { push @to, $addr; $body .= $addr; } } else { $errors = 1; $body .= "You must enter a recipient"; } my $bcc = LJ::trim($POST{'bcc'}); if ($bcc ne '') { $body .= " |
Bcc: | "; my @bcc_errors; LJ::check_email($bcc, \@bcc_errors); if (@bcc_errors) { $errors = 1; $body .= ""; $body .= join(", ", @bcc_errors); $body .= ""; } else { $body .= $bcc; } $body .= " |
Request #: | "; if ($request ne '') { unless ($request =~ /^\d+$/) { $body .= "Request id must be numeric"; $errors = 1; } else { $body .= $request; } } else { $body .= "No request specified"; } $body .= " |
Subject: | "; if ($subject eq '') { $body .= "You must specify a subject"; $errors = 1; } else { $body .= $subject; } $body .= " |
Message: | ";
if ($message eq '') {
$body .= "You must specify a message";
$errors = 1;
} else {
my $tmp_mess = $message;
$tmp_mess =~ s/\r?\n/ \n/g; $body .= $tmp_mess; } $body .= " |
"; $body .= ""; $body .= " |