From: Ævar Arnfjörð Bjarmason Date: Sun, 18 Sep 2005 18:59:14 +0000 (+0000) Subject: * A maintenance script to check the validity of user names X-Git-Tag: 1.6.0~1615 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=d42f8b3a5ea92066517a11443d18dbbf703a272a;p=lhc%2Fweb%2Fwiklou.git * A maintenance script to check the validity of user names --- diff --git a/maintenance/checkUsernames.php b/maintenance/checkUsernames.php new file mode 100644 index 0000000000..9f5f37c7d6 --- /dev/null +++ b/maintenance/checkUsernames.php @@ -0,0 +1,32 @@ +stderr = fopen( 'php://stderr', 'wt' ); + } + function main() { + global $wgDBname; + $fname = 'checkUsernames::main'; + + $dbr =& wfGetDB( DB_SLAVE ); + + $res = $dbr->select( 'user', + array( 'user_id', 'user_name' ), + null, + $fname + ); + + fwrite( $this->stderr, "Checking $wgDBname\n" ); + while ( $row = $dbr->fetchObject( $res ) ) { + if ( ! User::isValidUserName( $row->user_name ) ) + printf( "%s: %6d: %s\n", $wgDBname, $row->user_id, $row->user_name ); + } + } +} + +$cun = new checkUsernames; +$cun->main();