Re: Auth Broken.
Are you using scaffolding? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Broken.
On Sun, Jan 4, 2009 at 11:59 AM, mark_story wrote: > > gearvOsh is correct in addition, when you have a public action > isAuthorized is never called. Why would it? you are visiting a public > url. > To add to the above, isAuthorized() is called by Auth after it logs someone in. The purpose is to query the controller (if you have "$this->Auth->authorize = 'controller';") to get *further* authorisation credentials (or whatever). It's not an *attribute* that Auth sets (ie. user->is_authorized) but a question for the controller (ie. $controller->isThis UserReallyAuthorized()). The method is meant as an additional routine that you can create after login and it should return a boolean. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Broken.
gearvOsh is correct in addition, when you have a public action isAuthorized is never called. Why would it? you are visiting a public url. -Mark On Jan 4, 1:14 am, Matt Williamson wrote: > Hey Guys, > > I am trying to use the Auth component, but I'm pretty sure there's > some bug preventing me from doing so. Here is what my > app_controller.php looks like: > > class AppController extends Controller { > var $components = array('Auth'); > > function beforeFilter(){ > $this->Auth->allow('*'); > $this->Auth->logoutRedirect = '/'; > $this->Auth->loginRedirect = '/'; > $this->Auth->authorize = 'controller'; > } > > function isAuthorized(){ > die('isAuthorized Called!'); > }} > > ?> > > Whenever I browse to a view, I get redirected to the login page. I'd > expect the behavior to allow access to the view or at least the string > 'isAuthorized Called!' to be printed, but it seems the isAuthorized > method is never called. The following works, though: > > $this->Auth->allowedActions = array('*'); > > I am using PHP4 on XAMPP/Windows. > > Can someone try to reproduce and/or tell me what I'm doing wrong? > > Thanks, > > Matt --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Broken.
Firstly use PHP 5. Secondly remove $this->Auth->allow('*'). Why are you even using the Auth component if your allowing all pages to be viewable? Perhaps place this in each controller separately. And thirdly, I thought isAuthorized is called after you are logged in. Someone correct me if im wrong. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Auth Broken.
P.S. I'm using release 1.2.0.7962. On Sun, Jan 4, 2009 at 1:14 AM, Matt Williamson wrote: > Hey Guys, > > I am trying to use the Auth component, but I'm pretty sure there's > some bug preventing me from doing so. Here is what my > app_controller.php looks like: > > class AppController extends Controller { >var $components = array('Auth'); > >function beforeFilter(){ >$this->Auth->allow('*'); >$this->Auth->logoutRedirect = '/'; >$this->Auth->loginRedirect = '/'; >$this->Auth->authorize = 'controller'; >} > >function isAuthorized(){ >die('isAuthorized Called!'); >} > } > ?> > > Whenever I browse to a view, I get redirected to the login page. I'd > expect the behavior to allow access to the view or at least the string > 'isAuthorized Called!' to be printed, but it seems the isAuthorized > method is never called. The following works, though: > > $this->Auth->allowedActions = array('*'); > > I am using PHP4 on XAMPP/Windows. > > Can someone try to reproduce and/or tell me what I'm doing wrong? > > > > Thanks, > > Matt --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Auth Broken.
Hey Guys, I am trying to use the Auth component, but I'm pretty sure there's some bug preventing me from doing so. Here is what my app_controller.php looks like: Auth->allow('*'); $this->Auth->logoutRedirect = '/'; $this->Auth->loginRedirect = '/'; $this->Auth->authorize = 'controller'; } function isAuthorized(){ die('isAuthorized Called!'); } } ?> Whenever I browse to a view, I get redirected to the login page. I'd expect the behavior to allow access to the view or at least the string 'isAuthorized Called!' to be printed, but it seems the isAuthorized method is never called. The following works, though: $this->Auth->allowedActions = array('*'); I am using PHP4 on XAMPP/Windows. Can someone try to reproduce and/or tell me what I'm doing wrong? Thanks, Matt --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---