mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-23 04:14:36 +02:00
Fixed service wiring configuration
This commit is contained in:
parent
98dc553938
commit
f63b6d7207
14 changed files with 29 additions and 35 deletions
|
@ -37,14 +37,14 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
|||
*/
|
||||
final class LoginSuccessSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
public function __construct(private readonly TranslatorInterface $translator, private readonly RequestStack $requestStack, private readonly EventLogger $eventLogger, private readonly bool $gpdr_compliance)
|
||||
public function __construct(private readonly TranslatorInterface $translator, private readonly RequestStack $requestStack, private readonly EventLogger $eventLogger, private readonly bool $gdpr_compliance)
|
||||
{
|
||||
}
|
||||
|
||||
public function onLogin(InteractiveLoginEvent $event): void
|
||||
{
|
||||
$ip = $event->getRequest()->getClientIp();
|
||||
$log = new UserLoginLogEntry($ip, $this->gpdr_compliance);
|
||||
$log = new UserLoginLogEntry($ip, $this->gdpr_compliance);
|
||||
$user = $event->getAuthenticationToken()->getUser();
|
||||
if ($user instanceof User && $user->getID()) {
|
||||
$log->setTargetElement($user);
|
||||
|
|
|
@ -23,17 +23,17 @@ declare(strict_types=1);
|
|||
namespace App\EventSubscriber\UserSystem;
|
||||
|
||||
use App\Entity\UserSystem\User;
|
||||
use Symfony\Bundle\SecurityBundle\Security;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\HttpKernel\Event\ControllerEvent;
|
||||
use Symfony\Component\HttpKernel\KernelEvents;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
||||
/**
|
||||
* The purpose of this event listener is to set the timezone to the one preferred by the user.
|
||||
*/
|
||||
final class SetUserTimezoneSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
public function __construct(private readonly string $default_timezone, private readonly \Symfony\Bundle\SecurityBundle\Security $security)
|
||||
public function __construct(private readonly string $default_timezone, private readonly Security $security)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue