Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 6th, 2012  |  syntax: None  |  size: 1.60 KB  |  hits: 12  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Why is my symfony2 fosUserBundle not able to find the check_path?
  2. security:
  3.     encoders:
  4.         "FOSUserBundleModelUserInterface": sha512
  5.  
  6.     role_hierarchy:
  7.         ROLE_ADMIN:       ROLE_USER
  8.         ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
  9.  
  10.     providers:
  11.         fos_userbundle:
  12.             id: fos_user.user_manager
  13.         in_memory:
  14.             users:
  15.                 user:  { password: userpass, roles: [ 'ROLE_USER' ] }
  16.                 admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
  17.  
  18.     firewalls:
  19.         dev:
  20.             pattern:  ^/(_(profiler|wdt)|css|images|js)/
  21.             security: false
  22.  
  23.         # Firewall pour les pages de connexion, inscription, et récupération de mot de passe
  24.         login:
  25.             pattern:   ^/(login$|register|resetting)  # Les adresses de ces pages sont login, register et resetting
  26.             anonymous: true                           # On autorise bien évidemment les anonymes sur ces pages !
  27.  
  28.         admin:
  29.             switch_user:        true
  30.             context:            user
  31.             pattern:            /admin(.*)
  32.             form_login:
  33.                 provider:       fos_userbundle
  34.                 login_path:     /login
  35.                 use_forward:    false
  36.                 check_path:     /admin/login_check
  37.                 failure_path:   null
  38.                 use_referer:    true
  39.             logout:
  40.                 path:           /admin/logout
  41.                 target:         /login_path
  42.     access_control:
  43.         - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
  44.         - { path: ^/admin/, role: ROLE_ADMIN }