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
Merge "Add LoadBalancer::safeWaitForPos()"
[lhc/web/wiklou.git]
/
maintenance
/
protect.php
diff --git
a/maintenance/protect.php
b/maintenance/protect.php
index
ec03f93
..
449a7ad
100644
(file)
--- a/
maintenance/protect.php
+++ b/
maintenance/protect.php
@@
-41,7
+41,7
@@
class Protect extends Maintenance {
}
public function execute() {
}
public function execute() {
- $userName = $this->getOption( 'u',
'Maintenance script'
);
+ $userName = $this->getOption( 'u',
false
);
$reason = $this->getOption( 'r', '' );
$cascade = $this->hasOption( 'cascade' );
$reason = $this->getOption( 'r', '' );
$cascade = $this->hasOption( 'cascade' );
@@
-53,7
+53,11
@@
class Protect extends Maintenance {
$protection = "";
}
$protection = "";
}
- $user = User::newFromName( $userName );
+ if ( $userName === false ) {
+ $user = User::newSystemUser( 'Maintenance script', array( 'steal' => true ) );
+ } else {
+ $user = User::newFromName( $userName );
+ }
if ( !$user ) {
$this->error( "Invalid username", true );
}
if ( !$user ) {
$this->error( "Invalid username", true );
}