src/Controller/DefaultController.php line 45

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. use Symfony\Component\EventDispatcher\EventDispatcher;
  5. use Symfony\Component\HttpFoundation\BinaryFileResponse;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
  9. use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
  10. class DefaultController extends AbstractController
  11. {
  12.     /**
  13.      * @Route("/", name="homepage")
  14.      */
  15.     public function indexAction(Request $request)
  16.     {
  17.         return $this->render('default/index.html.twig', []);
  18. //        return $this->render('default/home.html.twig', []);
  19.     }
  20.     /**
  21.      * @Route("/ueber", name="ueber")
  22.      */
  23.     public function ueber(Request $request)
  24.     {
  25.         return $this->render('default/ueber.html.twig', []);
  26.     }
  27.     /**
  28.      * @Route("/datenschutz", name="datenschutz")
  29.      */
  30.     public function datenschutz(Request $request)
  31.     {
  32.         return $this->render('default/datenschutz.html.twig', []);
  33.     }
  34.     /**
  35.      * @Route("/impressum", name="impressum")
  36.      */
  37.     public function impressum(Request $request)
  38.     {
  39.         return $this->render('default/impressum.html.twig', []);
  40.     }
  41. //    /**
  42. //     * @Route("/patienten", name="red_patienten")
  43. //     */
  44. //    public function patienten(Request $request)
  45. //    {
  46. //        return $this->redirectToRoute("pat_home");
  47. //    }
  48.     /**
  49.      * @Route("/4d5f52d5d23c0b0c62756babada78f3237966274", name="fachbereich_home_deeplink")
  50.      * @Route("/5b227b0c1c2ecee3f5937c26a4f02a7c", name="fachbereich_home_deeplink2")
  51.      * @Route("/5b227b0c1c2ecee3f5937c26a4f02a7c", name="fachbereich_home_deeplink2")
  52.      */
  53.     public function fachbereich_home_deeplink(Request $request)
  54.     {
  55.         $token = new UsernamePasswordToken("user"'$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO'"main", array('ROLE_USER'));
  56.         $this->get("security.token_storage")->setToken($token); //now the user is logged in
  57.         //now dispatch the login event
  58.         $request $this->get('request_stack')->getCurrentRequest();
  59.         $event = new InteractiveLoginEvent($request$token);
  60.         $dispatcher = new EventDispatcher();
  61.         $dispatcher->dispatch($event);
  62.         return $this->redirectToRoute("fachbereich_home");
  63.     }
  64.     /**
  65.      * @Route("/a082b3fcc357be7550e3932737b878ece6dec19c", name="fachbereich_diagnose_deeplink")
  66.      */
  67.     public function fachbereich_diagnose_deeplink(Request $request)
  68.     {
  69.         $token = new UsernamePasswordToken("user"'$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO'"main", array('ROLE_USER'));
  70.         $this->get("security.token_storage")->setToken($token); //now the user is logged in
  71.         //now dispatch the login event
  72.         $request $this->get('request_stack')->getCurrentRequest();
  73.         $event = new InteractiveLoginEvent($request$token);
  74.         $dispatcher = new EventDispatcher();
  75.         $dispatcher->dispatch($event);
  76.         return $this->redirectToRoute("fachbereich_diagnose");
  77.     }
  78.     /**
  79.      * @Route("/cab8c45ce091c3243286108ce163218ad8175b25", name="fachbereich_pathophysiologie_deeplink")
  80.      */
  81.     public function fachbereich_pathophysiologie_deeplink(Request $request)
  82.     {
  83.         $token = new UsernamePasswordToken("user"'$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO'"main", array('ROLE_USER'));
  84.         $this->get("security.token_storage")->setToken($token); //now the user is logged in
  85.         //now dispatch the login event
  86.         $request $this->get('request_stack')->getCurrentRequest();
  87.         $event = new InteractiveLoginEvent($request$token);
  88.         $dispatcher = new EventDispatcher();
  89.         $dispatcher->dispatch($event);
  90.         return $this->redirectToRoute("fachbereich_pathophysiologie");
  91.     }
  92.     /**
  93.      * @Route("/e6a85b46c48c554d2d7h9acf6b4d61cd", name="fachbereich_download_deeplink")
  94.      */
  95.     public function fachbereich_download_deeplink(Request $request)
  96.     {
  97.         $token = new UsernamePasswordToken("user"'$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO'"main", array('ROLE_USER'));
  98.         $this->get("security.token_storage")->setToken($token); //now the user is logged in
  99.         //now dispatch the login event
  100.         $request $this->get('request_stack')->getCurrentRequest();
  101.         $event = new InteractiveLoginEvent($request$token);
  102.         $dispatcher = new EventDispatcher();
  103.         $dispatcher->dispatch($event);
  104.         $url $this->generateUrl("fachbereich_downloads") . "#kasuistik";
  105.         return $this->redirect($url);
  106.     }
  107.     /**
  108.      * @Route("/f8d7902dc0e088e1af2b917ab287a5cb6fe67c86", name="fachbereich_therapie_deeplink")
  109.      */
  110.     public function fachbereich_therapie_deeplink(Request $request)
  111.     {
  112.         $token = new UsernamePasswordToken("user"'$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO'"main", array('ROLE_USER'));
  113.         $this->get("security.token_storage")->setToken($token); //now the user is logged in
  114.         //now dispatch the login event
  115.         $request $this->get('request_stack')->getCurrentRequest();
  116.         $event = new InteractiveLoginEvent($request$token);
  117.         $dispatcher = new EventDispatcher();
  118.         $dispatcher->dispatch($event);
  119.         $url $this->generateUrl("fachbereich_therapie");
  120.         return $this->redirect($url);
  121.     }
  122.     /**
  123.      * @Route("/c20e33cd0ef471d719f7d3dd2f52ab660dd77e25", name="patientenkasuistik_deeplink")
  124.      */
  125.     public function patientenkasuistik_deeplink(Request $request)
  126.     {
  127.         $token = new UsernamePasswordToken("user"'$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO'"main", array('ROLE_USER'));
  128.         $this->get("security.token_storage")->setToken($token); //now the user is logged in
  129.         //now dispatch the login event
  130.         $request $this->get('request_stack')->getCurrentRequest();
  131.         $event = new InteractiveLoginEvent($request$token);
  132.         $dispatcher = new EventDispatcher();
  133.         $dispatcher->dispatch($event);
  134.         $url $this->generateUrl("app_patientenkasuistik_homepage");
  135.         return $this->redirect($url);
  136.     }
  137.     /**
  138.      * @Route("/1e716cb0af997669903b4f40ef2990dd2508befc", name="patientenvideo_deeplink")
  139.      */
  140.     public function patientenvideo_deeplink(Request $request)
  141.     {
  142.         $token = new UsernamePasswordToken("user"'$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO'"main", array('ROLE_USER'));
  143.         $this->get("security.token_storage")->setToken($token); //now the user is logged in
  144.         //now dispatch the login event
  145.         $request $this->get('request_stack')->getCurrentRequest();
  146.         $event = new InteractiveLoginEvent($request$token);
  147.         $dispatcher = new EventDispatcher();
  148.         $dispatcher->dispatch($event);
  149.         $url $this->generateUrl("fachbereich_home") . '#patientenvideo';
  150.         return $this->redirect($url);
  151.     }
  152.     /**
  153.      * @Route("/30637f8e461d405847d7124d8a10c50e6e8a30f2", name="sonderpublikation_deeplink")
  154.      */
  155.     public function sonderpublikation_deeplink(Request $request)
  156.     {
  157.         $projectDir $this->getParameter('kernel.project_dir');
  158.         return new BinaryFileResponse($projectDir '/public/downloads/Kompass_Onkol_1_23_PharmaNews_EUSA_Pharma_E-Lizenz[1].pdf');
  159.     }
  160.     /**
  161.      * @Route("/raetselfaelle", name="deeplink_raetselfaelle")
  162.      */
  163.     public function deeplink_raetselfaelle(Request $request)
  164.     {
  165.         $session $request->getSession();
  166.         $session->set('playVideo''raetselfaelle');
  167.         $url $this->generateUrl("fachbereich_home");
  168.         return $this->redirect($url);
  169.     }
  170.     /**
  171.      * @Route("/diagnoseleitfaden", name="deeplink_diagnoseleitfaden")
  172.      */
  173.     public function deeplink_diagnoseleitfaden(Request $request)
  174.     {
  175.         $token = new UsernamePasswordToken("user"'$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO'"main", array('ROLE_USER'));
  176.         $this->get("security.token_storage")->setToken($token); //now the user is logged in
  177.         //now dispatch the login event
  178.         $request $this->get('request_stack')->getCurrentRequest();
  179.         $event = new InteractiveLoginEvent($request$token);
  180.         $dispatcher = new EventDispatcher();
  181.         $dispatcher->dispatch($event);
  182.         return $this->render('fachbereich/home.html.twig', [
  183.             'type' => 'diagnoseleitfaden'
  184.         ]);
  185.     }
  186.     /**
  187.      * @Route("/raetselfaelle-lymphknoten", name="deeplink_raetselfaelle_lymphknoten")
  188.      */
  189.     public function deeplink_raetselfaelle_lymphknoten(Request $request)
  190.     {
  191.         $token = new UsernamePasswordToken("user"'$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO'"main", array('ROLE_USER'));
  192.         $this->get("security.token_storage")->setToken($token); //now the user is logged in
  193.         //now dispatch the login event
  194.         $request $this->get('request_stack')->getCurrentRequest();
  195.         $event = new InteractiveLoginEvent($request$token);
  196.         $dispatcher = new EventDispatcher();
  197.         $dispatcher->dispatch($event);
  198.         return $this->render('fachbereich/home.html.twig', [
  199.             'type' => 'raetselfaelle-lymphknoten'
  200.         ]);
  201.     }
  202.     private function withQueryParams(Request  $requeststring $url): string
  203.     {
  204.         $params $request->query->all();
  205.         if (sizeof($params) > 0) {
  206.             $tmp = [];
  207.             foreach ($params as $key => $value) {
  208.                 $tmp[] = "$key=$value";
  209.             }
  210.             $paramsString implode('&'$tmp);
  211.             $url .= '?' $paramsString;
  212.         }
  213.         return $url;
  214.     }
  215. }