To elaborate on this...

Assuming your main page is the standard static page in /pages/
home.ctp, you need to copy the pages_controller from /cake/lib/
controllers in the /app/controllers folder, and add the allow line
from Persianshadow.

In my case, my static pages are always visible for everybody so I
added this to the pages_controller

function beforeFilter() {
        $this->Auth->allow('*');
}

Then, all my controllers have this function, and I add the functions
depending on what non-logged-in users are allowed to do. For instance,
a products_controller can have this line:
        $this->Auth->allow('viewproducts', 'sale', 'menu', 'viewcart',
'addtocart', 'delfromcart', 'refreshcart', 'order');
Everything NOT in this is automatically closed for logged-in-users
only


On 20 okt, 11:08, persianshadow <[email protected]> wrote:
> you must use this method in BeforeFilter function:
>
> $this->Auth->allow('index');
>
> On Oct 20, 11:48 am, Davit Barbakadze <[email protected]> wrote:
>
> > Still not confident on this platform. It could be that the answer is
> > self-obvious, but just can't get my mind around it just yet.
>
> > I want my main page to be loaded despite of user authentication
> > status. Then I get additional content via Ajax, which should then
> > depend on whether user has been authenticated or not. So how should I
> > load the main page without redirect to login view going on behind the
> > scenes?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to