fix: usr: the username was not recognized properly #7
This commit is contained in:
@@ -407,15 +407,9 @@ class PlayedGameRepository extends ServiceEntityRepository
|
||||
->leftJoin('g.blue', 'bb')
|
||||
->leftJoin('g.redAnon', 'ra')
|
||||
->leftJoin('g.blueAnon', 'ba')
|
||||
->where($qb->expr()->andX(
|
||||
$qb->expr()->orX(
|
||||
->where($qb->expr()->orX(
|
||||
$qb->expr()->eq('g.red', ':u'),
|
||||
$qb->expr()->eq('g.blue', ':u'),
|
||||
),
|
||||
$qb->expr()->orX(
|
||||
$qb->expr()->isNotNull('g.redPoints'),
|
||||
$qb->expr()->isNotNull('g.resign'),
|
||||
),
|
||||
))
|
||||
->setParameter('u', $user)
|
||||
->orderBy('g.updated', 'DESC')
|
||||
|
||||
@@ -26,6 +26,7 @@ use JsonException;
|
||||
use Liip\ImagineBundle\Imagine\Cache\CacheManager;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use RuntimeException;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
use Symfony\Component\Mercure\HubInterface;
|
||||
use Symfony\Component\Mercure\Update;
|
||||
@@ -50,6 +51,7 @@ readonly class TopicManager implements TopicManagerInterface
|
||||
private PlayedGameRepository $playedGameRepository,
|
||||
private UserRepository $userRepository,
|
||||
private RequestStack $requestStack,
|
||||
private Security $security,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -640,7 +642,7 @@ readonly class TopicManager implements TopicManagerInterface
|
||||
{
|
||||
$playedGame = $this->getPlayedGame($gameAssoc);
|
||||
|
||||
null !== $this->requestStack->getCurrentRequest()->getUser()
|
||||
null !== $this->security->getUser()
|
||||
? $this->saveRegisteredUser($userName, $count, $playedGame)
|
||||
: $this->saveAnonUser($userName, $count, $playedGame);
|
||||
|
||||
@@ -664,6 +666,8 @@ readonly class TopicManager implements TopicManagerInterface
|
||||
? $playedGame->red = $user
|
||||
: $playedGame->blue = $user;
|
||||
}
|
||||
|
||||
$this->em->persist($playedGame);
|
||||
} catch (Exception $e) {
|
||||
$this->logger->error($e->getMessage());
|
||||
}
|
||||
@@ -689,6 +693,8 @@ readonly class TopicManager implements TopicManagerInterface
|
||||
? $playedGame->redAnon = $anon
|
||||
: $playedGame->blueAnon = $anon;
|
||||
}
|
||||
|
||||
$this->em->persist($playedGame);
|
||||
} catch (Exception $e) {
|
||||
$this->logger->error($e->getMessage());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user