2009-04-08 17:46:47 +00:00
|
|
|
<?php
|
|
|
|
|
2009-04-08 17:47:59 +00:00
|
|
|
// This file is part of BOINC.
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2008 University of California
|
|
|
|
//
|
|
|
|
// BOINC is free software; you can redistribute it and/or modify it
|
|
|
|
// under the terms of the GNU Lesser General Public License
|
|
|
|
// as published by the Free Software Foundation,
|
|
|
|
// either version 3 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// BOINC is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public License
|
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2009-04-08 17:46:47 +00:00
|
|
|
// Script to help you purge spam profiles.
|
|
|
|
//
|
|
|
|
// To use: do the following query from mysql:
|
|
|
|
//
|
|
|
|
// select name, id from user, profile where user.id=profile.userid and match(response1, response2) against ('Viagra');
|
|
|
|
// (replace "Viagra" with other keywords)
|
|
|
|
//
|
|
|
|
// Then copy the ids into the array below and run this script
|
|
|
|
|
2010-04-19 18:35:10 +00:00
|
|
|
error_reporting(E_ALL);
|
|
|
|
ini_set('display_errors', true);
|
|
|
|
ini_set('display_startup_errors', true);
|
2009-10-02 18:32:40 +00:00
|
|
|
$cli_only = true;
|
2009-09-15 18:14:37 +00:00
|
|
|
require_once("../inc/util_ops.inc");
|
|
|
|
|
2009-04-08 17:46:47 +00:00
|
|
|
db_init();
|
|
|
|
|
|
|
|
$ids = array(
|
|
|
|
9031517,
|
|
|
|
9031518,
|
|
|
|
);
|
|
|
|
|
2010-04-19 18:35:10 +00:00
|
|
|
function purge_user($id) {
|
2009-04-08 17:46:47 +00:00
|
|
|
mysql_query("delete from user where id=$id");
|
|
|
|
mysql_query("delete from profile where userid=$id");
|
2010-01-29 16:28:46 +00:00
|
|
|
mysql_query("delete from thread where owner=$id");
|
|
|
|
mysql_query("delete from post where user=$id");
|
2009-04-08 17:46:47 +00:00
|
|
|
}
|
|
|
|
|
2010-04-19 18:35:10 +00:00
|
|
|
function purge_users($ids) {
|
|
|
|
foreach ($ids as $id) {
|
|
|
|
purge_user($id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// purge_users($ids);
|
|
|
|
|
|
|
|
function profile_word($word) {
|
|
|
|
$q = "select userid from profile where response1 like '%$word%'";
|
|
|
|
echo "$q\n";
|
|
|
|
$r = mysql_query($q);
|
|
|
|
while ($x = mysql_fetch_object($r)) {
|
|
|
|
purge_user($x->userid);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//profile_word("viagra");
|
|
|
|
|
2009-04-08 17:46:47 +00:00
|
|
|
?>
|