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 "Cleanup, removed space"
[lhc/web/wiklou.git]
/
maintenance
/
changePassword.php
diff --git
a/maintenance/changePassword.php
b/maintenance/changePassword.php
index
8687f81
..
9fa6632
100644
(file)
--- a/
maintenance/changePassword.php
+++ b/
maintenance/changePassword.php
@@
-51,8
+51,16
@@
class ChangePassword extends Maintenance {
if ( !$user || !$user->getId() ) {
$this->error( "No such user: " . $this->getOption( 'user' ), true );
}
if ( !$user || !$user->getId() ) {
$this->error( "No such user: " . $this->getOption( 'user' ), true );
}
+ $password = $this->getOption( 'password' );
try {
try {
- $user->setPassword( $this->getOption( 'password' ) );
+ $status = $user->changeAuthenticationData( [
+ 'username' => $user->getName(),
+ 'password' => $password,
+ 'retype' => $password,
+ ] );
+ if ( !$status->isGood() ) {
+ throw new PasswordError( $status->getWikiText( null, null, 'en' ) );
+ }
$user->saveSettings();
$this->output( "Password set for " . $user->getName() . "\n" );
} catch ( PasswordError $pwe ) {
$user->saveSettings();
$this->output( "Password set for " . $user->getName() . "\n" );
} catch ( PasswordError $pwe ) {