From 07db3740c7c698f35c22441b101a5e2e2fc296c9 Mon Sep 17 00:00:00 2001 From: Chrysweel Date: Wed, 18 Mar 2015 09:29:37 +0100 Subject: [PATCH] [HOTFIX] get message error in page login --- Controller/SecuredController.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Controller/SecuredController.php b/Controller/SecuredController.php index 2264eaa..8a652b8 100755 --- a/Controller/SecuredController.php +++ b/Controller/SecuredController.php @@ -15,7 +15,7 @@ class SecuredController extends Controller public function loginAction(Request $request) { $securityContext = $this->container->get('security.context'); - if ($securityContext->isGranted('IS_AUTHENTICATED_FULLY')) { + if ($securityContext->isGranted('IS_AUTHENTICATED_FULLY') && $this->get('security.context')->isGranted('IS_AUTHENTICATED_REMEMBERED')) { return $this->redirect("/"); } @@ -25,7 +25,9 @@ public function loginAction(Request $request) $error = $request->getSession()->get(SecurityContext::AUTHENTICATION_ERROR); } - $error = $this->extractAuthErrorI18N($error); + if ($error){ + $error = $this->extractAuthErrorI18N($error); + } return $this->render('ChateaSecureBundle:Secured:login.html.twig',array( 'last_username' => $request->getSession()->get(SecurityContext::LAST_USERNAME),