thanks for the answer. I added a deny-action to the beforeFilter function now. But now I get the error that the isAuthorized function is missing.
Warning (512): Members::isAuthorized() is not defined. [CORE/cake/libs/ controller/controller.php, line 808] I looked in the book and I tried it this way too http://book.cakephp.org/view/1258/deny but I keep getting the same answer. On 6 sep, 14:26, "Max Dörfler" <[email protected]> wrote: > Hi, > > Since it's the login and register action, I bet you have them in > allow(). So the Auth component is disabled for those actions and > isAuthorized is never called. You need to check it somewhere else (e.g. > beforeFilter). > > Max > > Am 05.09.2010 22:28, schrieb Simon: > > > > > I have a isAuthorized function in my controller because $this->Auth- > > >> authorize is set to 'controller'. > > > This is my function (the comments explains everything): > > function isAuthorized() > > { > > parent::isAuthorized(); > > > //if the user is logged in. He cannot access the register and login > > function > > if( ($this->action == 'registreren') || ($this->action == > > 'login') ) > > { > > if( $this->Auth->user() ) > > { > > return false; > > } > > else > > { > > return true; > > } > > } > > > //other actions are available for everyone > > return true; > > } > > > The problem is that it seems that this function is not called because > > when I'm logged in, I still can access the registreren action. > > > Is there something I'm doing wrong. Or have I misunderstood the > > meaning of this function? > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
