Page MenuHomePhabricator

Improved script to delete idle user accounts
Closed, ResolvedPublic

Description

Author: webmaster

Description:
I will attach a improved perl script version of the
maintenance/delete-idle-wiki-users.pl
I will also attach a php version of the same script.

Both have been corrected for MW 1.5.x


Version: unspecified
Severity: enhancement

Details

Reference
bz4417

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 8:59 PM
bzimport set Reference to bz4417.
bzimport added a subscriber: Unknown Object (MLST).

webmaster wrote:

A much improved perl version of the original script

attachment delete-idle-wiki-users.pl ignored as obsolete

webmaster wrote:

The PHP version of the script (with better naming and stuff)

attachment deleteIdleUsers.php ignored as obsolete

robchur wrote:

Can we have it as a unified diff to the existing file in CVS? Patch against 1.5,
obviously.

avarab wrote:

(In reply to comment #3)

Can we have it as a unified diff to the existing file in CVS? Patch against 1.5,
obviously.

They're new files so a diff isn't needed.

avarab wrote:

Just to comment on the logic, they're two 1.4 branch maintenance scripts that
delete all users that don't have any edits. That might not be desireable on some
wikis (especially Wikimedia ones) since one wouldn't want to delete recently
created users, or any at all..

robchur wrote:

(In reply to comment #4)

They're new files so a diff isn't needed.

Whoops. ;-)

webmaster wrote:

The first is an updated version of the existing file. Just overwrite the old file and
call a "CVS diff" before committing.

The second one is a new file.

webmaster wrote:

Someone marked this as version 1.4 but this is only for 1.5 versions.
Please just add the PHP file to the repository and remove the perl file from
repository.
It's as simple as that.

robchur wrote:

(In reply to comment #8)

Someone marked this as version 1.4 but this is only for 1.5 versions.
Please just add the PHP file to the repository and remove the perl file from
repository.
It's as simple as that.

The PHP file appears to be using the old schema, and hence is _NOT_ for 1.5.x
branch. This can't be committed to REL_1_5 or HEAD in that state.

webmaster wrote:

Then it really needs a review, because as far as I know, that IS the 1.5 schema.
We need a guru here :)

Comment on attachment 1246
The PHP version of the script (with better naming and stuff)

Uses old schema, obsolete.

Comment on attachment 1245
A much improved perl version of the original script

Uses old schema, obsolete.

robchur wrote:

Writing a new version of the PHP script now.

A couple notes on the PHP version:

  • the table to check in 1.5 is 'revision', not 'cur' and 'old'.
  • you should absolutely *not* do stuff like this:

$dbw->numRows($dbw->query("SELECT * FROM $cur ..."));
That's reaaaally inefficient if the user *does* have contributions -- especially if they have a
very large number. Instead, use SELECT COUNT(*) and retrieve the number.

robchur wrote:

Done, committed to HEAD and backported to 1.5.