Skip to content
Snippets Groups Projects
Select Git revision
  • 84e489ca7910fb8f4e60a73032c545e5dac4bbde
  • mui5-annotation-on-video-stable default
  • get_setter_canvasSizeInformations
  • fix-error-div-into-p
  • annotation-on-video-v2
  • detached
  • annotation-on-video-r17
  • mui5
  • mui5-react-18
  • jacob-test
  • annotation-on-video protected
  • master
  • test-antoinev1
  • 20-fetch-thumbnail-on-annotation
  • add-research-field
  • Save
  • add-plugin
  • 14-wip-no-seek-to
  • 14-bug-on-video-time-control
  • 9_wip_videotests
  • _upgrade_material_ui
  • latest-tetras-16
  • v3.3.0
  • v3.2.0
  • v3.1.1
  • v3.1.0
  • v3.0.0
  • v3.0.0-rc.7
  • v3.0.0-rc.6
  • v3.0.0-rc.5
  • v3.0.0-rc.4
  • v3.0.0-rc.3
  • v3.0.0-rc.2
  • v3.0.0-rc.1
  • v3.0.0-beta.10
  • v3.0.0-beta.9
  • v3.0.0-beta.8
  • v3.0.0-beta.7
  • v3.0.0-beta.6
  • v3.0.0-beta.5
  • v3.0.0-beta.3
41 results

ViewerNavigationVideo.js

Blame
  • FallbackController.php 14.35 KiB
    <?php
    
    namespace App\Controller;
    
    use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
    use Symfony\Component\HttpFoundation\Response;
    use Symfony\Component\Routing\Annotation\Route;
    use Symfony\Component\HttpFoundation\Request;
    use Symfony\Component\HttpFoundation\BinaryFileResponse;
    use Symfony\Component\HttpFoundation\File\File;
    use Symfony\Component\HttpFoundation\File\Exception\FileException;
    use AppBundle\Entity\Capsule;
    use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;
    use Symfony\Component\HttpFoundation\RedirectResponse;
    use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
    
    class FallbackController extends AbstractController
    {
        /**
         * @Route("/", name="get_legacy_resource_creation", methods={"POST"})
         * @Route("/{controller}", name="get_legacy_resource_creation_index", requirements={"controller" = "index.php"})
         */
        public function getCreationCapsuleAction(Request $request, $controller = null)
        {
    
            // $_POST parameters
            $capsuleName = $request->request->get('create');
            $capsulePass = $request->request->get('p');
            $capsuleLink = $this->sanitize($capsuleName);
    
            $this->denyAccessUnlessGranted('IS_AUTHENTICATED_REMEMBERED');
            $user = $this->getUser();
    
            /*
            // memorykall legacy affichera un message si champ vide
            //bloquer les noms à null
            if($capsuleName == null || $capsuleName == '')
            {
                // rediriger sur une page demandant un nom
                return $this->redirectToRoute('missing_name');
            }*/
    
    // TODO : the following code MUST be re-enabled with tuleap-51
    //        // check if capsule exist in database
    //        $capByName = $this->getDoctrine()
    //                          ->getManager()
    //                          ->getRepository('AppBundle:Capsule')
    //                          ->findOneByNom($capsuleName)
    //                      ;
    //        $capByLink = $this->getDoctrine()
    //                          ->getManager()
    //                          ->getRepository('AppBundle:Capsule')
    //                          ->findOneByLink($capsuleLink)
    //                      ;
    //        if (!$capByName instanceof Capsule && !$capByLink instanceof Capsule) {
    //            $dateCreation = new \DateTime();
    //            $cap = new Capsule();
    //            $cap->setNom($capsuleName);
    //            $cap->setLink($capsuleLink);
    //            $cap->setEditionLink($capsuleLink.'/?p='.$capsulePass);
    //            $cap->setAutCrea($user);
    //            $cap->setDtCrea($dateCreation);
    //            $cap->setDtMaj($dateCreation);
    //            $cap->addEditeur($user);
    //
    //            $em = $this->getDoctrine()->getManager();
    //            $em->persist($cap);
    //            $em->flush();
    //        }
    //        // si la capsule existe déjà memorkall legacy affichera un message capsule existe déjà