Question about posts index and auth issue

2012-01-02 Thread heohni
Hi, I have a page, where I want to display my blog posts by calling a requestAction to a function called frontindex() function. public function frontindex() { $all = $this-Post-find('all', array('order' = 'created DESC')); $this-set('posts', $all); return $all; } I am

Re: Question about posts index and auth issue

2012-01-02 Thread luca capra
A simple way could be checking if the user is logged in, like public function beforeFilter() { parent::beforeFilter(); if($this-Auth-user()) { $this-Auth-allow(array('index', 'frontindex')); } } Il 02/01/2012 10:18, heohni ha scritto: Hi, I have a page, where

Re: Question about posts index and auth issue

2012-01-02 Thread Jeremy Burns | Class Outfit
Surely setting the allow variable is enough. If the user is not logged, they are not allowed. Simple. No need to check further, let the auth component do it. Jeremy Burns Class Outfit http://www.classoutfit.com On 2 Jan 2012, at 14:39:11, luca capra wrote: A simple way could be checking if

Re: Question about posts index and auth issue

2012-01-02 Thread heohni
But now I not a step further? Does anyone has a hint for me? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this