diff --git a/Controller/LoginController.php b/Controller/LoginController.php new file mode 100644 index 000000000..1f3637130 --- /dev/null +++ b/Controller/LoginController.php @@ -0,0 +1,50 @@ +getSession(); + + if ($request->attributes->has(SecurityContextInterface::AUTHENTICATION_ERROR)) { + $error = $request->attributes->get( + SecurityContextInterface::AUTHENTICATION_ERROR + ); + } elseif (null !== $session && $session->has(SecurityContextInterface::AUTHENTICATION_ERROR)) { + $error = $session->get(SecurityContextInterface::AUTHENTICATION_ERROR); + $session->remove(SecurityContextInterface::AUTHENTICATION_ERROR); + } else { + $error = ''; + } + + $lastUsername = (null === $session) ? + '' : $session->get(SecurityContextInterface::LAST_USERNAME); + + + return $this->render('ChillMainBundle:Login:login.html.twig', array( + 'last_username' => $lastUsername, + 'error' => $error + )); + + } + + public function LoginCheckAction(Request $request) + { + + } + +} diff --git a/Resources/config/routing.yml b/Resources/config/routing.yml index 4d42d1043..3ced09503 100644 --- a/Resources/config/routing.yml +++ b/Resources/config/routing.yml @@ -26,3 +26,9 @@ chill_main_admin_central: login: path: /login defaults: { _controller: ChillMainBundle:Login:login } + +login_check: + path: /login_check + +logout: + path: /logout diff --git a/Resources/views/Login/login.html.twig b/Resources/views/Login/login.html.twig new file mode 100644 index 000000000..fc978fb42 --- /dev/null +++ b/Resources/views/Login/login.html.twig @@ -0,0 +1,19 @@ +{% extends "::base.html.twig" %} + +{% block title %}ChillMainBundle:Login:login{% endblock %} + +{% block body %} +
{{ error }}
+ + + +{% endblock %} diff --git a/Tests/Controller/LoginControllerTest.php b/Tests/Controller/LoginControllerTest.php new file mode 100644 index 000000000..c0b6e7faf --- /dev/null +++ b/Tests/Controller/LoginControllerTest.php @@ -0,0 +1,16 @@ +request('GET', '/login'); + } + +}