>> "I gave up in the end as I had to make so many changes"

>> => The only changes that I had to make for now is to add the following
>> code in all my controllers :

That's going to be a lot of maintenance.


>> Can you please give me more details about
>> those changes ? What do you advise me to do ? I'm working on a serious
>> project (at the office, so not just for fun) so if it's necessary to
>> have a Users controller I'll make one...

I can't really give you details because I never got it working by
reconfiguring and it would (may) just lead you along the wrong path.

It gets to the point in a 'serious project' where you have to stop
digging and move on. This thread has now run to 14 messages.

I now have a rule that if after an hour it looks like I'm going
nowhere I do something else. That's why I opted to go with the
standard out of the box approach. Follow the manual word for word and
it'll just work.

On Jun 5, 4:53 pm, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> >    => Do you think it will work as my solution which was about the same
> > technically (except I didn't use the parent beforeFilter() method and my
> > initializeAuthComponent() wasn't private) didn't ?
>
> I don't know what are you doing in your setup in order to make it
> don't work, for me is working great.
>
> > BTW, I don't understand why my solution didn't work, but this Auth component
> > seems a little strange...
>
> The Auth component works just fine.
>
>
>
> > 2008/6/5 Dardo Sordi Bogado <[EMAIL PROTECTED]>:
>
> >> > I guess that when you declare a beforeFilter() method in a controller
> >> > (which extends AppController) it overrides the
> >> > AppController::beforeFilter() ? Am I right ?
>
> >> Yes, then you just need to call parent::beforeFilter() inside the
> >> beforeFilter method from the controller you are declaring.
>
> >> Usually, when you override a parent method for extending it's
> >> functionality you need to call it manually.
>
> >> > I'm going to do the following :
>
> >> > 1) In my AppController I'll put this :
>
> >> > function initializeAuthComponent()
> >> > {
> >> >        $this->Auth->userModel = "Utilisateur";
> >> >        $this->Auth->fields = array('username' => 'login', 'password' =>
> >> > 'pass');
> >> >        $this->Auth->loginAction = array('controller' => 'utilisateurs',
> >> > 'action' => 'login');
> >> >        $this->Auth->loginError = __("Identifiant et/ou mot de passe
> >> > incorrect", true);
> >> > }
>
> >> > 2) In all of my controllers extending AppController I'll do this :
>
> >> > function beforeFilter()
> >> > {
> >> >        $this->initializeAuthComponent();
> >> >        $this->Auth->allow("allowedAction1", "allowedAction2", ...);
> >> > }
>
> >> I use to do this:
>
> >> Create a private function _setupAuth() in AppController, then in
> >> AppController::beforeFilter() call it and in child controller's
> >> beforeFilter() just call parent::beforeFilter().
>
> >> > Thanks for your time.
>
> >> You are welcome.
>
> >> Regards,
> >> - Dardo Sordi.
>
> >> > On 5 juin, 13:02, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
> >> >> Ignore the previous code, I hit the send button by accident
>
> >> >> class ThingsControllers extends Appcontroller {
>
> >> >>     var $name = 'Things';
>
> >> >>     function beforeFilter() {
>
> >> >>         parent::beforeFilter();
>
> >> >>         // this controller custom stuff
>
> >> >>     }
>
> >> >> }
>
> >> >> Regards,
> >> >> - Dardo Sordi
--~--~---------~--~----~------------~-------~--~----~
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