src/JuridicusBundle/Controller/SecurityController.php line 34

Open in your IDE?
  1. <?php
  2. namespace JF\JuridicusBundle\Controller;
  3. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  4. //use Symfony\Component\Security\Core\SecurityContext;
  5. use Symfony\Component\Security\Core\Security;
  6. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
  7. use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
  8. use Symfony\Component\HttpFoundation\Response;
  9. use Symfony\Component\HttpFoundation\Request;
  10. use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
  11. class SecurityController extends AbstractController
  12. {
  13.     public function __construct(AuthenticationUtils $authenticationUtils)
  14.     {
  15.         $this->authenticationUtils $authenticationUtils;
  16.     }
  17.     public function getTokenAction()
  18.     {
  19.         return new Response($this->get('form.csrf_provider')->generateCsrfToken('authenticate'));
  20.     }
  21.     
  22.     /**
  23.      * Pruefer-Login
  24.      *
  25.      * @Route("/pruefer/login", name="pruefer_login")
  26.      */
  27.     public function prueferLoginAction(Request $request)
  28.     {
  29.         //$authenticationUtils = $this->get('security.authentication_utils');
  30.         // get the login error if there is one
  31.         $error $this->authenticationUtils->getLastAuthenticationError();
  32.         // last username entered by the user
  33.         $lastUsername $this->authenticationUtils->getLastUsername();
  34.         
  35.         return $this->render('@JFJuridicusBundle/Login/prueferLogin.html.twig', array(
  36.             'last_username' => $lastUsername,
  37.             'error' => $error,
  38.         ));
  39.     }
  40.     /**
  41.      * @Route("/login", name="login")
  42.      * @Template()
  43.      */
  44.     public function loginAction()
  45.     {
  46.         //$authenticationUtils = $this->get('security.authentication_utils');
  47.         // get the login error if there is one
  48.         $error $this->authenticationUtils->getLastAuthenticationError();
  49.         // last username entered by the user
  50.         $lastUsername $this->authenticationUtils->getLastUsername();
  51.     
  52.     
  53.         return $this->render('@JFJuridicusBundle/Login/index.html.twig', array(
  54.             'last_username' => $lastUsername,
  55.             'error' => $error,
  56.         ));
  57.     }
  58.     /**
  59.      * @Route("/partner/login_check", name="partner_login_check")
  60.      */
  61.     public function partnerSecurityCheckAction()
  62.     {
  63.         // The security layer will intercept this request
  64.     }
  65.     /**
  66.      * @Route("/pruefer/login_check", name="pruefer_login_check")
  67.      */
  68.     public function prueferSecurityCheckAction()
  69.     {
  70.         // The security layer will intercept this request
  71.     }
  72.     /**
  73.      * @Route("/partner/logout", name="partner_logout")
  74.      * @Template()
  75.      */
  76.     public function partnerLogoutAction()
  77.     {
  78.         // The security layer will intercept this request
  79.     }
  80.     
  81.     /**
  82.      * @Route("/pruefer/logout", name="pruefer_logout")
  83.      * @Template()
  84.      */
  85.     public function prueferLogoutAction()
  86.     {
  87.         // The security layer will intercept this request
  88.     }
  89. }