3
設置Symfony2.2,我在我的登錄表單下面的代碼後:的Symfony 2.2 - 在開發環境登錄後壞重定向
<input type="hidden" name="_target_path" value="{{path('rok_admin_default_index')}}"/>
凡rok_admin_default_index
指向「/」所以基本上主頁的應用程序。在開發過程中,我使用了app_dev.php
(我明顯),但是在開發環境中成功登錄後,Symfony將我重定向到domain.com/app_dev.php/app_dev.php/而不是domain.com/app_dev.php/
我security.yml:
jms_security_extra:
secure_all_services: false
expressions: true
security:
encoders:
ROK\AdminBundle\Entity\User: sha512
role_hierarchy:
ROLE_MOD: ROLE_USER
ROLE_ADMIN: [ROLE_MOD, ROLE_USER]
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
providers:
main:
entity: { class: ROK\AdminBundle\Entity\User, property: email }
in_memory:
memory:
users:
user: { password: userpass, roles: [ 'ROLE_USER' ] }
mod: {password: modpass, roles: ['ROLE_MOD']}
admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }
firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
login:
pattern: ^/login$
security: false
secured_area:
pattern: ^/admin/
form_login:
check_path: login_check
login_path: login
logout: ~
#anonymous: ~
#http_basic:
# realm: "Secured Demo Area"
access_control:
- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/admin, roles: ROLE_ADMIN}
這正是我需要:) – Dreadnoth 2013-03-16 09:22:31