X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2FdeleteBatch.php;h=6c89e671eabecabb364ced4255b9f7efb30d6dc2;hb=8b46b893be54b9b5fe083c8cb50989cdfad91610;hp=e6321e1ffb31c53bce5d7ced07985c47f97273b0;hpb=7ee3a118ebfd72862c60155b64b0bb39ab27d066;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/deleteBatch.php b/maintenance/deleteBatch.php index e6321e1ffb..6c89e671ea 100644 --- a/maintenance/deleteBatch.php +++ b/maintenance/deleteBatch.php @@ -55,11 +55,15 @@ class DeleteBatch extends Maintenance { chdir( $oldCwd ); # Options processing - $username = $this->getOption( 'u', 'Delete page script' ); + $username = $this->getOption( 'u', false ); $reason = $this->getOption( 'r', '' ); $interval = $this->getOption( 'i', 0 ); - $user = User::newFromName( $username ); + if ( $username === false ) { + $user = User::newSystemUser( 'Delete page script', array( 'steal' => true ) ); + } else { + $user = User::newFromName( $username ); + } if ( !$user ) { $this->error( "Invalid username", true ); } @@ -76,7 +80,7 @@ class DeleteBatch extends Maintenance { $this->error( "Unable to read file, exiting", true ); } - $dbw = wfGetDB( DB_MASTER ); + $dbw = $this->getDB( DB_MASTER ); # Handle each entry // @codingStandardsIgnoreStart Ignore Generic.CodeAnalysis.ForLoopWithTestFunctionCall.NotAllowed