BOINC /
boinc
| 1 | #!/usr/bin/env php |
||||
| 2 | |||||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||||
| 3 | <?php |
||||
|
0 ignored issues
–
show
|
|||||
| 4 | // This file is part of BOINC. |
||||
| 5 | // http://boinc.berkeley.edu |
||||
| 6 | // Copyright (C) 2024 University of California |
||||
| 7 | // |
||||
| 8 | // BOINC is free software; you can redistribute it and/or modify it |
||||
| 9 | // under the terms of the GNU Lesser General Public License |
||||
| 10 | // as published by the Free Software Foundation, |
||||
| 11 | // either version 3 of the License, or (at your option) any later version. |
||||
| 12 | // |
||||
| 13 | // BOINC is distributed in the hope that it will be useful, |
||||
| 14 | // but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
| 15 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||||
| 16 | // See the GNU Lesser General Public License for more details. |
||||
| 17 | // |
||||
| 18 | // You should have received a copy of the GNU Lesser General Public License |
||||
| 19 | // along with BOINC. If not, see <http://www.gnu.org/licenses/>. |
||||
| 20 | // ----------------------------------------------- |
||||
| 21 | |||||
| 22 | // delete_spammers.php [--test] [--min_days n] [--max_days n] command |
||||
| 23 | // |
||||
| 24 | // script to delete spammer accounts, profiles, forum posts, and/or teams. |
||||
| 25 | // The various options delete different categories of spammers. |
||||
| 26 | // |
||||
| 27 | // USE WITH CARE. You don't want to delete legit accounts. |
||||
| 28 | // Run with --test and examine the results first. |
||||
| 29 | |||||
| 30 | // In this context, 'spam' is text that advertises something |
||||
| 31 | // (e.g. viagra, porn sites etc.) and contains hyperlinks. |
||||
| 32 | // Spammers can put such text in |
||||
| 33 | // - profiles |
||||
| 34 | // - team URLs or descriptions |
||||
| 35 | // - account URLs |
||||
| 36 | // - forum posts |
||||
| 37 | // |
||||
| 38 | // All the above can legitimately contain links, |
||||
| 39 | // so to decide what's spam we look at attributes of the user: |
||||
| 40 | // - whether they've attached a client to the project |
||||
| 41 | // Most spammers haven't, so they have no hosts. |
||||
| 42 | // Note: legit users might create an account just to participate |
||||
| 43 | // in the project forums (e.g. Science United users). |
||||
| 44 | // So we generally need to check for forum activity. |
||||
| 45 | // - whether they've been granted any credit |
||||
| 46 | // This is more stringent. |
||||
| 47 | // But we need to take into account that it may take a month or two |
||||
| 48 | // to get credit because of validation |
||||
| 49 | // |
||||
| 50 | // When we identify spam, we delete everything associated with that user: |
||||
| 51 | // - profile |
||||
| 52 | // - forum stuff: post, thread, subscriptions etc. |
||||
| 53 | // - private messages |
||||
| 54 | // - friend links |
||||
| 55 | // - badges |
||||
| 56 | |||||
| 57 | // options: |
||||
| 58 | // --min_days N |
||||
| 59 | // Only delete accounts created at least N days ago |
||||
| 60 | // --max_days N |
||||
| 61 | // Only delete accounts created at most N days ago |
||||
| 62 | // --test |
||||
| 63 | // Show what accounts would be deleted, but don't delete them |
||||
| 64 | // |
||||
| 65 | // commands: |
||||
| 66 | // |
||||
| 67 | // --profiles |
||||
| 68 | // delete accounts that |
||||
| 69 | // - have a profile containing a link. |
||||
| 70 | // - have no hosts |
||||
| 71 | // - have no message-board posts |
||||
| 72 | // |
||||
| 73 | // --user_url |
||||
| 74 | // delete accounts that |
||||
| 75 | // - have a nonempty URL |
||||
| 76 | // - have no hosts |
||||
| 77 | // - have no message-board posts |
||||
| 78 | // Use for spammers who create accounts with commercial URLs. |
||||
| 79 | // |
||||
| 80 | // --user_null |
||||
| 81 | // delete accounts that |
||||
| 82 | // - have no hosts |
||||
| 83 | // - have no message-board posts |
||||
| 84 | // - don't belong to a team |
||||
| 85 | // Spammers may create accounts and attempt to create a profile but fail. |
||||
| 86 | // This cleans up those accounts. |
||||
| 87 | // |
||||
| 88 | // --forums |
||||
| 89 | // delete accounts that |
||||
| 90 | // - have no hosts |
||||
| 91 | // - have message-board posts containing links or URLs |
||||
| 92 | // - don't belong to a team (avoid deleting BOINC-wide team owners) |
||||
| 93 | // Use this for spammers who create accounts and post spam. |
||||
| 94 | // Don't use this for non-computing projects (like BOINC message boards). |
||||
| 95 | // In fact, don't use this in general: |
||||
| 96 | // it will delete users who join to participate in forums. |
||||
| 97 | // |
||||
| 98 | // --profiles_strict |
||||
| 99 | // delete accounts that have a profile and no message-board posts. |
||||
| 100 | // For the BOINC message boards. |
||||
| 101 | // |
||||
| 102 | // --list filename |
||||
| 103 | // "filename" contains a list of user IDs, one per line. |
||||
| 104 | // |
||||
| 105 | // --id_range N M |
||||
| 106 | // delete users with ID N to M inclusive |
||||
| 107 | // --id N |
||||
| 108 | // delete user N |
||||
| 109 | // |
||||
| 110 | // --teams |
||||
| 111 | // delete teams (and their owners and members) where the team |
||||
| 112 | // - has no total credit |
||||
| 113 | // - has description containing a link, or a URL |
||||
| 114 | // - is not a BOINC-Wide team |
||||
| 115 | // and the owner and members |
||||
| 116 | // - have no posts |
||||
| 117 | // - have no hosts |
||||
| 118 | // |
||||
| 119 | // --all (recommended for BOINC projects) |
||||
| 120 | // Does: --teams --user_url --profiles |
||||
| 121 | // Doesn't do --forums (see comments above). |
||||
| 122 | // Can use moderators for that. |
||||
| 123 | |||||
| 124 | error_reporting(E_ALL); |
||||
| 125 | ini_set('display_errors', true); |
||||
|
0 ignored issues
–
show
true of type true is incompatible with the type string expected by parameter $value of ini_set().
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 126 | ini_set('display_startup_errors', true); |
||||
| 127 | ini_set('memory_limit', '4G'); |
||||
| 128 | |||||
| 129 | require_once("../inc/db.inc"); |
||||
| 130 | require_once("../inc/profile.inc"); |
||||
| 131 | require_once("../inc/forum.inc"); |
||||
| 132 | require_once("../inc/user_util.inc"); |
||||
| 133 | db_init(); |
||||
| 134 | |||||
| 135 | $min_days = 0; |
||||
| 136 | $max_days = 0; |
||||
| 137 | $test = false; |
||||
| 138 | |||||
| 139 | // delete a spammer account, and everything associated with it |
||||
| 140 | // |
||||
| 141 | function do_delete_user($user) { |
||||
| 142 | global $test; |
||||
| 143 | $age = (time() - $user->create_time) / 86400; |
||||
| 144 | echo "deleting user\n"; |
||||
| 145 | echo " ID: $user->id\n"; |
||||
| 146 | echo " email: $user->email_addr\n"; |
||||
| 147 | echo " name: $user->name\n"; |
||||
| 148 | echo " URL: $user->url\n"; |
||||
| 149 | echo " age:$age days\n"; |
||||
| 150 | if ($test) { |
||||
| 151 | $n = count(BoincHost::enum("userid=$user->id")); |
||||
| 152 | $m = count(BoincPost::enum("user=$user->id")); |
||||
| 153 | echo " $n hosts\n"; |
||||
| 154 | echo " $m posts\n"; |
||||
| 155 | echo " (test mode - nothing deleted)\n"; |
||||
| 156 | return; |
||||
| 157 | } |
||||
| 158 | delete_user($user); |
||||
| 159 | } |
||||
| 160 | |||||
| 161 | function delete_list($fname) { |
||||
| 162 | $f = fopen($fname, "r"); |
||||
| 163 | if (!$f) die("no such file $fname\n"); |
||||
|
0 ignored issues
–
show
|
|||||
| 164 | while ($s = fgets($f)) { |
||||
| 165 | $s = trim($s); |
||||
| 166 | if (!is_numeric($s)) die("bad ID $s\n"); |
||||
|
0 ignored issues
–
show
|
|||||
| 167 | $user = BoincUser::lookup_id((int)$s); |
||||
| 168 | if ($user) { |
||||
| 169 | do_delete_user($user); |
||||
| 170 | } else { |
||||
| 171 | echo "no user ID $s\n"; |
||||
| 172 | } |
||||
| 173 | } |
||||
| 174 | } |
||||
| 175 | |||||
| 176 | function has_link($x) { |
||||
| 177 | if (strstr($x, "<a ")) return true; |
||||
| 178 | if (strstr($x, "[url")) return true; |
||||
| 179 | if (strstr($x, "http://")) return true; |
||||
| 180 | if (strstr($x, "https://")) return true; |
||||
| 181 | if (strstr($x, "www.")) return true; |
||||
| 182 | return false; |
||||
| 183 | } |
||||
| 184 | |||||
| 185 | // delete users with |
||||
| 186 | // - no hosts |
||||
| 187 | // - no team |
||||
| 188 | // - posts contain links and/or URLs |
||||
| 189 | // |
||||
| 190 | function delete_forums() { |
||||
| 191 | global $min_days, $max_days; |
||||
| 192 | |||||
| 193 | // if they've posted, they'll have forum prefs. |
||||
| 194 | // This is faster than enumerating all users |
||||
| 195 | // |
||||
| 196 | $prefs = BoincForumPrefs::enum("posts>0"); |
||||
| 197 | $count = 0; |
||||
| 198 | foreach ($prefs as $p) { |
||||
| 199 | $user = BoincUser::lookup_id($p->userid); |
||||
| 200 | if (!$user) { |
||||
| 201 | echo "missing user $p->userid\n"; |
||||
| 202 | continue; |
||||
| 203 | } |
||||
| 204 | if ($min_days) { |
||||
| 205 | if ($user->create_time > time() - $min_days*86400) continue; |
||||
| 206 | } |
||||
| 207 | if ($max_days) { |
||||
| 208 | if ($user->create_time < time() - $max_days*86400) continue; |
||||
| 209 | } |
||||
| 210 | if ($user->teamid) { |
||||
| 211 | continue; |
||||
| 212 | } |
||||
| 213 | $h = BoincHost::count("userid=$p->userid"); |
||||
| 214 | if ($h) continue; |
||||
| 215 | |||||
| 216 | // posts with at least 2 URLs |
||||
| 217 | $n = BoincPost::count("user=$user->id and (content like '%http%http%')"); |
||||
| 218 | if (!$n) continue; |
||||
| 219 | do_delete_user($user); |
||||
| 220 | $count++; |
||||
| 221 | } |
||||
| 222 | echo "delete_forums(): deleted $count users\n"; |
||||
| 223 | } |
||||
| 224 | |||||
| 225 | function delete_profiles() { |
||||
| 226 | global $test, $min_days, $max_days; |
||||
| 227 | $profiles = BoincProfile::enum(""); |
||||
| 228 | $n = 0; |
||||
| 229 | foreach ($profiles as $p) { |
||||
| 230 | if (has_link($p->response1) || has_link($p->response2)) { |
||||
| 231 | $user = BoincUser::lookup_id($p->userid); |
||||
| 232 | if (!$user) { |
||||
| 233 | echo "profile has missing user: $p->userid\n"; |
||||
| 234 | continue; |
||||
| 235 | } |
||||
| 236 | |||||
| 237 | if ($min_days) { |
||||
| 238 | if ($user->create_time > time() - $min_days*86400) continue; |
||||
| 239 | } |
||||
| 240 | if ($max_days) { |
||||
| 241 | if ($user->create_time < time() - $max_days*86400) continue; |
||||
| 242 | } |
||||
| 243 | |||||
| 244 | $m = BoincHost::count("userid=$p->userid"); |
||||
| 245 | if ($m) continue; |
||||
| 246 | $m = BoincPost::count("user=$p->userid"); |
||||
| 247 | if ($m) continue; |
||||
| 248 | |||||
| 249 | do_delete_user($user); |
||||
| 250 | if ($test) { |
||||
| 251 | echo "\n$p->userid\n$p->response1\n$p->response2\n"; |
||||
| 252 | } |
||||
| 253 | $n++; |
||||
| 254 | } |
||||
| 255 | } |
||||
| 256 | echo "delete_profiles(): deleted $n users\n"; |
||||
| 257 | } |
||||
| 258 | |||||
| 259 | function delete_profiles_strict() { |
||||
| 260 | global $test; |
||||
| 261 | $profiles = BoincProfile::enum(""); |
||||
| 262 | foreach ($profiles as $p) { |
||||
| 263 | $user = BoincUser::lookup_id($p->userid); |
||||
| 264 | if (!$user) { |
||||
| 265 | echo "profile has missing user: $p->userid\n"; |
||||
| 266 | continue; |
||||
| 267 | } |
||||
| 268 | $n = BoincPost::count("user=$p->userid"); |
||||
| 269 | if ($n) continue; |
||||
| 270 | do_delete_user($user); |
||||
| 271 | if ($test) { |
||||
| 272 | echo "\n$p->userid\n$p->response1\n$p->response2\n"; |
||||
| 273 | } |
||||
| 274 | } |
||||
| 275 | } |
||||
| 276 | |||||
| 277 | function delete_users($no_hosts, $no_posts, $no_teams, $have_url) { |
||||
| 278 | global $test, $min_days, $max_days; |
||||
| 279 | $db = BoincDb::get(); |
||||
| 280 | $query = "select a.* from user a "; |
||||
| 281 | if ($no_hosts) { |
||||
| 282 | $query .= " left join host c on c.userid=a.id "; |
||||
| 283 | } |
||||
| 284 | if ($no_posts) { |
||||
| 285 | $query .= " left join post b on a.id=b.user "; |
||||
| 286 | } |
||||
| 287 | if ($no_teams) { |
||||
| 288 | $query .= " left join team d on a.id=d.userid "; |
||||
| 289 | } |
||||
| 290 | $query .= " where true "; |
||||
| 291 | if ($no_hosts) { |
||||
| 292 | $query .= " and c.userid is null "; |
||||
| 293 | } |
||||
| 294 | if ($no_posts) { |
||||
| 295 | $query .= " and b.user is null "; |
||||
| 296 | } |
||||
| 297 | if ($no_teams) { |
||||
| 298 | $query .= " and d.userid is null "; |
||||
| 299 | } |
||||
| 300 | if ($min_days) { |
||||
| 301 | $t = time() - $min_days*86400; |
||||
| 302 | $query .= " and a.create_time < $t "; |
||||
| 303 | } |
||||
| 304 | if ($max_days) { |
||||
| 305 | $t = time() - $max_days*86400; |
||||
| 306 | $query .= " and a.create_time > $t "; |
||||
| 307 | } |
||||
| 308 | |||||
| 309 | $result = $db->do_query($query); |
||||
| 310 | $n = 0; |
||||
| 311 | while ($u = $result->fetch_object()) { |
||||
| 312 | $user = BoincUser::lookup_id($u->id); |
||||
| 313 | if (!$user) { |
||||
| 314 | continue; |
||||
| 315 | } |
||||
| 316 | if ($have_url) { |
||||
| 317 | if (!strlen($user->url)) continue; |
||||
| 318 | } |
||||
| 319 | do_delete_user($user); |
||||
| 320 | $n++; |
||||
| 321 | } |
||||
| 322 | echo "deleted $n users\n"; |
||||
| 323 | } |
||||
| 324 | |||||
| 325 | function delete_banished() { |
||||
| 326 | global $min_days, $max_days; |
||||
| 327 | $fps = BoincForumPrefs::enum("banished_until>0"); |
||||
| 328 | foreach ($fps as $fp) { |
||||
| 329 | $user = BoincUser::lookup_id($fp->userid); |
||||
| 330 | if (!$user) continue; |
||||
| 331 | if ($user->create_time > time() - $min_days*86400) continue; |
||||
| 332 | if ($user->create_time < time() - $max_days*86400) continue; |
||||
| 333 | do_delete_user($user); |
||||
| 334 | } |
||||
| 335 | } |
||||
| 336 | |||||
| 337 | function delete_teams() { |
||||
| 338 | global $min_days, $max_days, $test; |
||||
| 339 | $query = "nusers < 2 and seti_id=0 and total_credit=0"; |
||||
| 340 | if ($min_days) { |
||||
| 341 | $x = time() - $min_days*86400; |
||||
| 342 | $query .= " and create_time < $x"; |
||||
| 343 | } |
||||
| 344 | if ($max_days) { |
||||
| 345 | $x = time() - $max_days*86400; |
||||
| 346 | $query .= " and create_time > $x"; |
||||
| 347 | } |
||||
| 348 | $teams = BoincTeam::enum($query); |
||||
| 349 | $count = 0; |
||||
| 350 | foreach ($teams as $team) { |
||||
| 351 | $founder = null; |
||||
| 352 | if ($team->userid) { |
||||
| 353 | $founder = BoincUser::lookup_id($team->userid); |
||||
| 354 | } |
||||
| 355 | |||||
| 356 | // delete teams with no founder |
||||
| 357 | if (!$founder) { |
||||
| 358 | delete_team($team, []); |
||||
| 359 | $count++; |
||||
| 360 | continue; |
||||
| 361 | } |
||||
| 362 | |||||
| 363 | $n = team_count_members($team->id); |
||||
| 364 | if ($n > 1) continue; |
||||
| 365 | if (!has_link($team->description) && !$team->url) continue; |
||||
| 366 | |||||
| 367 | // get list of team members |
||||
| 368 | // |
||||
| 369 | $users = BoincUser::enum("teamid = $team->id"); |
||||
| 370 | |||||
| 371 | // add team founder if not member |
||||
| 372 | // |
||||
| 373 | if ($founder->teamid != $team->id) { |
||||
| 374 | $users[] = $founder; |
||||
| 375 | } |
||||
| 376 | |||||
| 377 | // if any of these users has signs of life, skip team |
||||
| 378 | // |
||||
| 379 | $life = false; |
||||
| 380 | foreach ($users as $user) { |
||||
| 381 | if ($user->seti_nresults) { |
||||
| 382 | // for SETI@home |
||||
| 383 | $life = true; |
||||
| 384 | break; |
||||
| 385 | } |
||||
| 386 | $n = BoincPost::count("user=$user->id"); |
||||
| 387 | if ($n) { |
||||
| 388 | $life = true; |
||||
| 389 | break; |
||||
| 390 | } |
||||
| 391 | $n = BoincHost::count("userid=$user->id"); |
||||
| 392 | if ($n) { |
||||
| 393 | $life = true; |
||||
| 394 | break; |
||||
| 395 | } |
||||
| 396 | } |
||||
| 397 | if ($life) { |
||||
| 398 | continue; |
||||
| 399 | } |
||||
| 400 | |||||
| 401 | $count++; |
||||
| 402 | delete_team($team, $users); |
||||
| 403 | } |
||||
| 404 | echo "deleted $count teams\n"; |
||||
| 405 | } |
||||
| 406 | |||||
| 407 | function delete_team($team, $users) { |
||||
| 408 | global $test; |
||||
| 409 | if ($test) { |
||||
| 410 | echo "would delete team:\n"; |
||||
| 411 | echo " ID: $team->id\n"; |
||||
| 412 | echo " name: $team->name\n"; |
||||
| 413 | echo " description: $team->description\n"; |
||||
| 414 | echo " URL: $team->url\n"; |
||||
| 415 | foreach ($users as $user) { |
||||
| 416 | echo "would delete user $user->id: $user->email_addr:\n"; |
||||
| 417 | } |
||||
| 418 | } else { |
||||
| 419 | $team->delete(); |
||||
| 420 | echo "deleted team ID $team->id name $team->name\n"; |
||||
| 421 | foreach ($users as $user) { |
||||
| 422 | do_delete_user($user); |
||||
| 423 | } |
||||
| 424 | } |
||||
| 425 | } |
||||
| 426 | |||||
| 427 | function delete_user_id($id) { |
||||
| 428 | $user = BoincUser::lookup_id($id); |
||||
| 429 | if ($user) { |
||||
| 430 | echo "deleting user $id\n"; |
||||
| 431 | do_delete_user($user); |
||||
| 432 | } else { |
||||
| 433 | echo "no such user\n"; |
||||
| 434 | } |
||||
| 435 | } |
||||
| 436 | |||||
| 437 | function delete_user_id_range($id1, $id2) { |
||||
| 438 | for ($i=$id1; $i <= $id2; $i++) { |
||||
| 439 | $user = BoincUser::lookup_id($i); |
||||
| 440 | if ($user) { |
||||
| 441 | echo "deleting user $i\n"; |
||||
| 442 | do_delete_user($user); |
||||
| 443 | } |
||||
| 444 | } |
||||
| 445 | } |
||||
| 446 | |||||
| 447 | // this is for cleaning up BOINC-wide teams |
||||
| 448 | // |
||||
| 449 | function delete_team_id_range($id1, $id2) { |
||||
| 450 | for ($i=$id1; $i <= $id2; $i++) { |
||||
| 451 | echo "deleting team $i\n"; |
||||
| 452 | $team = BoincTeam::lookup_id($i); |
||||
| 453 | if ($team) { |
||||
| 454 | $team->delete(); |
||||
| 455 | $user = BoincUser::lookup_id($team->userid); |
||||
| 456 | if ($user) $user->delete(); |
||||
| 457 | } |
||||
| 458 | } |
||||
| 459 | } |
||||
| 460 | |||||
| 461 | echo "Starting: ".date(DATE_RFC2822)."\n"; |
||||
| 462 | |||||
| 463 | // get settings first |
||||
| 464 | // |
||||
| 465 | for ($i=1; $i<$argc; $i++) { |
||||
| 466 | if ($argv[$i] == "--test") { |
||||
| 467 | $test = true; |
||||
| 468 | } else if ($argv[$i] == "--min_days") { |
||||
| 469 | $min_days = $argv[++$i]; |
||||
| 470 | } else if ($argv[$i] == "--max_days") { |
||||
| 471 | $max_days = $argv[++$i]; |
||||
| 472 | } else if ($argv[$i] == "--days") { // deprecated |
||||
| 473 | $max_days = $argv[++$i]; |
||||
| 474 | } |
||||
| 475 | } |
||||
| 476 | |||||
| 477 | // then do actions |
||||
| 478 | // |
||||
| 479 | for ($i=1; $i<$argc; $i++) { |
||||
| 480 | if ($argv[$i] == "--list") { |
||||
| 481 | delete_list($argv[++$i]); |
||||
| 482 | } else if ($argv[$i] == "--profiles") { |
||||
| 483 | delete_profiles(); |
||||
| 484 | } else if ($argv[$i] == "--profiles_strict") { |
||||
| 485 | delete_profiles_strict(); |
||||
| 486 | } else if ($argv[$i] == "--forums") { |
||||
| 487 | delete_forums(); |
||||
| 488 | } else if ($argv[$i] == "--id_range") { |
||||
| 489 | $id1 = $argv[++$i]; |
||||
| 490 | $id2 = $argv[++$i]; |
||||
| 491 | if (!is_numeric($id1) || !is_numeric($id2)) { |
||||
| 492 | die ("bad args\n"); |
||||
| 493 | } |
||||
| 494 | if ($id2 < $id1) { |
||||
| 495 | die("bad args\n"); |
||||
| 496 | } |
||||
| 497 | delete_user_id_range($id1, $id2); |
||||
| 498 | } else if ($argv[$i] == "--id") { |
||||
| 499 | $id = $argv[++$i]; |
||||
| 500 | if (!is_numeric($id)) { |
||||
| 501 | die ("bad arg\n"); |
||||
| 502 | } |
||||
| 503 | delete_user_id($id); |
||||
| 504 | } else if ($argv[$i] == "--team_id_range") { |
||||
| 505 | $id1 = $argv[++$i]; |
||||
| 506 | $id2 = $argv[++$i]; |
||||
| 507 | if (!is_numeric($id1) || !is_numeric($id2)) { |
||||
| 508 | die ("bad args\n"); |
||||
| 509 | } |
||||
| 510 | if ($id2 < $id1) { |
||||
| 511 | die("bad args\n"); |
||||
| 512 | } |
||||
| 513 | delete_team_id_range($id1, $id2); |
||||
| 514 | } else if ($argv[$i] == "--banished") { |
||||
| 515 | delete_banished(); |
||||
| 516 | } else if ($argv[$i] == "--teams") { |
||||
| 517 | delete_teams(); |
||||
| 518 | } else if ($argv[$i] == "--user_url") { |
||||
| 519 | delete_users(true, true, false, true); |
||||
| 520 | } else if ($argv[$i] == "--user_null") { |
||||
| 521 | delete_users(true, true, true, false); |
||||
| 522 | } else if ($argv[$i] == "--all") { |
||||
| 523 | delete_profiles(); |
||||
| 524 | delete_teams(); |
||||
| 525 | delete_users(true, true, false, true); |
||||
| 526 | } |
||||
| 527 | } |
||||
| 528 | echo "Finished: ".date(DATE_RFC2822)."\n"; |
||||
| 529 | |||||
| 530 | ?> |
||||
| 531 |