Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [Symfony2][SF][SF2]Problem przy instalacji FosUserBundle
Crash89
post 5.06.2015, 18:12:31
Post #1





Grupa: Zarejestrowani
Postów: 191
Pomógł: 7
Dołączył: 3.04.2013

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


Próbuję zainstalować najnowsze FosUserBundle do Symfony 2.6.6
Robię wszystko tak jak jest opisane w instrukcji do instalacji pakietu,ale w momencie aktualizacji struktury bazy danych
Wyskakuje błąd:

unrecognized option "csrf_provider" under "security.firewalls.user"



Poniżej przedstawiam zawartość security.yml:
  1. # you can read more about security in the related section of the documentation
  2. security:
  3. encoders:
  4. Symfony\Component\Security\Core\User\User: plaintext
  5. FOS\UserBundle\Model\UserInterface: sha512
  6.  
  7. role_hierarchy:
  8. ROLE_ADMIN: ROLE_USER
  9. ROLE_SUPER_ADMIN: ROLE_ADMIN
  10. providers:
  11. fos_userbundle:
  12. id: fos_user.user_provider.username
  13. # the main part of the security, where you can set up firewalls
  14. # for specific sections of your app
  15. firewalls:
  16. user:
  17. pattern: ^/
  18. form_login:
  19. provider:
  20. fos_userbundle
  21. csrf_provider:
  22. security.csrf.token_manager # Use form.csrf_provider instead for Symfony <2.4
  23. logout: true
  24. #path: logout
  25. #target: _demo
  26. anonymous: true
  27. dev:
  28. pattern: ^/(_(profiler|wdt)|css|images|js)/
  29. security: false
  30.  
  31. login:
  32. pattern: ^/demo/secured/login$
  33. security: false
  34.  
  35. secured_area:
  36. pattern: ^/demo/secured/
  37. form_login:
  38. check_path: _security_check
  39. login_path: _demo_login
  40. logout:
  41. path: _demo_logout
  42. target: _demo
  43. # disables authentication for assets and the profiler, adapt it according to your needs
  44.  
  45. # the login page has to be accessible for everybody
  46.  
  47.  
  48. # secures part of the application
  49.  
  50. #http_basic:
  51. # realm: "Secured Demo Area"
  52.  
  53. # with these settings you can restrict or allow access for different parts
  54. # of your application based on roles, ip, host or methods
  55. access_control:
  56. - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  57. - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
  58. - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
  59. - { path: ^/admin/, role: ROLE_ADMIN }

i config.yml:
  1. framework:
  2. #esi: ~
  3. translator: ~
  4. secret: "%secret%"
  5. router:
  6. resource: "%kernel.root_dir%/config/routing.yml"
  7. strict_requirements: ~
  8. form: ~
  9. csrf_protection: ~
  10. validation: { enable_annotations: true }
  11. templating:
  12. engines: ['twig']
  13. #assets_version: SomeVersionScheme
  14. default_locale: "%locale%"
  15. trusted_hosts: ~
  16. trusted_proxies: ~
  17. session:
  18. # handler_id set to null will use default session handler from php.ini
  19. handler_id: ~
  20. fragments: ~
  21. http_method_override: true


Próbowałem zmienić wartosc framework.csrf_protection na enable: true ale to nic nie dało.
Wydaje mi się że problem leży przy wpisaniu poprawnej wartośći do csrf_provider, niestety nie wiem jaka to jest.

Ten post edytował Crash89 5.06.2015, 18:15:17
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 11:51