dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle static access in TestingAccessWrapper
[lhc/web/wiklou.git]
/
maintenance
/
undelete.php
diff --git
a/maintenance/undelete.php
b/maintenance/undelete.php
index
c890c69
..
71b4de1
100644
(file)
--- a/
maintenance/undelete.php
+++ b/
maintenance/undelete.php
@@
-35,7
+35,7
@@
class Undelete extends Maintenance {
public function execute() {
global $wgUser;
public function execute() {
global $wgUser;
- $user = $this->getOption( 'user',
'Command line script'
);
+ $user = $this->getOption( 'user',
false
);
$reason = $this->getOption( 'reason', '' );
$pageName = $this->getArg();
$reason = $this->getOption( 'reason', '' );
$pageName = $this->getArg();
@@
-43,11
+43,15
@@
class Undelete extends Maintenance {
if ( !$title ) {
$this->error( "Invalid title", true );
}
if ( !$title ) {
$this->error( "Invalid title", true );
}
- $wgUser = User::newFromName( $user );
+ if ( $user === false ) {
+ $wgUser = User::newSystemUser( 'Command line script', array( 'steal' => true ) );
+ } else {
+ $wgUser = User::newFromName( $user );
+ }
if ( !$wgUser ) {
$this->error( "Invalid username", true );
}
if ( !$wgUser ) {
$this->error( "Invalid username", true );
}
- $archive = new PageArchive( $title );
+ $archive = new PageArchive( $title
, RequestContext::getMain()->getConfig()
);
$this->output( "Undeleting " . $title->getPrefixedDBkey() . '...' );
$archive->undelete( array(), $reason );
$this->output( "done\n" );
$this->output( "Undeleting " . $title->getPrefixedDBkey() . '...' );
$archive->undelete( array(), $reason );
$this->output( "done\n" );