X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=maintenance%2Fedit.php;h=b67a9571626f4540117d5459f7f9d1372102ad71;hb=8578488e2b79dddca9a80edba1c9966d88d62ddf;hp=75ec12bfdd1da559d501170dbd856bd1ef0e29ad;hpb=bc3d8e267e5c5fe8ce2ad5acfa8fe03e1752c4aa;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/edit.php b/maintenance/edit.php index 75ec12bfdd..b67a957162 100644 --- a/maintenance/edit.php +++ b/maintenance/edit.php @@ -46,14 +46,18 @@ class EditCLI extends Maintenance { public function execute() { global $wgUser; - $userName = $this->getOption( 'user', 'Maintenance script' ); + $userName = $this->getOption( 'user', false ); $summary = $this->getOption( 'summary', '' ); $minor = $this->hasOption( 'minor' ); $bot = $this->hasOption( 'bot' ); $autoSummary = $this->hasOption( 'autosummary' ); $noRC = $this->hasOption( 'no-rc' ); - $wgUser = User::newFromName( $userName ); + if ( $userName === false ) { + $wgUser = User::newSystemUser( 'Maintenance script', array( 'steal' => true ) ); + } else { + $wgUser = User::newFromName( $userName ); + } if ( !$wgUser ) { $this->error( "Invalid username", true ); }