X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=maintenance%2Fedit.php;h=b67a9571626f4540117d5459f7f9d1372102ad71;hb=f2c242e2e8d86d6d12ae9c160b88c43558306d8f;hp=75ec12bfdd1da559d501170dbd856bd1ef0e29ad;hpb=7869747ff4dd08b1281b0386d8c0017969b5c787;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 ); }