<?php
namespace JF\JuridicusBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
//use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Security\Core\Security;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
class SecurityController extends AbstractController
{
public function __construct(AuthenticationUtils $authenticationUtils)
{
$this->authenticationUtils = $authenticationUtils;
}
public function getTokenAction()
{
return new Response($this->get('form.csrf_provider')->generateCsrfToken('authenticate'));
}
/**
* Pruefer-Login
*
* @Route("/pruefer/login", name="pruefer_login")
*/
public function prueferLoginAction(Request $request)
{
//$authenticationUtils = $this->get('security.authentication_utils');
// get the login error if there is one
$error = $this->authenticationUtils->getLastAuthenticationError();
// last username entered by the user
$lastUsername = $this->authenticationUtils->getLastUsername();
return $this->render('@JFJuridicusBundle/Login/prueferLogin.html.twig', array(
'last_username' => $lastUsername,
'error' => $error,
));
}
/**
* @Route("/login", name="login")
* @Template()
*/
public function loginAction()
{
//$authenticationUtils = $this->get('security.authentication_utils');
// get the login error if there is one
$error = $this->authenticationUtils->getLastAuthenticationError();
// last username entered by the user
$lastUsername = $this->authenticationUtils->getLastUsername();
return $this->render('@JFJuridicusBundle/Login/index.html.twig', array(
'last_username' => $lastUsername,
'error' => $error,
));
}
/**
* @Route("/partner/login_check", name="partner_login_check")
*/
public function partnerSecurityCheckAction()
{
// The security layer will intercept this request
}
/**
* @Route("/pruefer/login_check", name="pruefer_login_check")
*/
public function prueferSecurityCheckAction()
{
// The security layer will intercept this request
}
/**
* @Route("/partner/logout", name="partner_logout")
* @Template()
*/
public function partnerLogoutAction()
{
// The security layer will intercept this request
}
/**
* @Route("/pruefer/logout", name="pruefer_logout")
* @Template()
*/
public function prueferLogoutAction()
{
// The security layer will intercept this request
}
}