From 5565aa1881d0ca5f7051aabad3940f0bb9cb9d30 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sun, 26 Mar 2017 18:49:29 -0700 Subject: [PATCH] enhance spam deleter; tweak moderation message --- html/inc/forum.inc | 1 + html/ops/delete_spammers.php | 11 +++++++---- html/user/team_display.php | 3 +++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/html/inc/forum.inc b/html/inc/forum.inc index a9cd807bf5..db7be99523 100644 --- a/html/inc/forum.inc +++ b/html/inc/forum.inc @@ -798,6 +798,7 @@ function post_rules() {
  • No abusive comments involving race, religion, nationality, gender, class or sexuality.
  • The posting privileges of violators may be suspended or revoked. +
  • If your account is suspended, don't create a new one. ").$project_rules." "; diff --git a/html/ops/delete_spammers.php b/html/ops/delete_spammers.php index d4e5a06431..18360b072d 100755 --- a/html/ops/delete_spammers.php +++ b/html/ops/delete_spammers.php @@ -83,7 +83,7 @@ // delete teams (and their owners) where the team // - has 0 or 1 members // - has no total credit -// - has description containing a link +// - has description containing a link, or a URL // - is not a BOINC-Wide team // and the owner // - has no posts @@ -299,9 +299,12 @@ function delete_teams() { foreach ($teams as $team) { $n = team_count_members($team->id); if ($n > 1) continue; - if (!has_link($team->description)) continue; - $user = BoincUser::lookup_id($team->userid); - if ($user) { + if (!has_link($team->description) && !$team->url) continue; + $users = BoincUser::enum("teamid = $team->id"); + if (count($users)) { + $user = $users[0]; + if ($user->seti_nresults) continue; + // for SETI@home $n = BoincPost::count("user=$user->id"); if ($n) continue; $n = BoincHost::count("userid=$user->id"); diff --git a/html/user/team_display.php b/html/user/team_display.php index 2ea89edd69..1190da4f0a 100644 --- a/html/user/team_display.php +++ b/html/user/team_display.php @@ -27,6 +27,9 @@ check_get_args(array("teamid")); $teamid = get_int("teamid"); $team = BoincTeam::lookup_id($teamid); +if (!$team) { + error_page("no such team"); +} $get_from_db = false;