<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
class DefaultController extends AbstractController
{
/**
* @Route("/", name="homepage")
*/
public function indexAction(Request $request)
{
return $this->render('default/index.html.twig', []);
// return $this->render('default/home.html.twig', []);
}
/**
* @Route("/ueber", name="ueber")
*/
public function ueber(Request $request)
{
return $this->render('default/ueber.html.twig', []);
}
/**
* @Route("/datenschutz", name="datenschutz")
*/
public function datenschutz(Request $request)
{
return $this->render('default/datenschutz.html.twig', []);
}
/**
* @Route("/impressum", name="impressum")
*/
public function impressum(Request $request)
{
return $this->render('default/impressum.html.twig', []);
}
// /**
// * @Route("/patienten", name="red_patienten")
// */
// public function patienten(Request $request)
// {
// return $this->redirectToRoute("pat_home");
// }
/**
* @Route("/4d5f52d5d23c0b0c62756babada78f3237966274", name="fachbereich_home_deeplink")
* @Route("/5b227b0c1c2ecee3f5937c26a4f02a7c", name="fachbereich_home_deeplink2")
* @Route("/5b227b0c1c2ecee3f5937c26a4f02a7c", name="fachbereich_home_deeplink2")
*/
public function fachbereich_home_deeplink(Request $request)
{
$token = new UsernamePasswordToken("user", '$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO', "main", array('ROLE_USER'));
$this->get("security.token_storage")->setToken($token); //now the user is logged in
//now dispatch the login event
$request = $this->get('request_stack')->getCurrentRequest();
$event = new InteractiveLoginEvent($request, $token);
$dispatcher = new EventDispatcher();
$dispatcher->dispatch($event);
return $this->redirectToRoute("fachbereich_home");
}
/**
* @Route("/a082b3fcc357be7550e3932737b878ece6dec19c", name="fachbereich_diagnose_deeplink")
*/
public function fachbereich_diagnose_deeplink(Request $request)
{
$token = new UsernamePasswordToken("user", '$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO', "main", array('ROLE_USER'));
$this->get("security.token_storage")->setToken($token); //now the user is logged in
//now dispatch the login event
$request = $this->get('request_stack')->getCurrentRequest();
$event = new InteractiveLoginEvent($request, $token);
$dispatcher = new EventDispatcher();
$dispatcher->dispatch($event);
return $this->redirectToRoute("fachbereich_diagnose");
}
/**
* @Route("/cab8c45ce091c3243286108ce163218ad8175b25", name="fachbereich_pathophysiologie_deeplink")
*/
public function fachbereich_pathophysiologie_deeplink(Request $request)
{
$token = new UsernamePasswordToken("user", '$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO', "main", array('ROLE_USER'));
$this->get("security.token_storage")->setToken($token); //now the user is logged in
//now dispatch the login event
$request = $this->get('request_stack')->getCurrentRequest();
$event = new InteractiveLoginEvent($request, $token);
$dispatcher = new EventDispatcher();
$dispatcher->dispatch($event);
return $this->redirectToRoute("fachbereich_pathophysiologie");
}
/**
* @Route("/e6a85b46c48c554d2d7h9acf6b4d61cd", name="fachbereich_download_deeplink")
*/
public function fachbereich_download_deeplink(Request $request)
{
$token = new UsernamePasswordToken("user", '$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO', "main", array('ROLE_USER'));
$this->get("security.token_storage")->setToken($token); //now the user is logged in
//now dispatch the login event
$request = $this->get('request_stack')->getCurrentRequest();
$event = new InteractiveLoginEvent($request, $token);
$dispatcher = new EventDispatcher();
$dispatcher->dispatch($event);
$url = $this->generateUrl("fachbereich_downloads") . "#kasuistik";
return $this->redirect($url);
}
/**
* @Route("/f8d7902dc0e088e1af2b917ab287a5cb6fe67c86", name="fachbereich_therapie_deeplink")
*/
public function fachbereich_therapie_deeplink(Request $request)
{
$token = new UsernamePasswordToken("user", '$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO', "main", array('ROLE_USER'));
$this->get("security.token_storage")->setToken($token); //now the user is logged in
//now dispatch the login event
$request = $this->get('request_stack')->getCurrentRequest();
$event = new InteractiveLoginEvent($request, $token);
$dispatcher = new EventDispatcher();
$dispatcher->dispatch($event);
$url = $this->generateUrl("fachbereich_therapie");
return $this->redirect($url);
}
/**
* @Route("/c20e33cd0ef471d719f7d3dd2f52ab660dd77e25", name="patientenkasuistik_deeplink")
*/
public function patientenkasuistik_deeplink(Request $request)
{
$token = new UsernamePasswordToken("user", '$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO', "main", array('ROLE_USER'));
$this->get("security.token_storage")->setToken($token); //now the user is logged in
//now dispatch the login event
$request = $this->get('request_stack')->getCurrentRequest();
$event = new InteractiveLoginEvent($request, $token);
$dispatcher = new EventDispatcher();
$dispatcher->dispatch($event);
$url = $this->generateUrl("app_patientenkasuistik_homepage");
return $this->redirect($url);
}
/**
* @Route("/1e716cb0af997669903b4f40ef2990dd2508befc", name="patientenvideo_deeplink")
*/
public function patientenvideo_deeplink(Request $request)
{
$token = new UsernamePasswordToken("user", '$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO', "main", array('ROLE_USER'));
$this->get("security.token_storage")->setToken($token); //now the user is logged in
//now dispatch the login event
$request = $this->get('request_stack')->getCurrentRequest();
$event = new InteractiveLoginEvent($request, $token);
$dispatcher = new EventDispatcher();
$dispatcher->dispatch($event);
$url = $this->generateUrl("fachbereich_home") . '#patientenvideo';
return $this->redirect($url);
}
/**
* @Route("/30637f8e461d405847d7124d8a10c50e6e8a30f2", name="sonderpublikation_deeplink")
*/
public function sonderpublikation_deeplink(Request $request)
{
$projectDir = $this->getParameter('kernel.project_dir');
return new BinaryFileResponse($projectDir . '/public/downloads/Kompass_Onkol_1_23_PharmaNews_EUSA_Pharma_E-Lizenz[1].pdf');
}
/**
* @Route("/raetselfaelle", name="deeplink_raetselfaelle")
*/
public function deeplink_raetselfaelle(Request $request)
{
$session = $request->getSession();
$session->set('playVideo', 'raetselfaelle');
$url = $this->generateUrl("fachbereich_home");
return $this->redirect($url);
}
/**
* @Route("/diagnoseleitfaden", name="deeplink_diagnoseleitfaden")
*/
public function deeplink_diagnoseleitfaden(Request $request)
{
$token = new UsernamePasswordToken("user", '$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO', "main", array('ROLE_USER'));
$this->get("security.token_storage")->setToken($token); //now the user is logged in
//now dispatch the login event
$request = $this->get('request_stack')->getCurrentRequest();
$event = new InteractiveLoginEvent($request, $token);
$dispatcher = new EventDispatcher();
$dispatcher->dispatch($event);
return $this->render('fachbereich/home.html.twig', [
'type' => 'diagnoseleitfaden'
]);
}
/**
* @Route("/raetselfaelle-lymphknoten", name="deeplink_raetselfaelle_lymphknoten")
*/
public function deeplink_raetselfaelle_lymphknoten(Request $request)
{
$token = new UsernamePasswordToken("user", '$2a$12$qR7kTv6J8YvfsTDXl4drJeMO0GHkJaoxwk3VHZMKipZ3vWYgDxnfO', "main", array('ROLE_USER'));
$this->get("security.token_storage")->setToken($token); //now the user is logged in
//now dispatch the login event
$request = $this->get('request_stack')->getCurrentRequest();
$event = new InteractiveLoginEvent($request, $token);
$dispatcher = new EventDispatcher();
$dispatcher->dispatch($event);
return $this->render('fachbereich/home.html.twig', [
'type' => 'raetselfaelle-lymphknoten'
]);
}
private function withQueryParams(Request $request, string $url): string
{
$params = $request->query->all();
if (sizeof($params) > 0) {
$tmp = [];
foreach ($params as $key => $value) {
$tmp[] = "$key=$value";
}
$paramsString = implode('&', $tmp);
$url .= '?' . $paramsString;
}
return $url;
}
}