Hi i was just wondering if i am doing somethong not wanted or if i discovered a bug: i wanted to use a SecurityController twice cause i need exactly the same thing twice so why duplicating code:
i wanted to have two different login sections: _blub_login: resource: "@MopaDeals/Controller/SecurityController.php" type: annotation prefix: /blub _bla_login: resource: "@MopaDeals/Controller/SecurityController.php" type: annotation prefix: /bla so i could have to diffentent sections with authentification so i used the default secured controller: namespace Mopa\DealsBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Security\Core\SecurityContext; /** * @extra:Route("") */ class SecurityController extends Controller { /** * @extra:Route("/login", name="_login") * @extra:Template() */ public function loginAction() { if ($this->get('request')->attributes- >has(SecurityContext::AUTHENTICATION_ERROR)) { $error = $this->get('request')->attributes- >get(SecurityContext::AUTHENTICATION_ERROR); } else { $error = $this->get('request')->getSession()- >get(SecurityContext::AUTHENTICATION_ERROR); } return array( 'last_username' => $this->get('request')->getSession()- >get(SecurityContext::LAST_USERNAME), 'error' => $error, ); } /** * @extra:Route("/login_check", name="_security_check") */ public function securityCheckAction() { // The security layer will intercept this request } /** * @extra:Route("/logout", name="_demo_logout") */ public function logoutAction() { // The security layer will intercept this request } /** * @extra:Routes({ * @extra:Route("/hello", defaults={"name"="World"}), * @extra:Route("/hello/{name}", name="_demo_secured_hello") * }) * @extra:Template() */ public function helloAction($name) { return array('name' => $name); } } but if i use it like that only the last route is recognized. i am thinkin somehow the wrong thing or is it not inteded to do it this way ? -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en