summaryrefslogtreecommitdiff
path: root/maintenance/removeUnusedAccounts.inc
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/removeUnusedAccounts.inc')
-rw-r--r--maintenance/removeUnusedAccounts.inc46
1 files changed, 0 insertions, 46 deletions
diff --git a/maintenance/removeUnusedAccounts.inc b/maintenance/removeUnusedAccounts.inc
deleted file mode 100644
index 02c07c1f..00000000
--- a/maintenance/removeUnusedAccounts.inc
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-
-/**
- * Support functions for the removeUnusedAccounts maintenance script
- *
- * @file
- * @ingroup Maintenance
- * @author Rob Church <robchur@gmail.com>
- */
-
-/**
- * Could the specified user account be deemed inactive?
- * (No edits, no deleted edits, no log entries, no current/old uploads)
- *
- * @param $id User's ID
- * @param $master Perform checking on the master
- * @return bool
- */
-function isInactiveAccount( $id, $master = false ) {
- $dbo = wfGetDB( $master ? DB_MASTER : DB_SLAVE );
- $fname = 'isInactiveAccount';
- $checks = array( 'revision' => 'rev', 'archive' => 'ar', 'logging' => 'log',
- 'image' => 'img', 'oldimage' => 'oi' );
- $count = 0;
-
- $dbo->immediateBegin();
- foreach( $checks as $table => $fprefix ) {
- $conds = array( $fprefix . '_user' => $id );
- $count += (int)$dbo->selectField( $table, 'COUNT(*)', $conds, $fname );
- }
- $dbo->immediateCommit();
-
- return $count == 0;
-}
-
-/**
- * Show help for the maintenance script
- */
-function showHelp() {
- echo( "Delete unused user accounts from the database.\n\n" );
- echo( "USAGE: php removeUnusedAccounts.php [--delete]\n\n" );
- echo( " --delete : Delete accounts which are discovered to be inactive\n" );
- echo( " --ignore-touched=x : Ignore accounts touched within the lasts x days\n" );
- echo( " --ignore-groups=x,y : Ignore accounts within these groups\n" );
- echo( "\n" );
-}