1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
<?php
// src/OC/UserBundle/Controller/SecurityController.php;
namespace MyConnectionBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\SecurityContext;
class SecurityController extends Controller
{
/**
* @Route("/", name="homepage")
*/
public function loginAction(Request $request)
{
if
($this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_REMEMBERED'))
{
return $this->redirectToRoute('geha');
}
$authenticationUtils = $this->get('security.authentication_utils');
return $this->render('MyConnectionBundle:Security:login.html.twig', array(
'last_username' => $authenticationUtils->getLastUsername(),
'error' => $authenticationUtils->getLastAuthenticationError(),
));
}
} |
Partager