]> git.immae.eu Git - github/wallabag/wallabag.git/blame - src/Wallabag/CoreBundle/Controller/SecurityController.php
CS
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / SecurityController.php
CommitLineData
c3235553
NL
1<?php
2
3namespace Wallabag\CoreBundle\Controller;
4
5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6use Symfony\Component\HttpFoundation\Request;
7use Symfony\Component\Security\Core\SecurityContext;
8
9class SecurityController extends Controller
10{
11 public function loginAction(Request $request)
12 {
13 $session = $request->getSession();
14 // get the login error if there is one
15 if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
16 $error = $request->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
17 } else {
18 $error = $session->get(SecurityContext::AUTHENTICATION_ERROR);
19 $session->remove(SecurityContext::AUTHENTICATION_ERROR);
20 }
7df80cb3 21
c3235553
NL
22 return $this->render('WallabagCoreBundle:Security:login.html.twig', array(
23 // last username entered by the user
24 'last_username' => $session->get(SecurityContext::LAST_USERNAME),
25 'error' => $error,
26 ));
27 }
7df80cb3 28}