e530a3bcb74a0177e8ab7602de7c50ef41795c3f
3 * This script verifies that database usernames are actually valid.
4 * An existing usernames can become invalid if User::isValidUserName()
5 * is altered or if we change the $wgMaxNameChars
11 require_once( "Maintenance.php" );
13 class CheckUsernames
extends Maintenance
{
15 public function __construct() {
16 parent
::__construct();
17 $this->mDescription
= "Verify that database usernames are actually valid";
21 $dbr = wfGetDB( DB_SLAVE
);
23 $res = $dbr->select( 'user',
24 array( 'user_id', 'user_name' ),
29 while ( $row = $dbr->fetchObject( $res ) ) {
30 if ( ! User
::isValidUserName( $row->user_name
) ) {
31 $this->error( sprintf( "%s: %6d: '%s'\n", wfWikiID(), $row->user_id
, $row->user_name
) );
32 wfDebugLog( 'checkUsernames', $out );
38 $maintClass = "CheckUsernames";
39 require_once( "doMaintenance.php" );