|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
// This file is part of BOINC. |
|
4
|
|
|
// http://boinc.berkeley.edu |
|
5
|
|
|
// Copyright (C) 2008 University of California |
|
6
|
|
|
// |
|
7
|
|
|
// BOINC is free software; you can redistribute it and/or modify it |
|
8
|
|
|
// under the terms of the GNU Lesser General Public License |
|
9
|
|
|
// as published by the Free Software Foundation, |
|
10
|
|
|
// either version 3 of the License, or (at your option) any later version. |
|
11
|
|
|
// |
|
12
|
|
|
// BOINC is distributed in the hope that it will be useful, |
|
13
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
|
15
|
|
|
// See the GNU Lesser General Public License for more details. |
|
16
|
|
|
// |
|
17
|
|
|
// You should have received a copy of the GNU Lesser General Public License |
|
18
|
|
|
// along with BOINC. If not, see <http://www.gnu.org/licenses/>. |
|
19
|
|
|
|
|
20
|
|
|
// Script to help you purge spam profiles. |
|
21
|
|
|
// |
|
22
|
|
|
// To use: do the following query from mysql: |
|
23
|
|
|
// |
|
24
|
|
|
// select name, id from user, profile where user.id=profile.userid and match(response1, response2) against ('Viagra'); |
|
25
|
|
|
// (replace "Viagra" with other keywords) |
|
26
|
|
|
// |
|
27
|
|
|
// Then copy the ids into the array below and run this script |
|
28
|
|
|
|
|
29
|
|
|
error_reporting(E_ALL); |
|
30
|
|
|
ini_set('display_errors', true); |
|
|
|
|
|
|
31
|
|
|
ini_set('display_startup_errors', true); |
|
32
|
|
|
$cli_only = true; |
|
33
|
|
|
require_once("../inc/util_ops.inc"); |
|
34
|
|
|
|
|
35
|
|
|
db_init(); |
|
36
|
|
|
|
|
37
|
|
|
$ids = array( |
|
38
|
|
|
9031517, |
|
39
|
|
|
9031518, |
|
40
|
|
|
); |
|
41
|
|
|
|
|
42
|
|
|
function purge_user($id) { |
|
43
|
|
|
_mysql_query("delete from user where id=$id"); |
|
44
|
|
|
_mysql_query("delete from profile where userid=$id"); |
|
45
|
|
|
_mysql_query("delete from thread where owner=$id"); |
|
46
|
|
|
_mysql_query("delete from post where user=$id"); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
function purge_users($ids) { |
|
50
|
|
|
foreach ($ids as $id) { |
|
51
|
|
|
purge_user($id); |
|
52
|
|
|
} |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
// purge_users($ids); |
|
56
|
|
|
|
|
57
|
|
|
function profile_word($word) { |
|
58
|
|
|
$q = "select userid from profile where response1 like '%$word%'"; |
|
59
|
|
|
echo "$q\n"; |
|
60
|
|
|
$r = _mysql_query($q); |
|
61
|
|
|
while ($x = _mysql_fetch_object($r)) { |
|
62
|
|
|
purge_user($x->userid); |
|
63
|
|
|
} |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
//profile_word("viagra"); |
|
67
|
|
|
|
|
68
|
|
|
?> |
|
69
|
|
|
|