X-Git-Url: http://git.cyclocoop.org/%28?a=blobdiff_plain;f=includes%2Fauth%2FTemporaryPasswordPrimaryAuthenticationProvider.php;h=e129538bbca87aa76dcf27e89676d24e62049e0c;hb=4aabbfdb0f81356a6da52733313caf62c623afea;hp=4a2d0094eb2c9630477cfebeeb62a699fd60dcb1;hpb=d5a7166771613dfe4ed9fb75fa5efeced6134bd1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php index 4a2d0094eb..e129538bbc 100644 --- a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php +++ b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php @@ -146,7 +146,7 @@ class TemporaryPasswordPrimaryAuthenticationProvider } $pwhash = $this->getPassword( $row->user_newpassword ); - if ( !$pwhash->equals( $req->password ) ) { + if ( !$pwhash->verify( $req->password ) ) { return $this->failResponse( $req ); } @@ -314,7 +314,7 @@ class TemporaryPasswordPrimaryAuthenticationProvider if ( $sendMail ) { // Send email after DB commit - $dbw->onTransactionIdle( + $dbw->onTransactionCommitOrIdle( function () use ( $req ) { /** @var TemporaryPasswordAuthenticationRequest $req */ $this->sendPasswordResetEmail( $req ); @@ -356,23 +356,21 @@ class TemporaryPasswordPrimaryAuthenticationProvider $req = AuthenticationRequest::getRequestByClass( $reqs, TemporaryPasswordAuthenticationRequest::class ); - if ( $req ) { - if ( $req->username !== null && $req->password !== null ) { - // Nothing we can do yet, because the user isn't in the DB yet - if ( $req->username !== $user->getName() ) { - $req = clone $req; - $req->username = $user->getName(); - } - - if ( $req->mailpassword ) { - // prevent EmailNotificationSecondaryAuthenticationProvider from sending another mail - $this->manager->setAuthenticationSessionData( 'no-email', true ); - } + if ( $req && $req->username !== null && $req->password !== null ) { + // Nothing we can do yet, because the user isn't in the DB yet + if ( $req->username !== $user->getName() ) { + $req = clone $req; + $req->username = $user->getName(); + } - $ret = AuthenticationResponse::newPass( $req->username ); - $ret->createRequest = $req; - return $ret; + if ( $req->mailpassword ) { + // prevent EmailNotificationSecondaryAuthenticationProvider from sending another mail + $this->manager->setAuthenticationSessionData( 'no-email', true ); } + + $ret = AuthenticationResponse::newPass( $req->username ); + $ret->createRequest = $req; + return $ret; } return AuthenticationResponse::newAbstain(); } @@ -388,7 +386,7 @@ class TemporaryPasswordPrimaryAuthenticationProvider if ( $mailpassword ) { // Send email after DB commit - wfGetDB( DB_MASTER )->onTransactionIdle( + wfGetDB( DB_MASTER )->onTransactionCommitOrIdle( function () use ( $user, $creator, $req ) { $this->sendNewAccountEmail( $user, $creator, $req->password ); },