Hi!

I am also falling in love with it, so far as to become jealous already :)

The authentication is what you did at your users pages. The authentication 
and authorization are different. Now you have to set up the authorization 
using some method, like controller/action authorization for example. And 
then during the check you redirect users to login if they are not yet 
logged in. But this has to be set up.

If you want it simple, you add something like this to your app controller;
        public $components = array(
                'Auth' => array(
                        'loginAction' => array(
                                'controller' => 'users',
                                'action' => 'login',
                        ),
                        'loginRedirect' => array(
                                'controller' => 'users',
                                'action' => 'view',
                        ),
           );
And it will automatically redirect users to users/login if they are not 
logged in.
Then you use $this->Auth->allow() and $this->Auth->deny() in your 
controllers to control what methods are available to anonymous users.

There are other alternatives but this is the most basic setup, I think.
Cheers!

On Saturday, 7 July 2012 23:20:59 UTC+2, David Lozzi wrote:
>
> Hi there,
>
> I'm new to CakePHP, and falling in love it with. A question on how this 
> all works. 
>
> I have setup a route for admin, so domain/admin/news, and 
> domain/admin/users work.
>
> I have added authentication using the CakePHP tutorial, but it's added to 
> a single controller, my users. I want it applied to all items under admin. 
> Is it possible to set this up, so whatever in admin requires auth, and goes 
> to a shared login page?
>
>

-- 
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 group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to