107 lines
3.6 KiB
Text
107 lines
3.6 KiB
Text
|
|
<?_c
|
||
|
|
# This code was forked from the LiveJournal project owned and operated
|
||
|
|
# by Live Journal, Inc. The code has been modified and expanded by
|
||
|
|
# Dreamwidth Studios, LLC. These files were originally licensed under
|
||
|
|
# the terms of the license supplied by Live Journal, Inc, which can
|
||
|
|
# currently be found at:
|
||
|
|
#
|
||
|
|
# http://code.livejournal.org/trac/livejournal/browser/trunk/LICENSE-LiveJournal.txt
|
||
|
|
#
|
||
|
|
# In accordance with the original license, this code and all its
|
||
|
|
# modifications are provided under the GNU General Public License.
|
||
|
|
# A copy of that license can be found in the LICENSE file included as
|
||
|
|
# part of this distribution.
|
||
|
|
_c?>
|
||
|
|
<?page
|
||
|
|
body<=
|
||
|
|
<?_code
|
||
|
|
{
|
||
|
|
use strict;
|
||
|
|
use vars qw(%GET %POST);
|
||
|
|
|
||
|
|
use LJ::Message;
|
||
|
|
|
||
|
|
BML::decl_params(msgid => 'digits',
|
||
|
|
confirm => '.',
|
||
|
|
spam => '.',
|
||
|
|
ban => '.',
|
||
|
|
lj_form_auth => '.',
|
||
|
|
);
|
||
|
|
|
||
|
|
my $remote = LJ::get_remote() or return "<?needlogin?>";
|
||
|
|
my $remote_id = $remote->{'userid'};
|
||
|
|
|
||
|
|
my $msg_id = $GET{msgid} || $POST{msgid};
|
||
|
|
my $msg = LJ::Message->load({msgid => $msg_id, journalid => $remote_id});
|
||
|
|
|
||
|
|
return "<?p Message cannot be loaded p?>"
|
||
|
|
unless $msg && $msg->valid;
|
||
|
|
|
||
|
|
return "<?p You cannot report a message you sent as spam. p?>"
|
||
|
|
if $msg->type eq "out";
|
||
|
|
|
||
|
|
return "<?p You are not allowed to report messages as spam. p?>"
|
||
|
|
if LJ::sysban_check( 'spamreport', $remote->user );
|
||
|
|
|
||
|
|
my $body = '';
|
||
|
|
|
||
|
|
if (LJ::did_post() && $POST{'confirm'}) {
|
||
|
|
return "<?h1 $ML{'Error'} h1?><?p $ML{'error.invalidform'} p?>"
|
||
|
|
unless LJ::check_form_auth();
|
||
|
|
|
||
|
|
# Some action must be selected
|
||
|
|
return "<?h1 $ML{'Error'} h1?><?p No action selected p?>"
|
||
|
|
unless ($POST{spam} || $POST{'ban'});
|
||
|
|
|
||
|
|
$body .= '<ul>';
|
||
|
|
# Mark as spam
|
||
|
|
if ($POST{spam}) {
|
||
|
|
$body .= '<li>Message marked as spam.</li>'
|
||
|
|
if $msg->mark_as_spam;
|
||
|
|
}
|
||
|
|
|
||
|
|
# Ban user
|
||
|
|
if ($POST{'ban'}) {
|
||
|
|
LJ::set_rel($remote_id, $msg->otherid, 'B');
|
||
|
|
$remote->log_event('ban_set', { actiontarget => $msg->otherid, remote => $remote });
|
||
|
|
$body .= '<li>User banned.</li>';
|
||
|
|
}
|
||
|
|
|
||
|
|
$body .= "</ul>\n";
|
||
|
|
|
||
|
|
$body .= "<?p What would you like to do next? p?>\n";
|
||
|
|
$body .= "<ul><li><a href='$LJ::SITEROOT/inbox/'>Go to the Inbox</a></li>";
|
||
|
|
$body .= "<li><a href='$LJ::SITEROOT/'>Go to the Home page</a></li>";
|
||
|
|
$body .= "<li><a href='$LJ::SITEROOT/manage/profile/'>Edit your profile</a></li></ul>";
|
||
|
|
|
||
|
|
return $body;
|
||
|
|
}
|
||
|
|
|
||
|
|
$body .= "<?p Are you sure you want to mark this message as spam? p?>";
|
||
|
|
|
||
|
|
$body .= "<form method='post'>";
|
||
|
|
$body .= LJ::form_auth();
|
||
|
|
|
||
|
|
$body .= "<div class='highlight-box'>" . LJ::html_check({name => 'spam', id => 'spam', checked => "checked"});
|
||
|
|
$body .= "<label for='spam'>Mark this message as spam</label></div>";
|
||
|
|
|
||
|
|
$body .= "<div>" . LJ::html_check({ 'type' => 'check', 'name' => 'ban', 'id' => 'ban' });
|
||
|
|
$body .= "<label for='ban'>";
|
||
|
|
$body .= "Ban ". LJ::ljuser($msg->other_u) ." from sending you messages and commenting in your journal.";
|
||
|
|
$body .= "</label></div>";
|
||
|
|
|
||
|
|
$body .= "<div align='center' style='margin: 8px'>";
|
||
|
|
$body .= LJ::html_hidden({name => 'msgid', value => $msg->msgid});
|
||
|
|
$body .= LJ::html_submit('confirm', 'Confirm') . "</div>\n";
|
||
|
|
$body .= "</form>";
|
||
|
|
|
||
|
|
$body .= "<p><strong>Note:</strong> From the <a href='/manage/profile/'>Edit Profile</a> page, you can change your $LJ::SITENAMEABBREV User Messaging settings.</p>";
|
||
|
|
|
||
|
|
return $body;
|
||
|
|
}
|
||
|
|
_code?>
|
||
|
|
<=body
|
||
|
|
title=><?_code return "Mark Message as Spam"; _code?>
|
||
|
|
<=body
|
||
|
|
page?>
|