With Symfony's Action Security if a user has not been identified he will be forwarded to the default login action as defined in the applications settings.yml file. How would I forward the user to the originally requested action after the user is successfully authenticated?
+3
A:
on first hit to your login action, store referer to the user session:
if(!$this->getUser()->hasParameter('referer'))
{
$this->getUser()->setParameter('referer',$this->getRequest()->getReferer();
}
and then when login succedes, redirect user to stored referer with:
$this->redirect($this->getUser()->getParameter('referer');
You have complete example in sfGuardPlugin:
deresh
2008-12-12 21:39:04