Суть проблемы такая:
Необходимо отделить пользователей поддомена организаций от пользователей основного сайта и соответственно использовать форму
делал как описано
тут, но firewall organization не срабатывает. Пожалуйста, подскажите что я делаю не так.
security:
encoders:
FOS\UserBundle\Model\UserInterface: sha512
role_hierarchy:
ROLE_ORGANIZATION_USER: ROLE_USER
ROLE_ORGANIZATION_ADMIN: ROLE_USER
ROLE_ADMIN: [ROLE_USER, ROLE_ORGANIZATION_ADMIN]
ROLE_SUPER_ADMIN: ROLE_ADMIN
providers:
fos_userbundle:
id: fos_user.user_provider.username_email
fs.organization_user_provider:
id: fs.organization_user_provider
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
form_login:
login_path: fos_user_security_login
provider: fos_userbundle
check_path: fos_user_security_check
failure_path: fos_user_security_login
default_target_path: fs_user_security_login_success
always_use_default_target_path: true
csrf_provider: form.csrf_provider
logout:
path: fos_user_security_logout
anonymous: true
oauth:
resource_owners:
facebook: facebook_login
login_path: fos_user_security_login
failure_path: fb_login_failure
success_handler: oauth_handler
failure_handler: oauth_handler
oauth_user_provider:
service: cp.oauth_aware.user_provider.service
organization:
pattern: ^/
anonymous: ~
host: host1.%website_host%
form_login:
login_path: organization_login
provider: fs.organization_user_provider
check_path: fos_user_security_check
failure_path: organization_login
csrf_provider: form.csrf_provider
logout:
path: fos_user_security_logout
access_control:
- { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY}
- { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/profile/show/, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/profile/, roles: [ROLE_USER] }
- { path: /admin/, role: ROLE_ADMIN }
- { path: ^/, role: ROLE_ORGANIZATION_USER, host: host1.%website_host% }
- { path: ^/login, role: IS_AUTHENTICATED_ANONYMOUSLY, host: host1.%website_host% }