$user = User::newFromName( $res->username, 'usable' );
if ( !$user ) {
+ $provider = $this->getAuthenticationProvider( $state['primary'] );
throw new \DomainException(
get_class( $provider ) . " returned an invalid username: {$res->username}"
);
$this->logger->info( 'Login for {user} succeeded', [
'user' => $user->getName(),
] );
+ /** @var RememberMeAuthenticationRequest $req */
$req = AuthenticationRequest::getRequestByClass(
$beginReqs, RememberMeAuthenticationRequest::class
);
'creator' => $creator->getName(),
] );
$status = $user->addToDatabase();
- if ( !$status->isOk() ) {
+ if ( !$status->isOK() ) {
// @codeCoverageIgnoreStart
$ret = AuthenticationResponse::newFail( $status->getMessage() );
$this->callMethodOnProviders( 7, 'postAccountCreation', [ $user, $creator, $ret ] );
);
$logEntry->setPerformer( $isAnon ? $user : $creator );
$logEntry->setTarget( $user->getUserPage() );
+ /** @var CreationReasonAuthenticationRequest $req */
$req = AuthenticationRequest::getRequestByClass(
$state['reqs'], CreationReasonAuthenticationRequest::class
);
$this->logger->debug( __METHOD__ . ': name "{username}" is not creatable', [
'username' => $username,
] );
- $session->set( 'AuthManager::AutoCreateBlacklist', 'noname', 600 );
+ $session->set( 'AuthManager::AutoCreateBlacklist', 'noname' );
$user->setId( 0 );
$user->loadFromId();
return Status::newFatal( 'noname' );
'username' => $username,
'ip' => $anon->getName(),
] );
- $session->set( 'AuthManager::AutoCreateBlacklist', 'authmanager-autocreate-noperm', 600 );
+ $session->set( 'AuthManager::AutoCreateBlacklist', 'authmanager-autocreate-noperm' );
$session->persist();
$user->setId( 0 );
$user->loadFromId();
'username' => $username,
'reason' => $ret->getWikiText( null, null, 'en' ),
] );
- $session->set( 'AuthManager::AutoCreateBlacklist', $status, 600 );
+ $session->set( 'AuthManager::AutoCreateBlacklist', $status );
$user->setId( 0 );
$user->loadFromId();
return $ret;
$trxProfiler->setSilenced( true );
try {
$status = $user->addToDatabase();
- if ( !$status->isOk() ) {
+ if ( !$status->isOK() ) {
// Double-check for a race condition (T70012). We make use of the fact that when
// addToDatabase fails due to the user already existing, the user object gets loaded.
if ( $user->getId() ) {