Hi

That's what I thought too. Here's one of my controllers:

class BirdsController extends AppController {
        var $name = 'Birds';
        var $scaffold;
        var $components = array('Auth');

        function beforeFilter()
        {
                $this->Auth->userModel = 'Twitchers';
                $this->Auth->loginAction = array('controller' => 'twitchers',
'action' => 'login');
                // $this->Auth->allow('view');
                $this->Auth->redirectLogin = array('controller' => 'birds', 
'action'
=> 'view');
        }
}

However running any action in the birds view results in the above
mentioned error looking for a users controller.

On Dec 14, 6:48 pm, thatsgreat2345 <thatsgreat2...@gmail.com> wrote:
> That line should be in the beforeFilter , is that where it is located,
> if it is being used through out your controllers create an
> app_controller.php and add a beforeFilter to it that way auth is used
> by all your controllers, as well as you will only have to define the
> table once rather than in each controller.
>
> On Dec 14, 10:19 am, DavidH <djhollingwo......@gmail.com> wrote:
>
> > Sorry for the confusion.
>
> > Model: Twitcher
> > DB Table: Twitchers
> > Controller: twitchers_controller.php
>
> > I'm sure the Twitcher(s) stuff is OK. Why isn't it acting on my
> > userModel assignment?
>
> > David
>
> > On Dec 14, 5:50 pm, thatsgreat2345 <thatsgreat2......@gmail.com> wrote:
>
> > > The model is called Twichers? The model should be singular, called
> > > Twicher(models/twicher.php), the table in the database should be
> > > called twichers, and controller should be twichers_controller.php
> > > which you have.
>
> > > On Dec 14, 5:14 am, DavidH <djhollingwo........@gmail.com> wrote:
>
> > > > Hi
>
> > > > I'm sure there must be a simple solution to this; but I just can't get
> > > > it working.
>
> > > > I'm using CakePHP version 1.2.0.7296 RC2 and I'm trying to implement
> > > > authorization using the Auth component. My application uses a table /
> > > > model called "Twitchers" instead of users and so I've included the
> > > > line:
>
> > > > $this->Auth->userModel = 'Twitcher';
>
> > > > throughout my controllers. Howeevr it doesn't matter how many times I
> > > > include this line Cake persistently tells me it can't find the
> > > > UsersController in app/controllers/users_controller.php.
>
> > > > I do have a TwitchersController in twitchers_controller.php.
>
> > > > I've peppered just about every controller method with the userModel
> > > > assignment; but I just can't get Cake to accept it.
>
> > > > What have I omitted or done wrong?
>
> > > > Thanks
>
> > > > David
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to