mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +02:00
Log security related events like password reset, 2FA method added, etc.
This commit is contained in:
parent
1b21bf5ddd
commit
470cd2af9e
13 changed files with 485 additions and 8 deletions
|
@ -44,6 +44,8 @@ namespace App\Controller;
|
|||
|
||||
use App\Entity\Attachments\UserAttachment;
|
||||
use App\Entity\UserSystem\User;
|
||||
use App\Events\SecurityEvent;
|
||||
use App\Events\SecurityEvents;
|
||||
use App\Form\Permissions\PermissionsType;
|
||||
use App\Form\UserAdminForm;
|
||||
use App\Services\EntityExporter;
|
||||
|
@ -52,6 +54,7 @@ use App\Services\StructuralElementRecursionHelper;
|
|||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use InvalidArgumentException;
|
||||
use Symfony\Component\Asset\Packages;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
@ -97,6 +100,9 @@ class UserController extends AdminPages\BaseAdminController
|
|||
$entity->invalidateTrustedDeviceTokens();
|
||||
$em->flush();
|
||||
|
||||
$event = new SecurityEvent($entity);
|
||||
$this->eventDispatcher->dispatch($event, SecurityEvents::TFA_ADMIN_RESET);
|
||||
|
||||
$this->addFlash('success', 'user.edit.reset_success');
|
||||
} else {
|
||||
$this->addFlash('danger', 'csfr_invalid');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue