setPerformer(), // so create the account. $user->addToDatabase(); $creator = $creator ?? $user; $provider = new AbuseFilterPreAuthenticationProvider(); $status = $provider->testForAccountCreation( $user, $creator, [] ); // FIXME This is a bit hacky, but AuthManager doesn't expose any methods for logging $subType = $autocreate ? 'autocreate' : 'create2'; $logEntry = new \ManualLogEntry( 'newusers', $subType ); $logEntry->setPerformer( $creator ); $logEntry->setTarget( Title::makeTitle( NS_USER, $accountName ) ); $logEntry->setComment( 'Fooobarcomment' ); $logEntry->setParameters( [ '4::userid' => $user->getId(), ] ); $logid = $logEntry->insert(); $logEntry->publish( $logid ); return $status; } }