X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2Fauth%2FTemporaryPasswordPrimaryAuthenticationProvider.php;h=42a1c24fd178e276663c707f6bcf57b9133a0b1b;hb=a421c54f7b29bd508db35d4a2566a8afc4428913;hp=045f7915f3f1aff0a5fcd910f5562e0aba3ef3bb;hpb=2b14cc0096de48b4863ea7daee55951701f6dc99;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php index 045f7915f3..42a1c24fd1 100644 --- a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php +++ b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php @@ -206,7 +206,7 @@ class TemporaryPasswordPrimaryAuthenticationProvider list( $db, $options ) = \DBAccessObjectUtils::getDBOptions( $flags ); return (bool)wfGetDB( $db )->selectField( [ 'user' ], - [ 'user_id' ], + 'user_id', [ 'user_name' => $username ], __METHOD__, $options @@ -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(); }