aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/SecurityController.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/SecurityController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/SecurityController.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/SecurityController.php b/src/Wallabag/CoreBundle/Controller/SecurityController.php
new file mode 100644
index 00000000..51f9cc26
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Controller/SecurityController.php
@@ -0,0 +1,27 @@
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 }
21 return $this->render('WallabagCoreBundle:Security:login.html.twig', array(
22 // last username entered by the user
23 'last_username' => $session->get(SecurityContext::LAST_USERNAME),
24 'error' => $error,
25 ));
26 }
27} \ No newline at end of file