diff --git a/html/inc/boinc_db.inc b/html/inc/boinc_db.inc index 47aba87948..87b7c5a8fa 100644 --- a/html/inc/boinc_db.inc +++ b/html/inc/boinc_db.inc @@ -473,7 +473,7 @@ class BoincPrivateMessage { $db = BoincDb::get(); return $db->delete($this, 'private_messages'); } - function delete_aux($clause) { + static function delete_aux($clause) { $db = BoincDb::get(); return $db->delete_aux('private_messages', $clause); } diff --git a/html/inc/forum.inc b/html/inc/forum.inc index ddb3e2202e..fec13558e7 100644 --- a/html/inc/forum.inc +++ b/html/inc/forum.inc @@ -926,6 +926,7 @@ function forum_delete_user($user) { } $p = BoincForumPrefs::lookup_userid($user->id); if ($p) $p->delete(); + BoincForumLogging::delete_aux("userid=$user->id"); } function move_post($post, $old_thread, $old_forum, $new_thread, $new_forum) { diff --git a/html/ops/delete_spammers.php b/html/ops/delete_spammers.php index 7cf9c7c08d..d504ae7a50 100755 --- a/html/ops/delete_spammers.php +++ b/html/ops/delete_spammers.php @@ -70,6 +70,8 @@ function delete_user($user) { } delete_profile($user); forum_delete_user($user); + BoincPrivateMessage::delete_aux("userid=$user->id or senderid=$user->id"); + BoincNotify::delete_aux("userid=$user->id"); $q = "delete from user where id=$user->id"; mysql_query($q); } diff --git a/html/user/pm.php b/html/user/pm.php index 092c91e24f..5134155828 100644 --- a/html/user/pm.php +++ b/html/user/pm.php @@ -90,6 +90,11 @@ function do_inbox($logged_in_user) { echo "".tra("Subject")."".tra("Sender and date")."".tra("Message")."\n"; $i = 0; foreach($msgs as $msg) { + $sender = BoincUser::lookup_id($msg->senderid); + if (!$sender) { + $msg->delete(); + continue; + } $i++; $class = ($i%2)? "row0": "row1"; echo "\n"; @@ -98,7 +103,7 @@ function do_inbox($logged_in_user) { $msg->update("opened=1"); } echo " $checkbox $msg->subject \n"; - echo "".user_links(BoincUser::lookup_id($msg->senderid)); + echo "".user_links($sender); show_block_link($msg->senderid); echo "
".time_str($msg->date)."\n"; echo "".output_transform($msg->content, $options)."

";