Permalink
Browse files

bug #3779 [Book][Security] constants are defined in the SecurityConte…

…xtInterface (xabbuh)

This PR was merged into the 2.3 branch.

Discussion
----------

[Book][Security] constants are defined in the SecurityContextInterface

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | no
| Applies to    | all
| Fixed tickets |

Commits
-------

4b7c8c2 [Book][Security] constants are defined in the SecurityContextInterface
  • Loading branch information...
weaverryan committed May 6, 2014
2 parents f665e14 + 4b7c8c2 commit 80d70a4907e6e26784c63f6c41fae8e2d57b67db
Showing with 6 additions and 6 deletions.
  1. +6 −6 book/security.rst
View
@@ -436,7 +436,7 @@ Next, create the controller that will display the login form::
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Security\Core\SecurityContextInterface;
class SecurityController extends Controller
{
@@ -445,20 +445,20 @@ Next, create the controller that will display the login form::
$session = $request->getSession();
// get the login error if there is one
if ($request->attributes->has(SecurityContext::AUTHENTICATION_ERROR)) {
if ($request->attributes->has(SecurityContextInterface::AUTHENTICATION_ERROR)) {
$error = $request->attributes->get(
SecurityContext::AUTHENTICATION_ERROR
SecurityContextInterface::AUTHENTICATION_ERROR
);
} else {
$error = $session->get(SecurityContext::AUTHENTICATION_ERROR);
$session->remove(SecurityContext::AUTHENTICATION_ERROR);
$error = $session->get(SecurityContextInterface::AUTHENTICATION_ERROR);
$session->remove(SecurityContextInterface::AUTHENTICATION_ERROR);
}
return $this->render(
'AcmeSecurityBundle:Security:login.html.twig',
array(
// last username entered by the user
'last_username' => $session->get(SecurityContext::LAST_USERNAME),
'last_username' => $session->get(SecurityContextInterface::LAST_USERNAME),
'error' => $error,
)
);

0 comments on commit 80d70a4

Please sign in to comment.