Remove ?>'s from files. They're pointless, and just asking for people to mess with...
[lhc/web/wiklou.git] / maintenance / checkUsernames.php
1 <?php
2 error_reporting(E_ALL ^ E_NOTICE);
3 require_once 'commandLine.inc';
4
5 class checkUsernames {
6 var $stderr, $log;
7
8 function checkUsernames() {
9 $this->stderr = fopen( 'php://stderr', 'wt' );
10 }
11 function main() {
12 $fname = 'checkUsernames::main';
13
14 $dbr = wfGetDB( DB_SLAVE );
15
16 $res = $dbr->select( 'user',
17 array( 'user_id', 'user_name' ),
18 null,
19 $fname
20 );
21
22 while ( $row = $dbr->fetchObject( $res ) ) {
23 if ( ! User::isValidUserName( $row->user_name ) ) {
24 $out = sprintf( "%s: %6d: '%s'\n", wfWikiID(), $row->user_id, $row->user_name );
25 fwrite( $this->stderr, $out );
26 wfDebugLog( 'checkUsernames', $out );
27 }
28 }
29 }
30 }
31
32 $cun = new checkUsernames();
33 $cun->main();
34