When a non authenticated user tries to access a page defined as secure in security.yml
, symfony tries to access to the default/login
action.
To customize the "Login Required" page, add the executeLogin()
method in the apps/frontend/modules/default/actions/actions.class.php
file:
/**
* Warning page for restricted area - requires credentials
*
*/
public function executeLogin()
{
}
Then create the apps/frontend/modules/default/templates/loginSuccess.php
template.
If you want, you can grab the original file and modify it.
If you want to use an other module, modify apps/frontend/config/settings.yml
:
all:
.actions:
login_module: foo # To be called when a non-authenticated user
login_action: bar # Tries to access a secure page
Make sure that in your module, the signin action is un-secure. In apps/frontend/modules/foo/config/security.yml
:
bar:
is_secure: false
Clear your cache.
php symfony cc
Read the related symfony documentation
Powered by jQuery UI and symfony. Symfony Check
The content this site is published under a Creative Commons License. Some parts of the content are a remix of the official symfony documentation.