sub isTroll {
my $slashdb = getCurrentDB();
my $user = getCurrentUser();
my $form = getCurrentForm();
return 0 if $user->{seclev} >= 100;
my $good_behavior = 0;
if (!$user->{is_anon} and $user->{karma} >= 1) {
if ($form->{postanon}) {
# If the user is signed in but posting anonymously,
# their karma helps a little bit to offset their
# trollishness. But not much.
$good_behavior = int(log($user->{karma})+0.5);
} else {
# If the user is signed in with karma at least 1 and
# posts with their name, the IP ban doesn't apply.
return 0;
}
}
(Score: 2) by kolie on Monday October 20, @08:56PM
Relevant code is Comments.pm - function isTroll
sub isTroll {
my $slashdb = getCurrentDB();
my $user = getCurrentUser();
my $form = getCurrentForm();
return 0 if $user->{seclev} >= 100;
my $good_behavior = 0;
if (!$user->{is_anon} and $user->{karma} >= 1) {
if ($form->{postanon}) {
# If the user is signed in but posting anonymously,
# their karma helps a little bit to offset their
# trollishness. But not much.
$good_behavior = int(log($user->{karma})+0.5);
} else {
# If the user is signed in with karma at least 1 and
# posts with their name, the IP ban doesn't apply.
return 0;
}
}
return $slashdb->getIsTroll($good_behavior);
}