Depends on your app in my opinion,

Sometimes you want an admin login and a "normal" login, sometimes the one login 
is sufficient for both, depends where your users are coming from and going to 
and what they should and shouldn’t see to exist.

The only thing you need to double check on here is you mentioned your url as 
http://mydomain/entries/admin_index -> an admin route would be accessed like 
this http://mydomain/admin/entries/index






-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of 
Rob Wilkerson
Sent: Tuesday, January 13, 2009 9:52 AM
To: [email protected]
Subject: Re: Wrestling with the Auth Component


On Mon, Jan 12, 2009 at 3:35 PM, Rob Wilkerson <[email protected]> wrote:
>> When using the admin param in your route, your effectively pointing your
>> route to AdministratorsController::admin_login -> you specified login as
>> your login method

Okay, you're dead-on. As soon as I rename the login() method to
admin_login(), I get the output indicating the missing view (as
expected since my view is login.ctp). I then changed my redirect to
specify the 'admin' param as false and was able to use my regular
login() method:

                $this->Auth->loginAction = array (
                        'controller' => 'administrators',
                        'action'     => 'login',
                        'admin'      => false
                );

Now, when I try to access http://mydomain/entries/admin_index, I'm
redirected to /administrators/login and get my login view, but this
isn't really something I've seen in the formal or "informal"
documentation. Am I deviating from a best practice or doing something
less than optimal?

Thanks again.

-- 
Rob Wilkerson
http://robwilkerson.org


No virus found in this incoming message.
Checked by AVG - http://www.avg.com 
Version: 8.0.176 / Virus Database: 270.10.6/1888 - Release Date: 1/12/2009 7:04 
AM


--~--~---------~--~----~------------~-------~--~----~
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