You got debug set to 1 or 2 right? And its still giving you blank page?

Im far from knowing the solution, but I can see a couple things that may be
upsetting things:

When using the admin param in your route, your effectively pointing your
route to AdministratorsController::admin_login -> you specified login as
your login method

Also not sure if it will like using /admin as a route - not certain but
think it may upset things given that admin is set as the admin routing
prefix.

??? just some thoughts!!



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


I've been at this for a couple of hours now and I seem to be stuck.
I'm trying to enable a pretty simple admin section for an app and
would like to get familiar with the Auth component rather than rolling
my own. I'm varying a bit from the convention, here, so I'll try to
present what I have as simply as I can.

I have an Administrator model with email and password fields.  In my
AppController, I've defined:

        public $components = array ( 'Auth' );

        public function beforeFilter() {
                $this->Auth->userModel = 'Administrator';
                $this->Auth->fields    = array (
                        'username' => 'email',
                        'password' => 'password'
                );
                $this->Auth->userScope = array('User.active' => '1');

                $this->Auth->allow ( '*' );
                $this->Auth->deny ( 'admin_index' );

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

                $this->set ( 'Auth', $this->Auth->user() );
        }

I've also configured admin routing:

        Configure::write('Routing.admin', 'admin');

I've got an AdministratorsController with a login() method (and an
associated view):

        public function login() {
                echo '<p>HERE</p>';
        }

I've tried to wire my /admin route to /administrators/login:

        Router::connect (
                '/admin',
                array ( 'controller' => 'administrators', 'action' =>
'login',
'admin' => true )
        );

But when I try to access http://mydomain/admin, all I get is a blank
page; not even a default layout. I don't really understand the 'admin'
parameter, so maybe I'm using that wrong? I only used it because
that's what all of the examples seem to do.  I've tried both true and
false values, though, with no change in result.

I get the same result when trying to access the one method on the one
controller that I've denied: http://mydomain/admin/exhibitor_entries/index.

Any input that might put me on the right track would be appreciated.
I've looked at the docs and the source code, but something isn't
clicking for me.

Thanks.

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