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
rdbms: fix bogus $fname parameter in LoadMonitorMySQL
[lhc/web/wiklou.git]
/
maintenance
/
wrapOldPasswords.php
diff --git
a/maintenance/wrapOldPasswords.php
b/maintenance/wrapOldPasswords.php
index
0a859c0
..
1fc0f37
100644
(file)
--- a/
maintenance/wrapOldPasswords.php
+++ b/
maintenance/wrapOldPasswords.php
@@
-1,4
+1,7
@@
<?php
<?php
+
+use MediaWiki\MediaWikiServices;
+
/**
* Maintenance script to wrap all old-style passwords in a layered type
*
/**
* Maintenance script to wrap all old-style passwords in a layered type
*
@@
-40,12
+43,6
@@
class WrapOldPasswords extends Maintenance {
}
public function execute() {
}
public function execute() {
- global $wgAuth;
-
- if ( !$wgAuth->allowSetLocalPassword() ) {
- $this->error( '$wgAuth does not allow local passwords. Aborting.', true );
- }
-
$passwordFactory = new PasswordFactory();
$passwordFactory->init( RequestContext::getMain()->getConfig() );
$passwordFactory = new PasswordFactory();
$passwordFactory->init( RequestContext::getMain()->getConfig() );
@@
-54,12
+51,12
@@
class WrapOldPasswords extends Maintenance {
// Check that type exists and is a layered type
if ( !isset( $typeInfo[$layeredType] ) ) {
// Check that type exists and is a layered type
if ( !isset( $typeInfo[$layeredType] ) ) {
- $this->
error( 'Undefined password type', true
);
+ $this->
fatalError( 'Undefined password type'
);
}
$passObj = $passwordFactory->newFromType( $layeredType );
if ( !$passObj instanceof LayeredParameterizedPassword ) {
}
$passObj = $passwordFactory->newFromType( $layeredType );
if ( !$passObj instanceof LayeredParameterizedPassword ) {
- $this->
error( 'Layered parameterized password type must be used.', true
);
+ $this->
fatalError( 'Layered parameterized password type must be used.'
);
}
// Extract the first layer type
}
// Extract the first layer type
@@
-71,6
+68,7
@@
class WrapOldPasswords extends Maintenance {
$typeCond = 'user_password' . $dbw->buildLike( ":$firstType:", $dbw->anyString() );
$minUserId = 0;
$typeCond = 'user_password' . $dbw->buildLike( ":$firstType:", $dbw->anyString() );
$minUserId = 0;
+ $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
do {
$this->beginTransaction( $dbw, __METHOD__ );
do {
$this->beginTransaction( $dbw, __METHOD__ );
@@
-83,7
+81,7
@@
class WrapOldPasswords extends Maintenance {
__METHOD__,
[
'ORDER BY' => 'user_id',
__METHOD__,
[
'ORDER BY' => 'user_id',
- 'LIMIT' => $this->
mBatchSize
,
+ 'LIMIT' => $this->
getBatchSize()
,
'LOCK IN SHARE MODE',
]
);
'LOCK IN SHARE MODE',
]
);
@@
-113,7
+111,7
@@
class WrapOldPasswords extends Maintenance {
}
$this->commitTransaction( $dbw, __METHOD__ );
}
$this->commitTransaction( $dbw, __METHOD__ );
-
LBFactory::
waitForReplication();
+
$lbFactory->
waitForReplication();
// Clear memcached so old passwords are wiped out
foreach ( $updateUsers as $user ) {
// Clear memcached so old passwords are wiped out
foreach ( $updateUsers as $user ) {
@@
-123,5
+121,5
@@
class WrapOldPasswords extends Maintenance {
}
}
}
}
-$maintClass =
"WrapOldPasswords"
;
+$maintClass =
WrapOldPasswords::class
;
require_once RUN_MAINTENANCE_IF_MAIN;
require_once RUN_MAINTENANCE_IF_MAIN;