Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony]2 Autnetykacja kody błędów
meron11
post
Post #1





Grupa: Zarejestrowani
Postów: 78
Pomógł: 1
Dołączył: 17.08.2009

Ostrzeżenie: (0%)
-----


Zrobiłem sobie autentykacje, controlel do login forma z dokumentacji symfony:
  1. public function loginAction()
  2. {
  3. // get the login error if there is one
  4. if ($this->get('request')->attributes->has(SecurityContext::AUTHENTICATION_ERROR))
  5. {
  6. $error = $this->get('request')->attributes->get(SecurityContext::AUTHENTICATION_ERROR);
  7. }
  8. else
  9. {
  10. $error = $this->get('request')->getSession()->get(SecurityContext::AUTHENTICATION_ERROR);
  11. }
  12.  
  13. return $this->render('cmsAdminBundle:Secured:login.html.twig', array(
  14. // last username entered by the user
  15. 'last_username' => $this->get('request')->getSession()->get(SecurityContext::LAST_USERNAME),
  16. 'error' => $error,
  17. ));
  18. }



Działą tworzy sesje,ale jedna zagadka, zawsze jak wejdę na stronę logowania jest ostatni błąd, czyli np źle wpisałem hasło, wchodzę jeszcze raz wpisujac od nowa url ,błąd tkwi nadal, idize to jakoś "naprawić"?

Ten post edytował meron11 11.11.2011, 14:48:25
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.12.2025 - 16:47